Skip to content

[Code Quality] Add unit tests for compiler_custom_jobs.go (923 lines, 0 tests) #46609

Description

@github-actions

Description

The file pkg/workflow/compiler_custom_jobs.go is 923 lines of custom job extraction logic with no dedicated test file. The compiler quality report (2026-07-19) rated it 67/100 and flagged the missing tests as the top issue.

Suggested Changes

Create pkg/workflow/compiler_custom_jobs_test.go with unit tests covering:

  • buildCustomJob — the primary entry point
  • configureCustomJobSteps — step configuration logic (60+ lines)
  • applyBuiltinJobNeedsAugmentations — job-needs augmentation logic (60+ lines)

Expected effort: 3–4 hours.

Files Affected

  • pkg/workflow/compiler_custom_jobs.go (existing, 923 lines)
  • pkg/workflow/compiler_custom_jobs_test.go (new)

Success Criteria

  • New test file exists with at least one test per listed function
  • All new tests pass via go test ./pkg/workflow/...
  • Test/source ratio for compiler_custom_jobs.go is > 0

Source

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

Priority

High — complex extraction logic without tests is a significant maintenance risk

🔍 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