Skip to content

Notify consumer repos after PyPI release#451

Open
anth-volk wants to merge 1 commit into
mainfrom
feat/notify-consumers-on-release
Open

Notify consumer repos after PyPI release#451
anth-volk wants to merge 1 commit into
mainfrom
feat/notify-consumers-on-release

Conversation

@anth-volk

Copy link
Copy Markdown
Contributor

Summary

Adds a NotifyConsumers job to the Publish phase of the release pipeline. After each release is confirmed visible on PyPI, it sends a policyengine-release repository 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: Publish exposes the released version as a job output; new NotifyConsumers job (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: captures fetch_version.py output as a step output, rejecting non-semver output (the script prints an error line plus None on 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 the policyengine-release dispatch 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_KEY secrets) — 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-release would be silently dropped. Merging this PR then cuts a patch release that exercises the new flow end-to-end.


🤖 Generated with Claude Code

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>
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