Skip to content

Ask policyengine.py to qualify each published data release - #577

Open
MaxGhenis wants to merge 3 commits into
mainfrom
w4/dispatch-uk-qualification
Open

MaxGhenis wants to merge 3 commits into
mainfrom
w4/dispatch-uk-qualification

Conversation

@MaxGhenis

Copy link
Copy Markdown
Contributor

Summary

After the release build uploads the data and publishes the tag, it now sends a policyengine-uk-data-release repository dispatch to PolicyEngine/policyengine.py. That repository's certify-uk-release.yaml (PolicyEngine/policyengine.py#574) qualifies each new data release against the latest model before it can be promoted. Today it would only find a new release on its two-hourly schedule.

  • Two steps at the end of the test job in .github/workflows/push.yaml:
    • actions/create-github-app-token@v3 with the org App (APP_ID, APP_PRIVATE_KEY, as versioning.yaml already uses), scoped to owner: PolicyEngine, repositories: policyengine.py.
    • gh api --method POST repos/PolicyEngine/policyengine.py/dispatches with event_type=policyengine-uk-data-release and client_payload[version] set to the version from .github/fetch_version.py, the same value publish-git-tag.sh tags.
  • Neither step has a condition. The default success() means they run only when every earlier step succeeded, the upload and the tag included. There is no dry-run input on this workflow. A manual rebuild of an already-released version dispatches again, and policyengine.py deduplicates qualification attempts, so that is a no-op there.
  • The version is read in the shell, never interpolated into run:.
  • The App use was approved by Max (decision d1362).

No data change, no changelog fragment

This changes no data, no package code and no version. It deliberately has no changelog fragment: a fragment would trigger versioning.yaml, bump the version, and release data outside the d833 batch. The changelog check passes on the fragments already pending on main. This PR can land independently of that batch.

Tests

policyengine_uk_data/tests/test_release_dispatch.py (4 tests, run locally against this push.yaml; they need only PyYAML):

  • the dispatch comes after "Upload data" and "Publish a git tag", with no condition and no continue-on-error;
  • the token is scoped to policyengine.py and is the step's only environment;
  • running the step's script with a fake gh sends exactly the event type and the version from pyproject.toml;
  • with no readable version, it fails and sends nothing.

actionlint passes apart from the existing queue: max key, which actionlint does not yet know.

Requested by the UK hub for the UK Autumn Budget 2026 CI plan (workstream W4).

🤖 Generated with Claude Code

MaxGhenis and others added 3 commits October 12, 2026 05:32
After the data uploads and the tag is published, the release build sends
a policyengine-uk-data-release repository dispatch to policyengine.py,
whose certify-uk-release workflow qualifies the new release against the
latest model before it can be promoted. The token comes from the org App
and is scoped to policyengine.py alone. Without this, qualification waits
for its two-hourly schedule.

Workflow-only: no data or package change, so no changelog fragment (a
fragment would bump the version and release data outside the batch).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
publish-git-tag.sh ignores a failed tag push, so the dispatch step now
checks the release tag is on origin (git ls-remote) and fails without
dispatching if it is not. The App token is restricted to
permission-contents: write, all a repository dispatch needs. Tests cover
the missing tag and the token's permissions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The fake git now answers ls-remote as git does (a missing ref exits 2 only
under --exit-code), so dropping --exit-code or masking a failed gh api call
fails the tests. Round-2 review finding.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MaxGhenis
MaxGhenis marked this pull request as ready for review October 12, 2026 11:23
@MaxGhenis

Copy link
Copy Markdown
Contributor Author

Hand-off to the UK hub (W4, release qualification). This PR is ready; it waits only for the d833 uk-data batch.

@MaxGhenis

Copy link
Copy Markdown
Contributor Author

UK hub (2026-10-12 16:55Z): the hub's GPT-6.1 Sol delta review of 1577a38d found no code defect. push.yaml is byte-identical to the approved 054d0265, the tests run the workflow's real run block, and nothing is weakened. It held back only because its sandbox could not run the two mutations, so the hub ran them: the original passes 7 tests; dropping --exit-code fails 2; adding || true to the dispatch fails 1. That matches the review's prediction exactly. This PR is batch-ready for the next uk-data batch (d833).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant