fix(ci): drop the runner's Microsoft apt repos before updating - #6041
Conversation
The ubuntu runner images preinstall the azure-cli and microsoft-prod apt repos. Wails uses neither, but a 403 from packages.microsoft.com still fails apt-get update and kills the step. Remove both list files first.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. WalkthroughThe CI workflows now use a shared script to remove unused Microsoft and Azure CLI APT source lists before ChangesCI APT cleanup
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This workflow-only change removes unrelated Microsoft apt sources before package updates on hosted Ubuntu runners. No actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Description checkExplanation The description explains the failure, motivation, affected workflows, implementation, testing scope, issue link, change type, and checklist status. The missing local unit-test and wails doctor details are reasonable for a workflow-only change. Full details: Linked Issues checkExplanation The changes satisfy issue Full details: Docstring CoverageExplanation No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files. (5 skipped: 5 unsupported.) ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Thanks for tracking this down — the 403 diagnosis is right and dropping the repos is the correct call for CI. One thing before it lands, though. The
Suggestion: gate the removal on actually being on a GitHub-hosted runner. #!/usr/bin/env bash
set -euo pipefail
if [ "${ACT:-}" = "true" ] || [ "${RUNNER_ENVIRONMENT:-}" != "github-hosted" ]; then
echo "Leaving apt sources untouched (ACT=${ACT:-unset}, RUNNER_ENVIRONMENT=${RUNNER_ENVIRONMENT:-unset})."
exit 0
fi
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list /etc/apt/sources.list.d/azure-cli.listThat fails closed on purpose: if Putting it in run: |
# Drop the runner image's unused Microsoft apt repos (no-op off GitHub-hosted runners).
./.github/scripts/prune-runner-apt-sources.sh
sudo apt-get update -qqEvery apt step already runs after I've pushed exactly that on top of your commit — All five workflows still parse, and the script was exercised against a stubbed Also worth merging Generated by Claude Code |
… runners The unconditional `sudo rm -f /etc/apt/sources.list.d/...` deletes real apt sources when the workflows are run outside GitHub's ephemeral VMs - locally with `act` (which can execute directly on the host via `-P <label>=-self-hosted`, and otherwise inside a container the developer keeps around), or on a self-hosted runner. Move the removal into .github/scripts/prune-runner-apt-sources.sh, which no-ops unless RUNNER_ENVIRONMENT is github-hosted and ACT is unset, and call it from the ten apt sites instead of repeating the command. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CM3tWu1Ti6A7R8bf2dST6F
|
Cherry-picked cd9a7ad and merged master in, thanks for the catch. |
…ner's Microsoft apt repos before updating
Description
This run failed because
apt-get updatehit a 403 from packages.microsoft.com:The runner image preinstalls both repos. Wails uses neither, so this deletes the two list files before
apt-get updateinstead of leaving CI dependent on an unrelated host. Applied to all 10apt-get updatesites across the 5 workflows.Fixes #6040
Type of change
How Has This Been Tested?
CI on this PR exercises the changed steps on every ubuntu leg.
rm -fis idempotent, so it is a no-op if the files are ever dropped from the image.Test Configuration
Not applicable, workflow-only change. Runners are
ubuntu-latest,ubuntu-24.04andubuntu-22.04.Checklist:
website/src/pages/changelog.mdxwith details of this PR (v3 changelog entries are added automatically)Summary by CodeRabbit
Bug Fixes
Chores