Skip to content

[Code Quality] Split generateCheckoutGitHubFolderForActivation (92 lines) into smaller functions #48058

Description

@github-actions

Description

The function generateCheckoutGitHubFolderForActivation in compiler_activation_job.go is 92 lines — nearly double the 50-line ideal. Similarly, addActivationInteractionPermissionsMap is 62 lines with complex branching depth. Both exceed the recommended function length and hurt readability and testability.

The daily compiler quality report scores compiler_activation_job.go at 87/100, with function length and missing godoc as the primary drag on the score.

Suggested Changes

  • Extract distinct phases of generateCheckoutGitHubFolderForActivation into named helper functions (e.g., buildCheckoutPermissions, buildCheckoutEnvVars)
  • Simplify addActivationInteractionPermissionsMap by extracting branch conditions into named predicates
  • Each extracted function should be ≤ 50 lines
  • Add godoc comments to all extracted helpers

Files Affected

  • pkg/compiler/compiler_activation_job.go (functions at ~lines 50-350)

Success Criteria

  • generateCheckoutGitHubFolderForActivation ≤ 50 lines
  • addActivationInteractionPermissionsMap ≤ 50 lines
  • All extracted helpers have godoc comments
  • All existing tests pass
  • make golint-custom passes

Source

Extracted from [daily-compiler-quality] Daily Compiler Code Quality Report - 2026-07-25

Priority

Medium — Improves maintainability and testability; existing test coverage (2× ratio) provides safety net.

🔍 Task mining by Discussion Task Miner - Code Quality Improvement Agent · sonnet46 · 47 AIC · ⌖ 5.49 AIC · ⊞ 7.2K · ◷

  • expires on Jul 26, 2026, 11:12 AM UTC-08:00

Activity

  1. github-actions commented on Jul 26, 2026

    @github-actions
    ContributorAuthor

    This issue was automatically closed because it expired on 2026-07-26T19:12:29.234Z.

    Closed by Workflow

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