Skip to content

[Code Quality] Add AllowedLabels to shared SafeOutputFilterConfig and embed in 5 duplicated structs #50965

Description

@github-actions

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

  • AllowedLabels field added once to SafeOutputFilterConfig and embedded in the 5 structs
  • No duplicate raw field declarations remain
  • Existing yaml round-trip / config parsing tests pass unchanged
  • make test-unit passes

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 ·

  • expires on Aug 7, 2026, 5:44 PM UTC-08:00

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions