Skip to content

[Code Quality] Refactor buildJobs() in compiler_jobs.go: split 82-line function #46611

Description

@github-actions

Description

The function buildJobs() in pkg/workflow/compiler_jobs.go is 82 lines, exceeding comfortable single-responsibility boundaries. The compiler quality report (2026-07-19) also flagged buildPreActivationAndActivationJobs() as returning a 3-value tuple that would benefit from a result struct.

Suggested Changes

  • Split buildJobs() (82 lines) into setup and dispatch helper functions
  • Introduce a small result struct for buildPreActivationAndActivationJobs() to replace the 3-value return tuple

Files Affected

  • pkg/workflow/compiler_jobs.go
  • pkg/workflow/compiler_jobs_test.go (update tests as needed)

Success Criteria

  • buildJobs() is split into 2+ functions each ≤ 50 lines
  • buildPreActivationAndActivationJobs() returns a result struct instead of a 3-value tuple
  • All existing tests in compiler_jobs_test.go continue to pass
  • make golint-custom is clean for the changed files

Source

Extracted from Daily Compiler Code Quality Report - 2026-07-19

Priority

Medium — improves readability and reduces function-length lint findings

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

  • expires on Jul 20, 2026, 5:13 AM UTC-08:00

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