Conversation
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/72b11115-9a2c-49ed-9a15-eb3c13a772b6 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/72b11115-9a2c-49ed-9a15-eb3c13a772b6 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Refactors activation job construction to satisfy Architecture Guardian file/function size limits by splitting buildActivationJob into a thin orchestrator and moving most logic into a dedicated builder module, while aiming to preserve existing activation job behavior and outputs.
Changes:
- Introduced
activationJobBuildContextand extracted activation job assembly into phased helper methods. - Reduced
buildActivationJobto orchestration that delegates step/output/needs/permissions/environment construction. - Added a new builder file to host the extracted logic and keep
compiler_activation_job.gosmaller.
Show a summary per file
| File | Description |
|---|---|
pkg/workflow/compiler_activation_job_builder.go |
New activation job builder module with context + phased step/output/needs/permissions/environment construction. |
pkg/workflow/compiler_activation_job.go |
Simplified buildActivationJob to coordinate builder phases and assemble the final Job. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 1
| if hasWorkflowCallTrigger(data.On) { | ||
| compilerActivationJobLog.Print("Adding cross-repo setup guidance step for workflow_call trigger") | ||
| ctx.steps = append(ctx.steps, " - name: Print cross-repo setup guidance\n") | ||
| ctx.steps = append(ctx.steps, " if: failure() && steps.resolve-host-repo.outputs.target_repo != github.repository\n") | ||
| ctx.steps = append(ctx.steps, " run: |\n") |
There was a problem hiding this comment.
The cross-repo setup guidance step is added whenever hasWorkflowCallTrigger(data.On) is true, but its if: expression references steps.resolve-host-repo.outputs.target_repo. When data.InlinedImports is true, the resolve-host-repo step is not emitted (see newActivationJobBuildContext), so this compiled workflow will reference a non-existent step id and can fail actionlint/validation. Gate this guidance step on the same condition used to emit resolve-host-repo (hasWorkflowCallTrigger && !data.InlinedImports), or change the condition to use an always-available context (e.g., job.workflow_repository vs github.repository) so it doesn't depend on that step.
…tern Generated by Design Decision Gate workflow — PR author should review and finalize before merging. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Commit pushed:
|
🏗️ Design Decision Gate — ADR RequiredThis PR makes significant changes to core business logic (496 new lines in AI has analyzed the PR diff and generated a draft ADR to help you get started: 📄 Draft ADR: The draft captures the key decision — introducing What to do next
Once an ADR is linked in the PR body, this gate will re-run and verify the implementation matches the decision. Why ADRs Matter
ADRs create a searchable, permanent record of why the codebase looks the way it does. Future contributors (and your future self) will thank you. 📋 Michael Nygard ADR Format ReferenceAn ADR must contain these four sections to be considered complete:
All ADRs are stored in
References: §24573630987
|
|
@copilot review all comments |
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/d3373890-8415-49c3-bd79-65507b589217 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Reviewed and addressed the actionable review feedback in |
Architecture Guardian flagged
pkg/workflow/compiler_activation_job.gofor both file-size (>1000 lines) and function-size (buildActivationJob, 624 lines) violations. This PR decomposes activation job construction into focused builder phases while preserving existing behavior and outputs.Activation job orchestration split
buildActivationJobinpkg/workflow/compiler_activation_job.goto a thin coordinator.pkg/workflow/compiler_activation_job_builder.go.Builder phases extracted
activationJobBuildContextto carry mutable construction state across phases.newActivationJobBuildContextaddActivationFeedbackAndValidationStepsaddActivationRepositoryAndOutputStepsaddActivationCommandAndLabelOutputsconfigureActivationNeedsAndConditionaddActivationArtifactUploadStepbuildActivationPermissionsbuildActivationEnvironmentBehavior-preserving cleanup
failed to create activation job build context: %w).Resulting structure
compiler_activation_job.go: 1084 → 497 linescompiler_activation_job_builder.go: 473 linesbuildActivationJob: 624 → ~40 lines