[file-diet] Split activation job builder into focused compiler modules#44792
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR refactors the activation job builder in pkg/workflow by splitting the former monolithic compiler_activation_job_builder.go into smaller, concern-focused compiler modules while keeping the activation job assembly flow and outputs consistent.
Changes:
- Decomposed activation-job construction into focused modules (context init, permissions, steps, outputs, daily AIC).
- Removed the previous monolithic activation-job builder file.
- Added targeted unit tests covering extracted helper behavior (engine ID defaulting, daily AIC env rendering, env line generation, comment output defaults).
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/compiler_activation_context.go | Introduces activationJobBuildContext and activation context/setup/bootstrap helpers. |
| pkg/workflow/compiler_activation_permissions.go | Extracts activation permission calculation and app-token minting gates. |
| pkg/workflow/compiler_activation_daily_aic.go | Extracts daily AIC guardrail token/env/step builders. |
| pkg/workflow/compiler_activation_steps.go | Extracts activation job step builders (reaction, oauth token check, checkout/lock/version, status comment, skill install, etc.). |
| pkg/workflow/compiler_activation_outputs.go | Extracts activation outputs wiring, needs/if computation, artifact upload, and environment assembly. |
| pkg/workflow/compiler_activation_builder_split_test.go | Adds unit tests for newly extracted helpers. |
| pkg/workflow/compiler_activation_job_builder.go | Removed (replaced by the extracted modules). |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 7/7 changed files
- Comments generated: 1
- Review effort level: Low
| // Always include the engine-specific skill directory when either inline skills are enabled | ||
| // or frontmatter skills are configured. | ||
| if isFeatureEnabled(constants.FeatureFlag("inline-agents"), ctx.data) || len(ctx.data.Skills) > 0 { | ||
| skillDir := GetEngineSkillDir(engineID) | ||
| ctx.steps = append(ctx.steps, fmt.Sprintf(" /tmp/gh-aw/%s\n", skillDir)) | ||
| } |
PR Triage
Score breakdown: Impact 28 · Urgency 12 · Quality 18 Decomposes 1.1k-line activation job builder into focused modules. No API change. CI passing. Good test coverage added. Can be reviewed alongside similar compiler refactors.
|
🤖 PR Triage Report
Rationale: Decomposes a 1.1k-line activation job builder into focused modules. Large change (2368 lines net delta) but CI passing (43 checks ✅). Medium risk — no behavior change intended, but large refactor warrants careful review. Batch with other compiler changes.
|
|
@copilot please run the
|
…-empty Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Fixed in commit Updated the condition in |
|
@copilot please run the
|
All review feedback has already been addressed (the |
|
@copilot please run the
|
No remaining work — all review feedback was addressed in |
🤖 PR Triage
Score breakdown: Impact 25/50 · Urgency 10/30 · Quality 13/20 Rationale: Decomposes 1100+ line compiler file into focused modules (+1232/-1136 lines, 7 files). Large net-neutral refactor; CI passing. Batch with #44874 for a focused refactor review session.
|
|
🎉 This pull request is included in a new release. Release: |
pkg/workflow/compiler_activation_job_builder.gohad grown into a 1.1k+ line mixed-responsibility file, making activation-job logic hard to navigate and evolve. This change decomposes it into focused modules by concern while preserving existing activation job behavior and public API.Module decomposition (single-responsibility boundaries)
compiler_activation_context.go: activation build context initialization, setup/workflow_call bootstrap, engine output wiring.compiler_activation_permissions.go: permission map assembly, app-token gating, script-inferred permission handling.compiler_activation_daily_aic.go: daily AIC guardrail env/token resolution and guardrail step composition.compiler_activation_steps.go: activation step builders (reaction, text output, status comment, lock/version/checkout, safety checks).compiler_activation_outputs.go: activation outputs, feedback/validation orchestration, needs/if wiring, artifact upload, environment assembly.compiler_activation_job_builder.go.No API surface change
buildActivationJobcall flow remains unchanged; extracted methods/functions keep the same receiver/signatures where applicable.activationJobBuildContextremains the coordination object across extracted files.Targeted coverage added for extracted helpers
compiler_activation_builder_split_test.go.