Description
pkg/workflow/engine_definition.go declares SecretStrategy, ProviderEnvMode, and MergeStrategy as plain string fields (lines ~189, ~204, ~231). Using raw strings for these config knobs allows invalid/typo values to pass compile-time checks and only fail (or silently misbehave) at runtime.
Suggested Changes
- Define named types (e.g.
type SecretStrategy string, type ProviderEnvMode string, type MergeStrategy string) with exported constants for each valid value.
- Update the struct fields in
engine_definition.go to use the new named types instead of bare string.
- Add validation (or a
IsValid() method) for each enum type, used during frontmatter/schema validation.
- Update call sites that compare these fields against string literals to use the new constants.
Files Affected
pkg/workflow/engine_definition.go (lines ~189, ~204, ~231)
Success Criteria
SecretStrategy, ProviderEnvMode, MergeStrategy are named types with defined constants
- Invalid values are caught via validation with clear error messages
- Existing tests pass; new tests cover invalid-value rejection
Source
Extracted from Typist - Go Type Consistency Analysis #50840
Priority
Low-Medium - small, low-risk typing improvement
🔍 Task mining by Discussion Task Miner - Code Quality Improvement Agent · auto · 47.5 AIC · ⌖ 3.92 AIC · ⊞ 10.2K · ◷
Description
pkg/workflow/engine_definition.godeclaresSecretStrategy,ProviderEnvMode, andMergeStrategyas plainstringfields (lines ~189, ~204, ~231). Using raw strings for these config knobs allows invalid/typo values to pass compile-time checks and only fail (or silently misbehave) at runtime.Suggested Changes
type SecretStrategy string,type ProviderEnvMode string,type MergeStrategy string) with exported constants for each valid value.engine_definition.goto use the new named types instead of barestring.IsValid()method) for each enum type, used during frontmatter/schema validation.Files Affected
pkg/workflow/engine_definition.go(lines ~189, ~204, ~231)Success Criteria
SecretStrategy,ProviderEnvMode,MergeStrategyare named types with defined constantsSource
Extracted from Typist - Go Type Consistency Analysis #50840
Priority
Low-Medium - small, low-risk typing improvement