Skip to content

Refactor custom job compiler into focused modules - #53394

Merged
pelikhan merged 5 commits into
mainfrom
copilot/file-diet-refactor-compiler-custom-jobs
Aug 17, 2026
Merged

Refactor custom job compiler into focused modules#53394
pelikhan merged 5 commits into
mainfrom
copilot/file-diet-refactor-compiler-custom-jobs

Conversation

Copilot AI commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

compiler_custom_jobs.go had grown beyond 1,100 lines across custom-job construction, property parsing, execution setup, built-in augmentation, and step manipulation. This refactor separates those concerns while preserving existing compiler APIs and behavior.

  • Orchestration

    • Retains custom-job construction and dependency wiring in compiler_custom_jobs.go.
  • Custom job configuration

    • Extracts job property parsing into compiler_custom_job_properties.go.
    • Extracts reusable-workflow and step execution setup into compiler_custom_job_execution.go.
  • Built-in job handling

    • Moves needs, conditions, permissions, and pre-step augmentation into compiler_builtin_job_augmentation.go.
  • Shared step operations

    • Moves step validation, insertion, pinning, and checkout credential handling into compiler_job_step_helpers.go.
  • Coverage

    • Adds focused coverage for string, object, absent, and unsupported custom-job environment values.
// Custom-job construction remains the entry point.
job, err := c.buildCustomJob(...)

// Focused modules own specialized behavior.
err = c.extractCustomJobProperties(job, jobName, configMap)
err = c.configureCustomJobExecution(job, jobName, configMap, data)

Copilot AI and others added 3 commits August 17, 2026 13:31
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Refactor pkg/workflow/compiler_custom_jobs.go into smaller files Refactor custom job compiler into focused modules Aug 17, 2026
Copilot AI requested a review from pelikhan August 17, 2026 13:47
@pelikhan
pelikhan marked this pull request as ready for review August 17, 2026 14:32
Copilot AI balanced review requested due to automatic review settings August 17, 2026 14:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Note

This error may be related to your runner configuration. You can now configure runners for Copilot code review separately from Copilot cloud agent by creating a copilot-code-review.yml file with your setup steps. Read the docs for details.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot please take another pass on this PR.

Please address these items, newest first:

  • Failed checks: Unit tests (D-L).
  • Refresh the branch with the latest base changes if needed.
  • Run the pr-finisher skill and summarize the remaining maintainer-visible status.

Run: https://github.com/github/gh-aw/actions/runs/32043948991

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 10.3 AIC · ⌖ 6.79 AIC · ⊞ 8.8K ·
Comment /souschef to run again

…actor-compiler-custom-jobs

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>

Copilot AI commented Aug 17, 2026

Copy link
Copy Markdown
Contributor Author

@copilot please take another pass on this PR.

Please address these items, newest first:...

Merged latest main into the branch (09a03e2), which fixes the failing Unit tests (D-L) job.

  • The failure was TestDailyRegressionAuditAllowsPythonJSONParsing in pkg/cli — unrelated to this refactor. It asserted the daily-regression-audit workflow contained - python3, but Harden daily regression audit against tool-denial loops and prevent premature denial-issue closure #53370 on main switched that workflow to jq. main already relaxed the test to accept either, so merging base resolves it.
  • Local validation after the merge: go build ./..., TEST_UNIT_RUN_FULL=1 make test-unit (full suite), and make agent-report-progress (fmt, lint, recompile/lock sync) all pass.

pr-finisher status:

  • ✅ Reviews — no unresolved review threads on this PR.
  • ✅ Checks (local) — full unit suite, lint, format, and workflow recompile are green.
  • ❓ Checks (CI) — stale after the agent push; agent pushes don't trigger workflows. Prior failure is fixed and reproduced locally as passing. A maintainer needs to re-trigger CI.
  • ✅ Mergeable — branch is up to date with main, no conflicts, PR is open and not draft.

Still needed: human review approval and a CI re-trigger before merge.

Copilot AI requested a review from gh-aw-bot August 17, 2026 16:27
@pelikhan
pelikhan merged commit f9602fa into main Aug 17, 2026
27 checks passed
@pelikhan
pelikhan deleted the copilot/file-diet-refactor-compiler-custom-jobs branch August 17, 2026 18:09
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.87.1

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[file-diet] File Diet: pkg/workflow/compiler_custom_jobs.go (1142 lines) needs refactoring

4 participants