Description
A Go type consistency audit (discussion #50840) found AllowedLabels []string duplicated identically across 5 structs in pkg/workflow, while a shared SafeOutputFilterConfig struct already exists (pkg/workflow/safe_outputs_parser.go:17) for exactly this kind of shared filter field.
Suggested Changes
- Add
AllowedLabels []string to the existing SafeOutputFilterConfig shared struct
- Embed
SafeOutputFilterConfig (or ensure it's already embedded) in the 5 structs below instead of redeclaring the field
- Verify yaml marshal/unmarshal behavior is unchanged after the migration
Files Affected
pkg/workflow/create_pull_request.go:39
pkg/workflow/create_issue.go:17
pkg/workflow/create_discussion.go:20
pkg/workflow/update_discussion.go:18
pkg/workflow/merge_pull_request.go:14 (marked deprecated in favor of required-labels)
pkg/workflow/safe_outputs_parser.go:17 (shared struct definition)
Success Criteria
Source
Extracted from Typist - Go Type Consistency Analysis (discussion #50840)
Priority
Medium - low-risk mechanical deduplication, shared struct already exists (1-2 hour estimate)
🔍 Task mining by Discussion Task Miner - Code Quality Improvement Agent · auto · 35.3 AIC · ⌖ 4.12 AIC · ⊞ 10.2K · ◷
Description
A Go type consistency audit (discussion #50840) found
AllowedLabels []stringduplicated identically across 5 structs inpkg/workflow, while a sharedSafeOutputFilterConfigstruct already exists (pkg/workflow/safe_outputs_parser.go:17) for exactly this kind of shared filter field.Suggested Changes
AllowedLabels []stringto the existingSafeOutputFilterConfigshared structSafeOutputFilterConfig(or ensure it's already embedded) in the 5 structs below instead of redeclaring the fieldFiles Affected
pkg/workflow/create_pull_request.go:39pkg/workflow/create_issue.go:17pkg/workflow/create_discussion.go:20pkg/workflow/update_discussion.go:18pkg/workflow/merge_pull_request.go:14(marked deprecated in favor ofrequired-labels)pkg/workflow/safe_outputs_parser.go:17(shared struct definition)Success Criteria
AllowedLabelsfield added once toSafeOutputFilterConfigand embedded in the 5 structsmake test-unitpassesSource
Extracted from Typist - Go Type Consistency Analysis (discussion #50840)
Priority
Medium - low-risk mechanical deduplication, shared struct already exists (1-2 hour estimate)