Skip to content

Commit 08d3d9b

Browse files
committed
TO-DROP: run Copilot CLI as a --yolo debugger on linux32 failure
Wire the in-container Copilot CLI debugger to the trimmed `linux32` job per the `ci-failure-copilot` skill. On a failure of the `ci/run-build-and-tests.sh` step, install Node.js and the Copilot CLI, hand off to a `--yolo` session pointed at `.github/copilot-prompts/debug-linux32.md` (added in the previous commit), and upload the resulting `ci-diagnosis/` directory plus the captured `~/.copilot` session state as a `copilot-debug` artifact. Two preconditions for the prompt's branch-thicket-aware diagnosis flow: * The checkout step now uses `fetch-depth: 0` so the agent can `git log` between the old and new rebase baselines and run `git range-diff` against `microsoft/vfs-2.54.0`. * A new step adds the `microsoft` remote and pre-fetches `vfs-2.54.0` plus the `v2.54.0` tag so the agent does not pay the discovery latency in-session. The Copilot run executes as root (the container's default user), matching where `npm install -g` puts the binary; the prompt itself instructs the agent to re-invoke the failing command via `sudo --preserve-env --set-home --user=builder ci/run-build-and-tests.sh` so its end-to-end verification reproduces the workflow's exact conditions. The job requires a `COPILOT_GITHUB_TOKEN` repository secret on `dscho/git` with Copilot access for this repository; if it is not set, the `Run Copilot CLI` step will fail authentication but the preceding archive/upload steps still preserve whatever state was captured. This commit is to be dropped before the branch is merged anywhere. Assisted-by: Claude Opus 4.7 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent 4b6658b commit 08d3d9b

1 file changed

Lines changed: 50 additions & 0 deletions

File tree

‎.github/workflows/main.yml‎

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,60 @@ jobs:
145145
apt-get -q update && apt-get -q -y install git
146146
fi
147147
- uses: actions/checkout@v6
148+
with:
149+
# Full history so the Copilot debugger can `git log` between
150+
# the rebase baselines (microsoft/vfs-2.54.0's upstream base
151+
# vs this branch's upstream base) and run `git range-diff`.
152+
fetch-depth: 0
153+
- name: Fetch baseline refs for Copilot debugger
154+
run: |
155+
git remote add microsoft https://github.com/microsoft/git.git
156+
git fetch --tags --no-recurse-submodules microsoft v2.54.0 vfs-2.54.0
148157
- run: ci/install-dependencies.sh
149158
- run: useradd builder --create-home
150159
- run: chown -R builder .
151160
- run: chmod a+w $GITHUB_ENV && sudo --preserve-env --set-home --user=builder ci/run-build-and-tests.sh
161+
- name: Install Node.js (for Copilot CLI)
162+
if: failure()
163+
uses: actions/setup-node@v4
164+
with:
165+
node-version: '20'
166+
- name: Set up Copilot CLI
167+
if: failure()
168+
run: |
169+
npm install -g @github/copilot
170+
mkdir -p ci-diagnosis
171+
chown -R builder ci-diagnosis
172+
- name: Run Copilot CLI to debug failure
173+
if: failure()
174+
timeout-minutes: 75
175+
env:
176+
GH_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}
177+
# Use the `@file` syntax for the prompt rather than inlining the
178+
# whole prose on the command line; the prompt expands to several
179+
# KB and some shells truncate long argv. Run as root (the
180+
# container's default user) so the install path stays simple;
181+
# the prompt itself instructs the agent to re-invoke the failing
182+
# command via `sudo --preserve-env --set-home --user=builder
183+
# ci/run-build-and-tests.sh` so the verification reproduces the
184+
# workflow's exact conditions.
185+
run: |
186+
copilot -p "Follow the instructions in @.github/copilot-prompts/debug-linux32.md exactly." \
187+
--yolo </dev/null
188+
- name: Archive Copilot session state
189+
if: always()
190+
run: |
191+
if test -d "$HOME/.copilot"; then
192+
tar czf copilot-session.tar.gz -C "$HOME" .copilot
193+
fi
194+
- name: Upload Copilot artifacts
195+
if: always() && (hashFiles('copilot-session.tar.gz') != '' || hashFiles('ci-diagnosis/**') != '')
196+
uses: actions/upload-artifact@v7
197+
with:
198+
name: copilot-debug
199+
path: |
200+
copilot-session.tar.gz
201+
ci-diagnosis/
152202
- name: print test failures
153203
if: failure() && env.FAILED_TEST_ARTIFACTS != ''
154204
run: sudo --preserve-env --set-home --user=builder ci/print-test-failures.sh

0 commit comments

Comments
 (0)