feat(ci): auto-open downstream bump PRs on package release#638
feat(ci): auto-open downstream bump PRs on package release#638SoulPancake wants to merge 5 commits into
Conversation
When a package release is published (undrafted) in this repo, open a version-bump PR against the relevant downstream consumers, authored and GPG-signed by the same openfga-releaser-bot identity used by release-please. - pkg/js -> openfga/vscode-ext (@openfga/syntax-transformer) - pkg/java -> openfga/intellij-plugin (dev.openfga:openfga-language) - pkg/go -> openfga/cli, openfga/terraform-provider-openfga Adds scripts/downstream-bump.sh (per-ecosystem edit logic, idempotent) with unit tests, and reusable-downstream-bump.yaml which mints a target-scoped App token, applies the bump, and opens the PR. Chained after each finalize-release job so it is not subject to the GITHUB_TOKEN no-retrigger rule.
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughChangesDownstream bump automation
Estimated code review effort: 3 (Moderate) | ~30 minutes Sequence Diagram(s)sequenceDiagram
participant ReleaseWorkflow
participant ReusableWorkflow
participant DownstreamRepository
participant BumpScript
ReleaseWorkflow->>ReusableWorkflow: invoke after finalized tag release
ReusableWorkflow->>DownstreamRepository: checkout target and prepare credentials
ReusableWorkflow->>BumpScript: run ecosystem version bump
BumpScript->>DownstreamRepository: update dependency files
ReusableWorkflow->>DownstreamRepository: push branch and open pull request
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Adds an automated “downstream consumer bump” flow that runs after publishing (undrafting) a package release, so downstream repos get version-bump PRs opened by the releaser bot identity.
Changes:
- Introduces a reusable workflow to mint a target-scoped GitHub App token, apply an ecosystem-specific version bump, and open a signed PR in downstream repos.
- Adds a
downstream-bump.shscript plus a shell-based unit test suite, and wires those tests into CI. - Chains downstream bump jobs after the existing finalize-release jobs for JS/Java/Go package release workflows.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/test-release-scripts.yml | Runs the new downstream bump script tests in CI when scripts/workflow change. |
| .github/workflows/scripts/downstream-bump.sh | Implements ecosystem-specific dependency bump logic for downstream repositories. |
| .github/workflows/scripts/downstream-bump.test.sh | Adds hermetic/unit tests for downstream bump behaviors and guardrails. |
| .github/workflows/reusable-downstream-bump.yaml | Reusable workflow that checks out target repo, applies bump, signs commit, and opens PR. |
| .github/workflows/pkg-js-release.yaml | Invokes the downstream bump reusable workflow after JS release is published. |
| .github/workflows/pkg-java-release.yaml | Invokes the downstream bump reusable workflow after Java release is published. |
| .github/workflows/pkg-go-release.yaml | Invokes the downstream bump reusable workflow after Go release is published. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Push based instead of waiting for dependabot |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.github/workflows/scripts/downstream-bump.test.sh (1)
5-8: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd hermetic success-path tests for JavaScript and Go.
Stub
npmandgothrough a temporaryPATH, then verify the normalized version, expected arguments, and resulting file changes. Currently, regressions in the two production success paths can pass CI because only their guards are exercised.Also applies to: 150-197
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/scripts/downstream-bump.test.sh around lines 5 - 8, Add hermetic success-path tests in downstream-bump.test.sh for the JavaScript and Go update flows. Prepend temporary stub executables for npm and go to PATH, invoke each flow, and assert version normalization, expected tool arguments, and the resulting file changes while preserving the existing guard/error tests.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/reusable-downstream-bump.yaml:
- Around line 68-75: Restrict the app token from the npm install performed by
the JS bump path: disable persisted checkout credentials in the checkout step,
stop exporting GH_TOKEN for Apply bump and open PR, and provide the generated
app token only to the git push/PR creation step that needs it. Preserve the
existing app-token generation and bump behavior while ensuring lifecycle scripts
cannot access the token.
---
Nitpick comments:
In @.github/workflows/scripts/downstream-bump.test.sh:
- Around line 5-8: Add hermetic success-path tests in downstream-bump.test.sh
for the JavaScript and Go update flows. Prepend temporary stub executables for
npm and go to PATH, invoke each flow, and assert version normalization, expected
tool arguments, and the resulting file changes while preserving the existing
guard/error tests.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 471e879e-0066-4282-9d63-705687d5cb9f
📒 Files selected for processing (7)
.github/workflows/pkg-go-release.yaml.github/workflows/pkg-java-release.yaml.github/workflows/pkg-js-release.yaml.github/workflows/reusable-downstream-bump.yaml.github/workflows/scripts/downstream-bump.sh.github/workflows/scripts/downstream-bump.test.sh.github/workflows/test-release-scripts.yml
When a package release is published (undrafted) in this repo, open a version-bump PR against the relevant downstream consumers, authored and GPG-signed by the same openfga-releaser-bot identity used by release-please.
Adds scripts/downstream-bump.sh (per-ecosystem edit logic, idempotent) with unit tests, and reusable-downstream-bump.yaml which mints a target-scoped App token, applies the bump, and opens the PR. Chained after each finalize-release job so it is not subject to the GITHUB_TOKEN no-retrigger rule.
Description
What problem is being solved?
How is it being solved?
What changes are made to solve it?
References
Review Checklist
mainSummary by CodeRabbit
New Features
Bug Fixes
Tests