Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions tst/unit/test_infra_build_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 8 additions & 0 deletions tst/unit/test_release_infra_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading