Repository navigation
chore: prep batch 2 — refactor literals to constants for golangci-lint v2.12 - #23
Merged
Merged
Conversation
…compatibility Continues the goconst preparation for the golangci-lint v2.12.0 upgrade (Renovate PR #20). v2.12 detects significantly more goconst occurrences than v2.11.4 and refused this codebase outright until they were addressed. Refactor highlights: - internal/notifications/constants.go - shared productName, productMonitoring, fieldLabelMonitor across discord/googlechat/ mattermost/opsgenie/ntfy/pushover senders - internal/mcp/constants.go - shared JSON-RPC and JSON Schema property keys (jsonRPCVersion, schemaKey*, prop*) across all tool definitions - internal/db/models/result.go - canonical PeriodType{Raw,Hour, Day,Month} constants used by aggregation jobs and worker code - internal/checkers/checkdns/checker.go - record type constants (recordTypeA/AAAA/CNAME/MX/NS/TXT/SOA) used consistently across the lookup switch and samples - internal/checkers/check{docker,mongodb,ssl,js,dns}/checker.go - use checkerdef.OutputKeyError instead of the literal "error" - internal/handlers/auth/handler.go - fieldBody/fieldPassword/ fieldCode constants - internal/handlers/{checks,statuspages,maintenancewindows}/ handler.go - fieldBody constants - internal/handlers/incidents/service.go - keyCheckUID/keyCheckSlug - internal/integrations/slack/types.go - ActionAddCheck constant; client.go - apiKey{Channel,Text,User,View} - internal/checkworker/worker.go - periodTypeRaw, outputKeyMessage - pkg/cli/constants.go - keySuccess/keyMessage/keyFailed - internal/prommetrics/metrics.go - use existing labelStatus/ labelRegion/labelOrganization/labelCheckSlug constants - internal/jobs/jobtypes/job_aggregation.go - alias jobtypes period* constants to models.PeriodType* Net: 0 lint issues; tests pass. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
fclairamb
enabled auto-merge (squash)
May 1, 2026 23:53
Per code review on PR #23: every literal map key in internal/handlers/incidents/service.go now has a named constant — keyStartedAt, keyResultUID, keyResolvedAt, keyDurationSeconds, keyTotalFailures, keyFailureCount, keyEscalationThreshold, keyRelapseCount, keyEffectiveRecoveryThreshold. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
The E2E job intermittently fails when GitHub-hosted runners cannot resolve azure.archive.ubuntu.com during apt-get install of Playwright system fonts (fonts-ipafont-gothic etc.). Wrap the install command in a 3-attempt retry loop so transient DNS resolution failures auto-recover. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
internal/notifications/constants.go,internal/mcp/constants.go, and canonicalmodels.PeriodType*values.Test plan
golangci-lint runclean (0 issues, with v2.11.4)go build ./...cleango test ./...passes🤖 Generated with Claude Code