Skip to content

Make Copilot CLI staging idempotent for ARC/DinD - #11946

Merged
lpcox merged 2 commits into
mainfrom
copilot/awf-arc-dind-fix-copy-step
Nov 22, 2026
Merged

lpcox merged 2 commits into
mainfrom
copilot/awf-arc-dind-fix-copy-step

Conversation

@lpcox

@lpcox lpcox commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

Rootless Copilot installs may already place the binary at ${RUNNER_TEMP}/gh-aw/bin/copilot. Staging then copies the file onto itself and stops the workflow before agent startup.

  • File identity: Use -ef in AWF’s staging replacement for agent and threat-detection jobs, covering identical paths, hard links, and symlinks. Preserve executable checks and unconditional chmod.
  • Compatibility: Upgrade previously engine-gated steps without nesting guards on repeated postprocessing.
  • Regression coverage: Cover file-identity cases, distinct destinations, missing executables, and both jobs.
if [[ ! "$COPILOT_SRC" -ef "${RUNNER_TEMP}/gh-aw/bin/copilot" ]]; then
  cp "$COPILOT_SRC" "${RUNNER_TEMP}/gh-aw/bin/copilot"
fi
chmod +x "${RUNNER_TEMP}/gh-aw/bin/copilot"

Scope is AWF postprocessing; the upstream gh-aw compiler is unchanged.

@lpcox lpcox changed the title [WIP] Fix staging step failure due to copy on same file Make Copilot CLI staging idempotent for ARC/DinD Nov 22, 2026
@lpcox
lpcox marked this pull request as ready for review November 22, 2026 16:52
Copilot AI adaptive review requested due to automatic review settings November 22, 2026 16:52

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.

🟢 Approval recommended

No active review issues are recorded for the change making Copilot CLI staging idempotent on ARC/DinD runners.

No open issues 🎉

What changed in this PR

Makes AWF’s Copilot CLI staging idempotent for ARC/DinD runners, addressing #11934 without changing the upstream compiler.

Changes:

  • Guards copies with Bash file-identity checks while preserving executable validation and unconditional chmod.
  • Upgrades previously engine-gated steps without nesting guards on repeated postprocessing.
  • Adds regression coverage for file identities, distinct destinations, missing executables, and both agent and threat-detection jobs.
File Description
scripts/​ci/​workflow-step-builders.ts Skips copying when source and destination identify the same file.
scripts/​ci/​workflow-patches/​engine-lifecycle.ts Adds the identity guard to previously engine-gated steps.
scripts/​ci/​postprocess-smoke-workflows.test.ts Tests staging behavior across file-identity and executable-error cases.
scripts/​ci/​apply-general-workflow-patches.test.ts Tests both jobs, legacy-step upgrades, and repeated postprocessing.

Review effort: Balanced (adaptive)

@github-actions

Copy link
Copy Markdown
Contributor

✅ Copilot review passed with no inline comments.

@lpcox Add the ready-for-aw label to this PR to trigger agentic CI smoke tests.

@lpcox
lpcox merged commit fcd0da1 into main Nov 22, 2026
36 of 39 checks passed
@lpcox
lpcox deleted the copilot/awf-arc-dind-fix-copy-step branch November 22, 2026 17:51
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.

[awf] arc-dind: Copilot CLI staging step fails when source and destination are the same file

3 participants