Skip to content

fix(ci): read next-release version from release-please branch in rc-release#2232

Merged
PaulChen79 merged 3 commits into
mainfrom
fix/rc-release-next-version
May 4, 2026
Merged

fix(ci): read next-release version from release-please branch in rc-release#2232
PaulChen79 merged 3 commits into
mainfrom
fix/rc-release-next-version

Conversation

@goldmedal
Copy link
Copy Markdown
Collaborator

@goldmedal goldmedal commented May 4, 2026

Summary

Triggering RC Release for wren produced wren-v0.3.0-rc.1 instead of the expected wren-v0.4.0-rc.1. Same class of bug for the other components.

.release-please-manifest.json on main stores the last released version, not the next one. The next version lives on the per-component release-please branch (release-please--branches--main--components--<component>), where release-please bumps the manifest entry as part of the proposed release PR.

This change reads the manifest from that branch when computing BASE_VERSION. If the branch doesn't exist (no pending release for the component), the workflow now fails with a clear error message instead of silently producing an RC for the already-released version.

Verification

Locally resolved next-release versions from each release-please branch:

component manifest on main (released) manifest on release-please branch (next)
wren 0.3.0 0.4.0
wren-core-py 0.4.0 0.5.0
wren-core-wasm 0.1.0 0.2.0

After this fix, dispatching RC Release with component=wren will produce wren-v0.4.0-rc.1.

Cleanup note

Three RC tags were created with the buggy versions and should probably be deleted manually:

  • wren-v0.3.0-rc.1
  • wren-core-py-v0.4.0-rc.1
  • wren-core-wasm-v0.1.0-rc.2

Test plan

  • Verified the new lookup against the three release-please branches.
  • Re-dispatch RC Release with component=wren and confirm it tags wren-v0.4.0-rc.1.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Release candidate version lookup now fetches release metadata from the component branch remotely, improving reliability of automated releases.
    • Publishing workflow switched to platform trusted publishing (id-token based) and no longer relies on an injected npm secret.
    • Node runtime pinned to v24 and the workflow updates npm globally before install/publish.

…elease

main's .release-please-manifest.json holds the last released version, so
the previous logic produced RC tags for the *current* release (e.g.
wren-v0.3.0-rc.1 when 0.3.0 was already released and 0.4.0 was pending).

The next-release version lives on the per-component release-please
branch (release-please--branches--main--components--<component>). Read
the manifest from there. If the branch is absent, there is no pending
release for the component and the workflow now fails with a clear
message instead of silently re-tagging the released version.
@github-actions github-actions Bot added the ci label May 4, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 4, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 11c0ce38-3d5a-4f54-a2cd-fcdd98290ce0

📥 Commits

Reviewing files that changed from the base of the PR and between e7026ae and b7037cb.

📒 Files selected for processing (2)
  • .github/workflows/publish-wren-core-wasm.yml
  • .github/workflows/rc-release.yml

Walkthrough

RC base-version resolution now fetches the component-specific release-please branch and reads .release-please-manifest.json from that ref (passed into an embedded Python snippet via MANIFEST_JSON). Publish workflows remove the NPM_TOKEN secret, add id-token: write permissions, and upgrade npm during the publish job.

Changes

RC Version Manifest Resolution

Layer / File(s) Summary
Branch fetch & manifest retrieval
.github/workflows/rc-release.yml
Compute RELEASE_BRANCH from COMPONENT, verify it exists on remote, fetch it, and read .release-please-manifest.json from the fetched ref via git show into MANIFEST_JSON.
Component → package path resolution
.github/workflows/rc-release.yml (embedded Python snippet)
Python consumes MANIFEST_JSON, reads release-please-config.json, resolves the package path whose component matches COMPONENT, and extracts the base version from the manifest entry for that path.
RC flow unchanged
.github/workflows/rc-release.yml (remaining steps)
RC override/validation, RC tag naming, and PyPI version formatting remain as before.

Trusted NPM Publishing (publish-wren-core-wasm)

