From fb2933b68a79abb38f49931241e021bd059d8d3a Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 8 Nov 2026 17:07:19 +0000 Subject: [PATCH 1/2] release: wait for the released stack on PyPI before the wiki-currency checks The 2026.11.6.1 and 2026.11.7.1 releases shipped completely but ended red: autolens_assistant's wiki-currency check ran `pip install autolens==` about 3 minutes after the upload, before PyPI's simple index listed it ("No matching distribution found"). The autofit, autogalaxy and autocti checks run the same step and passed by timing luck. A re-run of the failed jobs of 42360648525 passed, which confirms it was index propagation, not drift. - New job wait_for_released_stack, after release_workspaces and skipped in rehearsal. It polls production PyPI (`pip download --no-deps --no-cache-dir`) for all six packages, bounded at 10 min per package, and fails loudly if a version never appears. There is no fallback to an older or unpinned install. - All four wiki_currency_check* jobs need it. - The wiki_drift_issue* jobs no longer fail on a missing report: the download step is continue-on-error. With no report they open a "wiki-currency check could not complete" issue linked to the run, not a "drift detected" one. Genuine drift reporting is unchanged. Verified locally: - The wait loop finds all six packages at 2026.11.7.1 in 13s, and fails with an ::error:: for a missing version. - The drift step with a stubbed gh: with no report it opens a "could not complete" issue; with a report it is unchanged. - tests/test_release_wiki_currency_wait.py: 4 tests, failing on the old workflow and passing on the new. - Full suite: 578 passed, 9 skipped. Closes #334 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016nhQ8McPUvDThp9s9JAiZz --- .github/workflows/release.yml | 96 ++++++++++++++++++++++-- tests/test_release_wiki_currency_wait.py | 77 +++++++++++++++++++ 2 files changed, 165 insertions(+), 8 deletions(-) create mode 100644 tests/test_release_wiki_currency_wait.py diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9928366..fca5423 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1143,6 +1143,50 @@ jobs: git push origin main fi + # --------------------------------------------------------------------------- + # Wait for the released stack to be installable from production PyPI. + # + # The wiki-currency checks below `pip install ==` from PyPI a + # few minutes after the upload. PyPI's simple index can lag that upload, and + # on 2026-11-06 and 2026-11-07 the autolens check ran before + # `autolens==` was listed ("No matching distribution found"), which + # turned two fully shipped releases red (PyAutoHands#334). This job polls the + # index for every package, bypassing pip's cache, with a bounded wait, and + # fails loudly if a version never appears. It never falls back to an older or + # unpinned install. + # --------------------------------------------------------------------------- + wait_for_released_stack: + needs: + - resolve_mode + - version_number + - release_workspaces + if: "${{ needs.resolve_mode.outputs.rehearsal != 'true' }}" + runs-on: ubuntu-latest + steps: + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + - name: Wait for every released package on PyPI + env: + VERSION: ${{ needs.version_number.outputs.version_number }} + run: | + PACKAGES=(autonerves autoarray autofit autogalaxy autolens autocti) + # 60 attempts x 10s = 10 min per package, far beyond the ~3 min lag seen. + for PACKAGE in "${PACKAGES[@]}"; do + cnt=0 + until python3 -m pip download --no-deps --no-cache-dir --dest /tmp/pyauto-stack \ + --index-url https://pypi.org/simple/ "$PACKAGE==$VERSION" >/dev/null 2>&1; do + cnt=$((cnt+1)) + if [ "$cnt" -ge 60 ]; then + echo "::error::$PACKAGE==$VERSION not installable from PyPI after 10 min" + exit 1 + fi + echo " waiting for $PACKAGE==$VERSION on PyPI (attempt $cnt)" + sleep 10 + done + echo "found $PACKAGE==$VERSION" + done + # --------------------------------------------------------------------------- # Wiki-currency check (autolens_assistant). # @@ -1159,6 +1203,7 @@ jobs: - resolve_mode - version_number - release_workspaces + - wait_for_released_stack if: "${{ needs.resolve_mode.outputs.rehearsal != 'true' }}" uses: PyAutoLabs/autolens_assistant/.github/workflows/wiki-currency.yml@main with: @@ -1176,6 +1221,8 @@ jobs: runs-on: ubuntu-latest steps: - name: Download drift report + id: drift_report + continue-on-error: true uses: actions/download-artifact@v4 with: name: wiki-drift-report @@ -1194,13 +1241,19 @@ jobs: GH_TOKEN: ${{ steps.app_token.outputs.token }} run: | VERSION="${{ needs.version_number.outputs.version_number }}" + RUN_URL="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" BODY=drift/drift-report.md + TITLE="wiki drift detected at release $VERSION" if [ ! -f "$BODY" ]; then - printf '# Wiki-currency drift at release %s\n\nThe check failed but no drift-report artifact was found; see the run logs.\n' "$VERSION" > "$BODY" + # No report means the check failed before grading anything (e.g. the + # released stack would not install), so this is not drift. + mkdir -p drift + printf '# Wiki-currency check could not complete at release %s\n\nThe check failed before producing a drift report, so no drift was graded. See the run: %s\n' "$VERSION" "$RUN_URL" > "$BODY" + TITLE="wiki-currency check could not complete at release $VERSION" fi gh issue create \ --repo PyAutoLabs/autolens_assistant \ - --title "wiki drift detected at release $VERSION" \ + --title "$TITLE" \ --body-file "$BODY" \ || echo "::warning::could not open wiki-drift issue (non-fatal)" @@ -1216,6 +1269,7 @@ jobs: - resolve_mode - version_number - release_workspaces + - wait_for_released_stack if: "${{ needs.resolve_mode.outputs.rehearsal != 'true' }}" uses: PyAutoLabs/autofit_assistant/.github/workflows/wiki-currency.yml@main with: @@ -1230,6 +1284,8 @@ jobs: runs-on: ubuntu-latest steps: - name: Download drift report + id: drift_report + continue-on-error: true uses: actions/download-artifact@v4 with: name: wiki-drift-report-autofit @@ -1248,13 +1304,19 @@ jobs: GH_TOKEN: ${{ steps.app_token.outputs.token }} run: | VERSION="${{ needs.version_number.outputs.version_number }}" + RUN_URL="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" BODY=drift/drift-report.md + TITLE="wiki drift detected at release $VERSION" if [ ! -f "$BODY" ]; then - printf '# Wiki-currency drift at release %s\n\nThe check failed but no drift-report artifact was found; see the run logs.\n' "$VERSION" > "$BODY" + # No report means the check failed before grading anything (e.g. the + # released stack would not install), so this is not drift. + mkdir -p drift + printf '# Wiki-currency check could not complete at release %s\n\nThe check failed before producing a drift report, so no drift was graded. See the run: %s\n' "$VERSION" "$RUN_URL" > "$BODY" + TITLE="wiki-currency check could not complete at release $VERSION" fi gh issue create \ --repo PyAutoLabs/autofit_assistant \ - --title "wiki drift detected at release $VERSION" \ + --title "$TITLE" \ --body-file "$BODY" \ || echo "::warning::could not open wiki-drift issue (non-fatal)" @@ -1272,6 +1334,7 @@ jobs: - resolve_mode - version_number - release_workspaces + - wait_for_released_stack if: "${{ needs.resolve_mode.outputs.rehearsal != 'true' }}" uses: PyAutoLabs/autogalaxy_assistant/.github/workflows/wiki-currency.yml@main with: @@ -1286,6 +1349,8 @@ jobs: runs-on: ubuntu-latest steps: - name: Download drift report + id: drift_report + continue-on-error: true uses: actions/download-artifact@v4 with: name: wiki-drift-report-autogalaxy @@ -1304,13 +1369,19 @@ jobs: GH_TOKEN: ${{ steps.app_token.outputs.token }} run: | VERSION="${{ needs.version_number.outputs.version_number }}" + RUN_URL="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" BODY=drift/drift-report.md + TITLE="wiki drift detected at release $VERSION" if [ ! -f "$BODY" ]; then - printf '# Wiki-currency drift at release %s\n\nThe check failed but no drift-report artifact was found; see the run logs.\n' "$VERSION" > "$BODY" + # No report means the check failed before grading anything (e.g. the + # released stack would not install), so this is not drift. + mkdir -p drift + printf '# Wiki-currency check could not complete at release %s\n\nThe check failed before producing a drift report, so no drift was graded. See the run: %s\n' "$VERSION" "$RUN_URL" > "$BODY" + TITLE="wiki-currency check could not complete at release $VERSION" fi gh issue create \ --repo PyAutoLabs/autogalaxy_assistant \ - --title "wiki drift detected at release $VERSION" \ + --title "$TITLE" \ --body-file "$BODY" \ || echo "::warning::could not open wiki-drift issue (non-fatal)" @@ -1331,6 +1402,7 @@ jobs: - resolve_mode - version_number - release_workspaces + - wait_for_released_stack if: "${{ needs.resolve_mode.outputs.rehearsal != 'true' }}" uses: PyAutoLabs/autocti_assistant/.github/workflows/wiki-currency.yml@main with: @@ -1345,6 +1417,8 @@ jobs: runs-on: ubuntu-latest steps: - name: Download drift report + id: drift_report + continue-on-error: true uses: actions/download-artifact@v4 with: name: wiki-drift-report # autocti_assistant uploads it unsuffixed (wiki-currency.yml) @@ -1363,13 +1437,19 @@ jobs: GH_TOKEN: ${{ steps.app_token.outputs.token }} run: | VERSION="${{ needs.version_number.outputs.version_number }}" + RUN_URL="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" BODY=drift/drift-report.md + TITLE="wiki drift detected at release $VERSION" if [ ! -f "$BODY" ]; then - printf '# Wiki-currency drift at release %s\n\nThe check failed but no drift-report artifact was found; see the run logs.\n' "$VERSION" > "$BODY" + # No report means the check failed before grading anything (e.g. the + # released stack would not install), so this is not drift. + mkdir -p drift + printf '# Wiki-currency check could not complete at release %s\n\nThe check failed before producing a drift report, so no drift was graded. See the run: %s\n' "$VERSION" "$RUN_URL" > "$BODY" + TITLE="wiki-currency check could not complete at release $VERSION" fi gh issue create \ --repo PyAutoLabs/autocti_assistant \ - --title "wiki drift detected at release $VERSION" \ + --title "$TITLE" \ --body-file "$BODY" \ || echo "::warning::could not open wiki-drift issue (non-fatal)" diff --git a/tests/test_release_wiki_currency_wait.py b/tests/test_release_wiki_currency_wait.py new file mode 100644 index 0000000..f10b2b0 --- /dev/null +++ b/tests/test_release_wiki_currency_wait.py @@ -0,0 +1,77 @@ +"""Guard the release wiki-currency checks against PyPI index propagation (#334). + +The 2026.11.6.1 and 2026.11.7.1 releases shipped completely but ended red: +autolens_assistant's wiki-currency check ran `pip install autolens==` +about 3 minutes after the upload, before PyPI's simple index listed it. The drift +issue job then failed downloading a report that was never written, and its +fallback would have titled an install failure as "drift". + +These tests hold the repaired shape: every wiki check waits for the released +stack on production PyPI, the wait is bounded and cache-free, and a drift job with +no report says the check could not complete instead of claiming drift. +""" + +from pathlib import Path + +import yaml + +RELEASE_WORKFLOW = ( + Path(__file__).resolve().parents[1] / ".github" / "workflows" / "release.yml" +) + +PACKAGES = ("autonerves", "autoarray", "autofit", "autogalaxy", "autolens", "autocti") + + +def jobs(): + return yaml.safe_load(RELEASE_WORKFLOW.read_text())["jobs"] + + +def wiki_checks(all_jobs): + return {n: j for n, j in all_jobs.items() if n.startswith("wiki_currency_check")} + + +def drift_jobs(all_jobs): + return {n: j for n, j in all_jobs.items() if n.startswith("wiki_drift_issue")} + + +def test_every_wiki_check_waits_for_the_released_stack(): + all_jobs = jobs() + checks = wiki_checks(all_jobs) + assert len(checks) == 4 + for name, job in checks.items(): + assert "wait_for_released_stack" in job["needs"], name + + +def test_the_wait_runs_after_publish_and_is_skipped_in_rehearsal(): + job = jobs()["wait_for_released_stack"] + assert "release_workspaces" in job["needs"] + assert "rehearsal != 'true'" in job["if"] + + +def test_the_wait_polls_production_pypi_for_every_package_without_cache_and_is_bounded(): + (step,) = [ + s for s in jobs()["wait_for_released_stack"]["steps"] + if s.get("name", "").startswith("Wait") + ] + run = step["run"] + assert "--index-url https://pypi.org/simple/" in run + assert "--no-cache-dir" in run + assert "--no-deps" in run + for package in PACKAGES: + assert package in run, package + # bounded: the loop gives up and fails the job + assert "-ge 60" in run + assert "exit 1" in run + + +def test_drift_jobs_tolerate_a_missing_report_and_never_call_it_drift(): + all_jobs = drift_jobs(jobs()) + assert len(all_jobs) == 4 + for name, job in all_jobs.items(): + (download,) = [s for s in job["steps"] if s.get("name") == "Download drift report"] + assert download.get("continue-on-error") is True, name + (open_step,) = [s for s in job["steps"] if s.get("name", "").startswith("Open")] + run = open_step["run"] + assert 'if [ ! -f "$BODY" ]' in run, name + assert "could not complete" in run, name + assert '--title "$TITLE"' in run, name From 43c4221289e24d86a0bd4471cab4fa0b9f878754 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 8 Nov 2026 18:14:48 +0000 Subject: [PATCH 2/2] tests: keep assistant repo names out of the wiki-wait test docstring (tenant firewall) Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016nhQ8McPUvDThp9s9JAiZz --- tests/test_release_wiki_currency_wait.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_release_wiki_currency_wait.py b/tests/test_release_wiki_currency_wait.py index f10b2b0..a9fb416 100644 --- a/tests/test_release_wiki_currency_wait.py +++ b/tests/test_release_wiki_currency_wait.py @@ -1,7 +1,7 @@ """Guard the release wiki-currency checks against PyPI index propagation (#334). The 2026.11.6.1 and 2026.11.7.1 releases shipped completely but ended red: -autolens_assistant's wiki-currency check ran `pip install autolens==` +one assistant's wiki-currency check ran `pip install autolens==` about 3 minutes after the upload, before PyPI's simple index listed it. The drift issue job then failed downloading a report that was never written, and its fallback would have titled an install failure as "drift".