Notify consumer repos after PyPI release#451
Open
anth-volk wants to merge 1 commit into
Open
Conversation
Add a NotifyConsumers job to the Publish phase: after the release is visible on PyPI, send a policyengine-release repository dispatch to policyengine-api and policyengine-api-v2 so they open version-bump PRs immediately instead of polling PyPI on a cron. The Publish job now exposes the released version as a job output, validated by capture-version.sh. Tokening uses the PolicyEngine GitHub App scoped to the two consumer repos. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Summary
Adds a
NotifyConsumersjob to the Publish phase of the release pipeline. After each release is confirmed visible on PyPI, it sends apolicyengine-releaserepository dispatch (payload: the released version) to PolicyEngine/policyengine-api and PolicyEngine/policyengine-api-v2, whose update workflows then open single-version bump PRs immediately. This replaces those repos' 30-minute PyPI polling crons (companion PRs: policyengine-api#3724, policyengine-api-v2#606).Changes
push.yaml:Publishexposes the released version as a job output; newNotifyConsumersjob (needs: [Publish], so it only runs on sentinel-commit release runs) checks out, waits for PyPI visibility, mints a PolicyEngine GitHub App token scoped to the two consumer repos, and dispatches..github/capture-version.sh: capturesfetch_version.pyoutput as a step output, rejecting non-semver output (the script prints an error line plusNoneon failure)..github/wait-for-pypi.sh: polls the version-specific PyPI JSON endpoint (30 × 20 s) so consumers never receive a dispatch for a not-yet-resolvable version..github/dispatch-policyengine-release.sh: sends thepolicyengine-releasedispatch to both consumer repos.All logic lives in standalone shell scripts invoked from the workflow; tokening uses the PolicyEngine GitHub App (existing
APP_ID/APP_PRIVATE_KEYsecrets) — dispatch requires its existing Contents: write access on the consumer repos.Merge order
Merge the two consumer PRs first — dispatch is fire-and-forget, so events sent before their workflows listen for
policyengine-releasewould be silently dropped. Merging this PR then cuts a patch release that exercises the new flow end-to-end.🤖 Generated with Claude Code