Some checks failed
Report errors, panics and optional performance traces to Sentry. Sentry stays disabled unless SENTRY_DSN is set. - slog ERROR records become Sentry issues, with the error attribute promoted to an exception so issues group by root cause - queue worker, reminder worker, cache cleanup and HTTP handler panics are captured with a stack trace - events carry platform/plugin/component tags for filtering - HTTP requests are traced when SENTRY_TRACES_SAMPLE_RATE is above 0; /healthz is never traced Configured credentials are redacted from every outgoing payload. This is required rather than defensive: the Telegram webhook embeds the bot token in its URL path, and failed Telegram API calls quote that URL in their error text, so events would otherwise carry the token in the clear. A new platform must register its credential in Config.Secrets(). Also moves the module to Go 1.27, refreshes every dependency and pins golangci-lint v2.13.2. sentry-go 0.48 removed issue creation from its slog integration, so the ERROR-to-issue conversion lives in internal/observability/handler.go instead of relying on the SDK; leaving it to the SDK would have silently downgraded issues to log lines. Claude-Session: https://claude.ai/code/session_01W7tcpMTEyk9RrHvT7Be5zZ
57 lines
1.2 KiB
Makefile
57 lines
1.2 KiB
Makefile
PROJECT_NAME := butterrobot
|
|
CGO_ENABLED := 0
|
|
|
|
DIST_PATH := ./dist
|
|
TEST_OPTIONS := -v -failfast -race -cover
|
|
|
|
GOLANGCI_LINT_VERSION := v2.13.2
|
|
|
|
.DEFAULT_GOAL := help
|
|
|
|
## help: Display this help message
|
|
.PHONY: help
|
|
help:
|
|
@echo "Available targets:"
|
|
@grep -E '^## ' $(MAKEFILE_LIST) | sed 's/## / /' | sort
|
|
|
|
## build: Build project using goreleaser (snapshot)
|
|
.PHONY: build
|
|
build:
|
|
goreleaser build --snapshot --clean
|
|
|
|
## build-docker: Build Docker image locally via goreleaser
|
|
.PHONY: build-docker
|
|
build-docker:
|
|
goreleaser release --snapshot --clean
|
|
|
|
## run: Run the server directly via go run
|
|
.PHONY: run
|
|
run:
|
|
CGO_ENABLED=$(CGO_ENABLED) go run ./cmd/$(PROJECT_NAME)
|
|
|
|
## format: Format code and tidy modules
|
|
.PHONY: format
|
|
format:
|
|
go fmt ./...
|
|
go mod tidy
|
|
|
|
## ci-lint: Run golangci-lint (installs if missing)
|
|
.PHONY: ci-lint
|
|
ci-lint:
|
|
@which golangci-lint > /dev/null 2>&1 || go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION)
|
|
golangci-lint run ./...
|
|
|
|
## lint: Run linters
|
|
.PHONY: lint
|
|
lint: ci-lint
|
|
|
|
## test: Run tests with coverage
|
|
.PHONY: test
|
|
test:
|
|
CGO_ENABLED=1 go test $(TEST_OPTIONS) -timeout 1m ./...
|
|
|
|
## clean: Remove build artifacts
|
|
.PHONY: clean
|
|
clean:
|
|
rm -rf $(DIST_PATH)
|
|
go clean -cache
|