Skip to content

[Code Quality] Extract CreateEntityBaseConfig to deduplicate shared safe-output config fields #46840

Description

@github-actions

Description

Three safe-output config types (CreateIssuesConfig, CreateDiscussionsConfig, CreatePullRequestsConfig) already share BaseSafeOutputConfig, but a second tier of ~8 entity-creation fields (TitlePrefix, Labels, AllowedLabels, TargetRepoSlug, AllowedRepos, CloseOlderKey, Expires, Footer) is copy-pasted with identical YAML tags across all three.

Suggested Changes

  • Create a CreateEntityBaseConfig struct embedding BaseSafeOutputConfig plus the shared entity fields
  • Embed CreateEntityBaseConfig in CreateIssuesConfig, CreateDiscussionsConfig, and CreatePullRequestsConfig
  • Remove the duplicated fields from each struct
  • Verify JSON/YAML tags remain identical

Files Affected

  • pkg/workflow/create_issue.go (line ~12)
  • pkg/workflow/create_discussion.go (line ~14)
  • pkg/workflow/create_pull_request.go (line ~33)

Success Criteria

  • A new CreateEntityBaseConfig struct exists with shared fields
  • All three config types embed it
  • All existing tests pass
  • No regression in YAML parsing/serialization

Source

Extracted from Typist - Go Type Consistency Analysis (2026-07-20) #46823

Priority

Medium - Cuts drift surface for future field additions. Effort: 2-3 hours.

🔍 Task mining by Discussion Task Miner - Code Quality Improvement Agent · 35.6 AIC · ⌖ 5.2 AIC · ⊞ 7K ·

  • expires on Jul 21, 2026, 5:27 AM UTC-08:00

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions