Repository navigation
Conversation
Tests that fail before the change: a workflow checks each country's newest model release against the Microcosm builds the bundle pins on Tuesdays and Fridays and by hand, opens a draft certification pull request per run on a branch named after the country and model version, uploads a result file per country and opens or updates one failure issue per country. The UK-only certify-uk-release.yaml is gone, and the runner-variable tests cover the new workflow's jobs instead of the old one's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add .github/workflows/check-model-compatibility.yaml. On Tuesdays and Fridays at 06:17 UTC, and by hand for a named version, it picks each country's newest policyengine-us or policyengine-uk release, leaves out a country whose version the bundle already pins or already has a pull request, and runs scripts/bundle.py certify-build on the pinned national and local-area Microcosm builds with that version. A pass pushes a new branch certify/<country>/<model package>-<version> and opens a draft pull request as the GitHub App; earlier pull requests stay open. Every run uploads a compatibility-<country> result file, and a failure opens or comments on one issue per country, which the next pass closes. scripts/compatibility_workflow.py holds the plan, the result file and the issue handling, reading only the bundle manifest, PyPI and GitHub. Remove certify-uk-release.yaml, which read only policyengine-uk-data releases and so never promoted a Microcosm build, together with its runbook and the tests that read its YAML. The UK qualification script, modules, ledger script and data files stay for now; their docstrings no longer say the workflow runs them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tests that fail before the change: the certification branch also names the national build (certify/<country>/<national build>/<package>-<version>), as certify-build names its own branches, so a newly pinned build is checked again for a version already checked against an older one. certify-build runs with --in-place, --output-dir and --pr-body-footer, and the pull request step commits only the files certify-build lists, with its pull request body and its title. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The check job now runs scripts/bundle.py certify-build with --in-place, --output-dir and --pr-body-footer, then commits only the files certify-build lists as changed and opens the draft pull request with its body and its title. The certification branch names the national build as certify-build's own branches do: certify/<country>/<national build>/<package>-<version>. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
These tests fail until the workflow and its script change: - A GitHub-hosted runner frees disk space before installing, because the US check needs about 16 GB free and the runner starts with about 14 GB. - The checkout comes first and keeps no token; the App token is made after certification, just before the push, because App tokens last an hour. - The pull request step's script, run with stand-in git and gh commands, sets up gh as git's credential helper before pushing, and runs under bash 3.2 as well. - A cancelled run is recorded as cancelled and leaves the issue alone. - The plan leaves out a version whose branch is already on GitHub without a pull request. Also tests the gh and git commands the plan uses, and removes two fake pull request listings that no test uses since the UK workflow's tests went. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From review round 1: - The check job checks out first, without keeping a token, and makes the GitHub App token after certification, just before the push. App tokens last an hour and the US check can take several. gh sets itself up as git's credential helper for the push. - A GitHub-hosted runner deletes tool directories this job does not use before installing, so the US builds and certify-build's 5 GB margin fit. - A cancelled job is recorded as cancelled, with the job's status passed to the result steps, and leaves the failure issue alone. - The plan leaves out a version whose branch is already on GitHub without a pull request, since pushing it again would fail. - The pull request step upper-cases the country with tr, which bash 3.2 also runs, and the result steps use the runner's python3. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From review round 2: GitHub cancels a job that reaches its own time limit, so a check that ran too long would be recorded as cancelled and leave the failure issue alone. The test fails until the certification step has a time limit at least 20 minutes below the job's. Also runs the pull request step's script with `bash -e`, as GitHub runs a step that names no shell, and drops a monkeypatch option that was needed only before remote_branch_exists existed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From review round 2: the certification step now stops after 270 minutes, 30 before the job's limit. A check that runs too long is then recorded as a failed certification and opens or updates the failure issue, instead of being cancelled with the job. Also corrects two comments: which pull requests make the plan leave a version out, and what else certify-build writes to its output directory. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From review round 3. These tests fail until: - the workflow's concurrency group queues waiting runs (queue: max) instead of letting a newly queued run cancel the one already waiting; - an error while planning one country (PyPI, gh, git or its manifest entry) leaves the other country in the matrix, names the failed country in an `unplanned` output, and a later step fails the plan job; - the check job runs for the planned countries even when the plan job failed for another. Also checks that the plan step passes --model-version. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e other From review round 3: - The concurrency group sets queue: max, so a newly queued run waits behind the one already waiting instead of cancelling it. Two manual runs, one per country, no longer drop the first. - The plan plans each country separately. A country whose lookup fails (PyPI, gh, git or its manifest entry) is listed in the run summary with its error and named in a new `unplanned` output; the other country stays in the matrix. A step after the outputs then fails the plan job, and the check job runs for the planned countries unless the run was cancelled. actionlint 1.7.12 does not yet know the documented queue key (rhysd/actionlint#657); .py's CI does not run actionlint. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The pull request conflicted with main. main's #761 turned off certify-uk-release.yaml's schedule and dispatch triggers and edited its runbook and YAML tests; this branch removes all three, so the resolution keeps them removed, including the test #761 added for the turned-off triggers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Fixes #787
Do not merge: (author's step) once tracker task 7c · 2 (
scripts/bundle.py certify-build --in-place) has a pull request, merge its branch into this one and add a test thatcertify-build's parser accepts every option this workflow passes.What this changes
On Tuesdays and Fridays at 06:17 UTC, and by hand, a new workflow,
.github/workflows/check-model-compatibility.yaml, checks each country's newest model release against the Microcosm builds the bundle manifest pins. It replacescertify-uk-release.yaml, which checked policyengine-uk wheels only against policyengine-uk-data releases, and which #761 already limited to manual runs.Plan job (
ubuntu-latest, reads only).scripts/compatibility_workflow.py planreadssrc/policyengine/data/bundle/manifest.jsonand PyPI. For each country it takes the newestpolicyengine-usorpolicyengine-ukrelease, or the version typed into a manual run (country: both, us or uk;model_version: needs one country). It reads the pinned national and local-area builds from the manifest'srelease_manifest_uriandregional_release_manifest_uri, and names the branchcertify/<country>/<national build>/<model package>-<version>. It leaves a country out when:It writes the countries left as the check job's matrix and a summary table to the run page. Each country is planned separately: if PyPI,
gh,gitor a country's manifest entry fails, that country is listed with its error and the other is still checked; a later step then fails the plan job, so the run shows as failed. Runs share one concurrency group withqueue: max, so a run queued behind a waiting run waits too instead of cancelling it.Check job (one per country left, run unless the run was cancelled, on the
CERTIFY_RUNNER_X64runner expression, soubuntu-latestwhile that variable is unset):mainwithout keeping a token.certify-buildwants 5 GB more free; the runner starts with about 14 GB.scripts/bundle.py certify-build --in-placewith the planned model version and the pinned builds, for at most 270 minutes (the job's limit is 300, and GitHub cancels a job at its limit rather than failing it). OnlyHUGGING_FACE_TOKENis passed to this step. It runs the compatibility check, and on a pass writes the compatibility record, the changelog fragment and the pull request body, plus a list of the files it changed.certify-build's title and body. Each run opens its own pull request and leaves earlier ones open, so any checked version can be merged.compatibility-<country>result file: the model version, the pinned builds,passed,failed(naming the step: setup, certification or pull_request) orcancelled, the pull request and the run. The drift report (8b · 2) reads it.ghcalls, with no AI involved.Also removed:
certify-uk-release.yaml;tests/test_uk_qualification_workflow.pyand two intests/test_uk_qualification_pipeline.py, with two fake pull request listings only they used;docs/engineering/runbooks/uk-qualification.md.Docstrings that pointed at the runbook or the workflow are updated. The rest of the UK pipeline, its Python code and
qualification-ledger.sh, stays for now. A later task removes it, keepinguk_uc_floor.json.Decisions (Anthony's)
17 6 * * 2,5.ghcalls.policyengine-corestays at the bundle's pin.compatibility-<country>artifacts.Tests
tests/test_model_compatibility_workflow.py(new) covers:ghandgit ls-remotecommands it runs;${{ inputs.* }},${{ matrix.* }}or${{ github.event.* }}inside anyrunscript;gitandghcommands.tests/test_ci_runner_variables.pynow lists the new workflow's two jobs.Local results. Only the added or changed tests were run, each by node ID:
52b4924tests,2e91435changeba76563tests,693a7b9change (certify-build --in-place)47fda41tests,38716cachange (review round 1)${COUNTRY^^}7c45d3ftest,89df93fchange (review round 2)9aac84btests,444a83fchange (review round 3)--model-version, is new coverage and passed)mainwas merged in once (cd050c2) to resolve a conflict with #761. #761 had edited the old workflow, its runbook and its YAML tests, all of which this PR removes, including the test #761 added. After the merge, the bundle test and the runner-variable tests passed again. ruff format and check on the changed Python files report nothing. actionlint reports nothing except thequeuekey, which GitHub documents but actionlint 1.7.12 does not know yet (rhysd/actionlint#657); .py's CI does not run actionlint.Review
Three rounds of adversarial review, each by a fresh reviewer. The files are kept outside the repository.
Round 1 (head
93be013), five bugs, all fixed in47fda41(tests) and38716ca(change):ubuntu-lateststarts with about 14 GB. A step now frees disk space on GitHub-hosted runners.cancelled, and the issue is left alone.Round 2 (head
38716ca) confirmed round 1's fixes and answered four questions:gh auth setup-gitworks with onlyGH_TOKEN;job.statusiscancelledinalways()steps after a cancellation;runner.environmentexists; and the plan job can rungit ls-remote. One bug, fixed in7c45d3fand89df93f:cancelledand opened no issue. The certification step now has its own 270-minute limit.Round 3 (head
89df93f) confirmed round 2's fix. Three bugs:9aac84band444a83f: by default a newly queued run cancels the run already waiting in the concurrency group, so a second manual run dropped the first, or a waiting scheduled run. The group now setsqueue: max.gh,git, its manifest entry) stopped the other country's check too. Countries are now planned separately, as described above.certify-build's own branches (7c · 2). Fixing it means adding the local-area build to the name in both places, or documenting the limitation; that choice is open.Bugs left, by priority
failedalso covers acertify-buildrefusal (for example too little disk) and a failed pull request step after a passing check; the result file'sfailed_steptells them apart only ascertificationorpull_request.HUGGING_FACE_TOKEN.What the merge waits for
scripts/bundle.py check-compatibilityand the compatibility record): merged is enough. The workflow runs from this repository'smain; nothing it needs is published or deployed.scripts/bundle.py certify-build --in-place): merged is enough, for the same reason. This PR does not build on its branch yet, because 7c · 2 has no PR. The "Do not merge" step above merges that branch in once it exists.Environment variables and secrets
HUGGING_FACE_TOKENenv:fromsecrets.HUGGING_FACE_TOKENAPP_ID,APP_PRIVATE_KEYwith:ofactions/create-github-app-token@v1certify/*. Whether the App's installation still has contents and pull-request write access here is unverified.GH_TOKENgithub.tokenand the App token stepenv:pull-requests: readfor the plan,issues: writefor the check.CERTIFY_RUNNER_X64,CI_RUNNER_EVENTSruns-onvars.expressionubuntu-latest.UV_VERSION,PYTHON_VERSION,UV_PYTHONenv:env:Other notes
policyengine-uk-releaserepository dispatch to this repository. Since Allow explicit local US data without unused bundle certification #761, nothing here receives it. The step cannot fail a release (continue-on-error: true), and Remove the release workflow's dispatch to policyengine.py policyengine-uk#2999 asks for it and its test to be removed.🤖 Generated with Claude Code