Skip to content

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

Closed

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-steps → activation gets added twice to agent.needs
  • jobs.agent.pre-steps → agent added to agent.needs (self-cycle)
  • jobs.safe_outputs.pre-steps → safe_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

Activity

  1. added
    cookie
    on Apr 22, 2026
  2. github-actions commented on Apr 22, 2026

    @github-actions
    ContributorAuthor

    🍪 *Issue Monster selected this for Copilotecho BEGIN___COMMAND_OUTPUT_MARKER ; PS1= ; PS2= ; unset HISTFILE ; EC=0 ; echo ___BEGIN___COMMAND_DONE_MARKER___0 ; }

    I've identified this issue as a good candidate for automated resolution and requested assignment to the Copilot coding agent.

    If assignment succeeds, the Copilot coding agent will analyze the issue and create a pull request with the fix.

    Om nom nom! 🍪

    Caution

    Security scanning requires review for Issue Monster

    Details

    Potential security threats were detected in the agent output. The workflow output should be reviewed before merging.

    Review the workflow run logs for details.

    🍪 Om nom nom by Issue Monster · ● 25.2K · ◷

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

Metadata

Metadata

Labels

ai-generatedcookieplan

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions