-
Notifications
You must be signed in to change notification settings - Fork 329
[plan] Split constants.go into domain-grouped files #23909
Copy link
Copy link
Closed
Labels
Description
Objective
Split pkg/constants/constants.go (1,083 lines) into domain-grouped constant files to improve discoverability and adhere to the 300-line guideline.
Context
From discussion #23903 (Repository Quality: File Size Discipline). All constants are bundled regardless of domain, making navigation difficult. The type system is well-designed (semantic types with String()/IsValid() methods) — just group them by domain into separate files.
Approach
Split by domain:
pkg/constants/engine_constants.go—EngineNametype +String()/IsValid()methods + all engine name constants (CopilotEngine,ClaudeEngine,CodexEngine,CustomEngine, etc.)pkg/constants/job_constants.go—JobNameandStepIDtypes with their methods and all job name / step ID constantspkg/constants/url_constants.go—URLandDocURLtypes with their methods and all URL constantspkg/constants/version_constants.go—VersionandModelNametypes with their methods and all version/model name constantspkg/constants/feature_constants.go—FeatureFlagtype with its methods and all feature flag constants- Keep
pkg/constants/constants.goforCommandPrefix,LineLength,WorkflowID, and any truly general constants
Rules
- Same package (
package constants) - Do NOT change type names, constant names, or method signatures
- Run
make fmtafter changes - Run
go test ./pkg/constants/...to validate - Run
make agent-finishbefore committing
Acceptance Criteria
- Each domain-focused file created with appropriate types and constants
-
constants.goreduced to general constants — under 300 lines - All files compile successfully
- All existing tests pass (
go test ./pkg/constants/...) - Each file under 300 lines
Generated by Plan Command for issue #discussion #23903 · ◷
- expires on Apr 3, 2026, 2:40 PM UTC
Reactions are currently unavailable
Metadata
Metadata
Labels
Type
Fields
Give feedbackNo fields configured for issues without a type.