Layer / File(s) Summary
Workflow call inputs
.github/workflows/publish-wren-core-wasm.yml
Removed the call-level required secret NPM_TOKEN from workflow_call.
Job permissions / auth mode
.github/workflows/publish-wren-core-wasm.yml, .github/workflows/release-please.yml
Added job-level permissions: { contents: read, id-token: write }; callers no longer pass secrets.NPM_TOKEN when invoking the publish workflow.
Publish job runtime changes
.github/workflows/publish-wren-core-wasm.yml (build-and-publish job)
Pin Node.js to v24, add npm install -g npm@latest step, and remove env.NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} from the publish step so publishing uses the trusted ID-token flow.
Call-site permission update
.github/workflows/release-please.yml (publish-wren-core-wasm job invocation)
Removed secrets: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} and added permissions: { contents: read, id-token: write } to the job invocation.

Sequence Diagram(s)

sequenceDiagram
  participant ReleaseWorkflow as Release-please workflow
  participant GitRemote as Git remote (origin)
  participant Runner as GH Actions runner
  participant Python as Embedded Python snippet
  participant NPMRegistry as npm registry

  ReleaseWorkflow->>Runner: start rc-release job
  Runner->>GitRemote: git ls-remote (verify branch) / git fetch
  Runner->>GitRemote: git show .release-please-manifest.json@RELEASE_BRANCH
  Runner->>Python: pass MANIFEST_JSON + COMPONENT
  Python->>Runner: print BASE_VERSION
  ReleaseWorkflow->>Runner: invoke publish-wren-core-wasm with id-token
  Runner->>NPMRegistry: authenticate via ID token (trusted publishing)
  Runner->>NPMRegistry: npm publish
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • PaulChen79
  • fredalai

Poem

🐰 I fetched a branch beneath the moonlit tree,
Manifest in paw, it whispered back to me.
No token clutched — the ID sings free,
npm refreshed for our jubilee,
Hooray — release hops on, light and spry! 🥕

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main fix: the RC release workflow now reads the next-release version from the release-please branch instead of main.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/rc-release-next-version

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.

❤️ Share
Review rate limit: 6/8 reviews remaining, refill in 9 minutes and 9 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/rc-release.yml:
- Around line 78-79: The code directly indexes manifest[path] which raises a raw
KeyError when the path is missing; update the logic around manifest =
json.loads(os.environ['MANIFEST_JSON']) and the subsequent access to check for
the key first (e.g., if path not in manifest) and handle the missing entry by
printing a clear error message (including the path) to stderr and exiting with a
non-zero code, or use manifest.get(path) and validate the result before printing
so the workflow fails with an explicit, helpful error instead of a traceback.
🪄 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: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 6684f57c-235c-45e0-a758-57baa4640719

📥 Commits

Reviewing files that changed from the base of the PR and between 1394f10 and c33de1d.

📒 Files selected for processing (1)
  • .github/workflows/rc-release.yml

Comment thread .github/workflows/rc-release.yml
Drop NPM_TOKEN in favour of OIDC-based Trusted Publishing now that the
package is configured for it on npm. The reusable workflow grants the
publish job id-token: write, upgrades npm to a version that supports
Trusted Publishing (>= 11.5.1) since setup-node ships an older npm,
and stops setting NODE_AUTH_TOKEN. Both callers (rc-release,
release-please) drop the NPM_TOKEN secret and forward id-token: write.
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/publish-wren-core-wasm.yml:
- Around line 63-65: Change the workflow step labeled "Upgrade npm (Trusted
Publishing requires >= 11.5.1)" to pin npm to the known-good minimum by
replacing the unstable `npm@latest` with the explicit version `npm@11.5.1`;
update the run command in that step to install `npm@11.5.1` so releases are
deterministic and meet the Trusted Publishing requirement.
🪄 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: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 3d43736d-c51d-4a49-9af7-09ac7d5c4e0d

📥 Commits

Reviewing files that changed from the base of the PR and between c33de1d and e7026ae.

📒 Files selected for processing (3)
  • .github/workflows/publish-wren-core-wasm.yml
  • .github/workflows/rc-release.yml
  • .github/workflows/release-please.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/rc-release.yml

Comment thread .github/workflows/publish-wren-core-wasm.yml Outdated
…t error

- npm Trusted Publishing requires Node.js >= 22.14.0 (per npm docs).
  Node 20 doesn't meet that, so bump the wasm publish workflow to Node 24.
  Keep the explicit 'npm install -g npm@latest' as a belt-and-suspenders
  guarantee for the npm >= 11.5.1 requirement.
- Replace the raw KeyError on a missing manifest path with an explicit
  sys.exit message so workflow failures are easier to triage.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants