Skip to content

[Code Quality] Add unit tests for compiler_custom_jobs.go #46571

Description

@github-actions

Description

compiler_custom_jobs.go is a 923-line file with 31 functions containing complex custom job extraction logic but has no dedicated test file. This is the lowest-scoring dimension (10/20) for this file, which overall scored 67/100 in the daily compiler quality audit.

Suggested Changes

  • Create compiler_custom_jobs_test.go with unit tests
  • Prioritize coverage for the three most complex functions:
    • buildCustomJob
    • configureCustomJobSteps
    • applyBuiltinJobNeedsAugmentations
  • Target ≥80% test coverage for this file

Files Affected

  • pkg/workflow/compiler_custom_jobs.go (923 lines, 31 functions)
  • pkg/workflow/compiler_custom_jobs_test.go (new file)

Success Criteria

  • compiler_custom_jobs_test.go exists with meaningful test cases
  • All three priority functions have test coverage
  • make test passes with the new test file
  • Cyclomatic complexity hotspots (configureCustomJobSteps, applyBuiltinJobNeedsAugmentations) each have ≥3 test scenarios

Source

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

Priority

High — 923 lines of custom job logic with zero test coverage is a significant maintainability risk

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

  • expires on Jul 19, 2026, 11:45 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