CI: rewrite apt-mirrors.txt so the mirror switch actually applies - #4347
Merged
Conversation
The runner image configures apt with URIs: mirror+file:///etc/apt/apt-mirrors.txt in ubuntu.sources, so the azure.archive.ubuntu.com URL lives in that file, not in sources.list or the .list/.sources files. The sed pass in 1d46401 therefore matched nothing and apt kept using the azure mirror; jobs kept stalling. Add /etc/apt/apt-mirrors.txt to the rewrite list and fail the step if any azure.archive.ubuntu.com reference survives under /etc/apt, so a future runner image layout change cannot turn this script into a silent no-op again.
grandixximo
force-pushed
the
chore/ci-mirror-fix
branch
from
August 6, 2026 05:02
7cd9f9f to
fcfb06b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #4336. That switch was a silent no-op: the runner image configures apt with
URIs: mirror+file:///etc/apt/apt-mirrors.txtinubuntu.sources, so the azure mirror URL lives in/etc/apt/apt-mirrors.txt, not in any of the files the script rewrote. CI logs from runs after #4336 confirm apt still fetched fromazure.archive.ubuntu.com(look forGet:1 file:/etc/apt/apt-mirrors.txt Mirrorlistfollowed byGet:N http://azure.archive.ubuntu.com/...), and jobs kept stalling when the mirror degraded.Changes:
/etc/apt/apt-mirrors.txtto the rewrite list so the switch actually takes effect.azure.archive.ubuntu.comreference survives under/etc/apt. Without this, a future runner image layout change turns the script into a silent no-op again and the stalls come back with no indication why.Verified locally against a simulated runner layout: rewrites the mirror list, catches a surviving azure reference in an unlisted file (exit 1), and passes when no azure reference exists.