Skip to content

[plan] Fix needs: duplication/self-cycle when built-in job names are used in jobs frontmatter #27747

@github-actions

Description

@github-actions

Context

Reported in #27670. When a built-in job name (activation, agent, safe_outputs, conclusion) appears as a key under jobs: in frontmatter (for pre-steps customization per ADR-27138), the dependency-addition loop in compiler_main_job.go incorrectly adds the built-in job to another job's needs: list — causing duplicates or self-cycles that GitHub Actions rejects.

Specific bugs:

  • jobs.activation.pre-stepsactivation gets added twice to agent.needs
  • jobs.agent.pre-stepsagent added to agent.needs (self-cycle)
  • jobs.safe_outputs.pre-stepssafe_outputs added to agent.needs, but safe_outputs already needs agent (cycle)
  • jobs.conclusion.pre-steps → similar cycle

Root Cause

In pkg/workflow/compiler_main_job.go, the loop that builds dependency lists only skips pre_activation / pre-activation, but data.Jobs now also contains entries for other built-in job names used as customization targets. The skip-list was never extended to cover activation, agent, safe_outputs, conclusion.

Objective

Extend the skip logic to exclude all built-in job names from being treated as custom dependencies when iterating data.Jobs.

Approach

  1. Add or update an isBuiltInJobName(jobName string) bool helper function (or similar) in pkg/workflow/compiler_main_job.go (or pkg/constants) that covers at minimum:
    • pre_activation, pre-activation
    • activation
    • agent
    • safe_outputs, safe-outputs
    • conclusion
  2. Replace the existing pre_activation-only skip check with isBuiltInJobName(jobName) in the dependency-addition loop.

Files to Modify

  • pkg/workflow/compiler_main_job.go — extend skip-list / add isBuiltInJobName helper
  • pkg/constants/ — consider adding built-in job name constants if not already present
  • pkg/workflow/compiler_main_job_test.go — add regression tests for each built-in job name

Acceptance Criteria

Generated by Plan Command for issue #27670 · ● 242.8K ·

  • expires on Apr 24, 2026, 2:47 AM UTC

Metadata

Metadata

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions