From f427aaa4b4cde08ab75be0c3cff5a7d8333751b1 Mon Sep 17 00:00:00 2001 From: Edgar Arakelyan Date: Mon, 16 Nov 2026 10:01:20 -0800 Subject: [PATCH] fix(release): chromium's compose is tried again, in fresh stores, while PyPI doesn't list the protocol it just published v0.9.1543's arm64 compose resolved agentenv-framework-protocol==0.1.558 39 s after the protocol job published it, before PyPI's index listed it, so the release shipped without composed chromium. The compose now runs under infra_build.py retry, as the image builds do, each try from fresh stores. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/publish-pypi.yml | 9 ++++++--- tst/unit/test_infra_build_script.py | 12 ++++++++++++ tst/unit/test_release_infra_images.py | 8 ++++++++ 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index 03105df22..ef4f1be58 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -413,13 +413,16 @@ jobs: docker run --detach --name registry --publish 5000:5000 \ --volume "$RUNNER_TEMP/computers/registry:/var/lib/registry" mirror.gcr.io/library/registry:2 timeout 30 sh -c 'until curl -sf http://localhost:5000/v2/ >/dev/null; do sleep 1; done' - # The runner context is a step's, not a job's. + # The runner context is a step's, not a job's. Its resolve can ask PyPI for the protocol moments after the + # protocol job published it, before PyPI's index lists it, so it's tried again, each time in fresh stores. - name: Compose and probe env: XDG_STATE_HOME: ${{ runner.temp }}/state run: | - "$RUNNER_TEMP/venv/bin/python" .github/scripts/release_computers.py compose "$ARCH" \ - "$RUNNER_TEMP/computers/composed" + # shellcheck disable=SC2016 # each try's sh expands them + python3 .github/scripts/infra_build.py retry sh -c 'rm -rf "$XDG_STATE_HOME" && + "$RUNNER_TEMP/venv/bin/python" .github/scripts/release_computers.py compose "$ARCH" \ + "$RUNNER_TEMP/computers/composed"' - name: Stop the local registry run: docker stop registry - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 diff --git a/tst/unit/test_infra_build_script.py b/tst/unit/test_infra_build_script.py index 7b4081ca9..f012bcfb8 100644 --- a/tst/unit/test_infra_build_script.py +++ b/tst/unit/test_infra_build_script.py @@ -613,6 +613,18 @@ def test_retry_tries_again_while_pypi_doesnt_list_the_protocol_a_build_installs( in capsys.readouterr().out) +def test_retry_tries_again_while_pypi_doesnt_list_the_protocol_a_computers_compose_resolves(script, monkeypatch): + """release_computers.py's compose of chromium resolves the protocol its release just published, as v0.9.1543's + did.""" + missing = ("container/arm64: failed at resolve: resolving the packages failed: ERROR: No matching distribution " + "found for agentenv-framework-protocol==0.1.558 (39 s)\n") + runs, waits = _attempts(script, monkeypatch, [(missing, 1), ("composed chromium for linux/arm64\n", 0)]) + + assert _run(script, monkeypatch, "retry", "sh", "-c", "compose") == 0 + + assert len(runs) == 2 and waits == [script._RETRY_WAITS_SECONDS[0]] + + def test_retry_tries_again_while_pypi_doesnt_list_the_protocol_floor_a_build_names(script, monkeypatch, capsys): """The Playwright MCP browser's recorder names a protocol floor, which its release may be the first to publish.""" missing = "ERROR: No matching distribution found for agentenv-framework-protocol[computer]>=0.1.382\n" diff --git a/tst/unit/test_release_infra_images.py b/tst/unit/test_release_infra_images.py index b8c092359..9bb81a882 100644 --- a/tst/unit/test_release_infra_images.py +++ b/tst/unit/test_release_infra_images.py @@ -237,6 +237,14 @@ def test_what_a_registry_can_rate_limit_is_tried_again(): assert JOBS["infra-build"]["strategy"]["max-parallel"] <= 4 +def test_the_computers_compose_is_tried_again_in_fresh_stores_while_pypi_doesnt_list_the_protocol(): + """Its resolve asks PyPI for the protocol the release published moments earlier, as v0.9.1543's did, too soon.""" + (compose,) = [run for run in _runs("computer-build") if "release_computers.py compose" in run] + tried = "python3 .github/scripts/infra_build.py retry sh -c 'rm -rf \"$XDG_STATE_HOME\" &&" + + assert tried in compose and compose.index(tried) < compose.index("release_computers.py compose") + + def test_every_infra_image_pins_its_bases_by_digest_and_dependabot_bumps_them(): """A release rebuilds an image only when its sources change, so a base behind a bare tag never picks up its fixes; pinned, the pin is a source, and Dependabot bumping it is what rebuilds and republishes the image. A base a