chore(ci): add release-please configs#594
Conversation
|
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:
WalkthroughThis PR adds a complete release automation system using Google Release Please. It includes configuration for three packages ( ChangesRelease Automation Setup
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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
This PR introduces release-please configuration and GitHub Actions workflows/scripts to automate multi-package releases (Go/JS/Java) and to publish tagged draft GitHub releases with combined changelog + generated notes.
Changes:
- Add
release-pleaseconfig (release-please-config.json) and manifest (.release-please-manifest.json) forpkg/go,pkg/js, andpkg/java. - Add reusable release workflow (
.github/workflows/reusable-release-please.yaml) plus entrypoint workflow (.github/workflows/release-please.yaml) and helper parsing scripts/tests. - Update JS prettier ignore rules to avoid formatting
CHANGELOG.mdwhich is generated by release tooling.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
release-please-config.json |
Adds release-please configuration for multi-package releases (needs cleanup of empty bootstrap-sha). |
.release-please-manifest.json |
Seeds per-package starting versions for release-please manifest mode. |
pkg/js/.prettierignore |
Excludes generated CHANGELOG.md from Prettier formatting. |
.github/workflows/release-please.yaml |
Adds the top-level workflow to run release automation on dispatch and on pushes to main. |
.github/workflows/reusable-release-please.yaml |
Implements the core release-please + post-release publishing flow (contains a critical PR retargeting bug and a trigger-file side effect). |
.github/workflows/scripts/parse-release.sh |
Adds helper commands for manifest diffs, changelog section extraction, and semver bumping (needs more exact changelog header matching). |
.github/workflows/scripts/parse-release.test.sh |
Adds lightweight bash tests for the parsing helpers (doc header references wrong filename). |
.github/workflows/test-release-scripts.yml |
Adds CI coverage to run the parsing helper tests when scripts change. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 5
🧹 Nitpick comments (1)
.github/workflows/scripts/parse-release.test.sh (1)
89-101: ⚡ Quick winAdd a regression case for version-prefix collisions in
changelog-notes.Current coverage doesn’t test ambiguous headers like
v0.2.1vsv0.2.10, so this class of bug can slip through.Suggested test addition
##### changelog-notes ##### @@ assert_eq "changelog-notes extracts the matching section body" "$expected_notes" "$notes" + +# Ensure exact version matching (0.2.1 should not match 0.2.10). +cat >"$TMP/CHANGELOG-edge.md" <<'EOF' +# Changelog + +## pkg/js/v0.2.10 +- notes for 0.2.10 + +## pkg/js/v0.2.1 +- notes for 0.2.1 +EOF +edge_notes="$("$PARSE" changelog-notes "$TMP/CHANGELOG-edge.md" "0.2.1")" +assert_eq "changelog-notes matches exact version, not prefix" "- notes for 0.2.1" "$edge_notes"🤖 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/parse-release.test.sh around lines 89 - 101, Add a regression test covering version-prefix collisions for the changelog-notes parser: create a test case invoking "$PARSE changelog-notes" against a temporary CHANGELOG content (TMP/CHANGELOG.md) that contains ambiguous headers like "v0.2.1" and "v0.2.10" and assert that changelog-notes returns the exact section for the requested version (e.g., "0.2.1") using assert_eq. Ensure the test mirrors the existing pattern (the notes="$("$PARSE" changelog-notes ...)" setup and expected_notes string) but includes both headers and verifies the parser does not match the shorter prefix (v0.2.1) to v0.2.10.
🤖 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-release-please.yaml:
- Around line 191-199: The rename path fails because origin/${head} may not
exist locally; before computing sha with git rev-parse in the block that uses
variables head and new_head, explicitly fetch the remote branch so the newly
created release-please PR head is available (i.e., perform a git fetch of origin
for the branch referenced by ${head} and then run git rev-parse); keep the
existing logic that pushes the sha to refs/heads/${new_head}, updates the PR
head via gh api, and deletes the old remote head if present.
- Around line 156-163: In the "Resolve target branch" step (id: target) avoid
interpolating ${{ inputs.trigger-event }} directly into the shell; instead pass
it via env (e.g., TRIGGER_EVENT) and update the run script to compare
"$TRIGGER_EVENT" (or $TRIGGER_EVENT) in the if expression; modify the step to
add an env entry that sets TRIGGER_EVENT from the input and change the
conditional to reference that env variable to prevent command injection.
- Around line 52-58: The GitHub App token steps are missing explicit permission
inputs so they inherit the app installation’s full permissions; update the
"Generate GitHub App token" step (id: app-token) and the other token step around
lines 217-222 to add permission-contents: write for both, and additionally add
permission-pull-requests: write only on the Phase 1 token used to
create/retarget PRs; ensure these are added as top-level with: style inputs
(permission-contents and permission-pull-requests) to the
actions/create-github-app-token steps to enforce least-privilege.
In @.github/workflows/scripts/parse-release.sh:
- Around line 63-68: The header-detection uses substring checks (index($0, "v"
ver) / index($0, ver)) so searching for "0.2.1" can match "0.2.10"; replace that
substring logic with a regex boundary match. In the is_header block (the lines
using index($0, "v" ver) > 0 || index($0, ver) > 0), change it to use awk regex
matching that enforces version boundaries, e.g. test $0 against a pattern like
"(^|[^0-9.])v?VER([^0-9.]|$)" (substituting VER with the ver variable) so only
exact version tokens (with optional leading "v") are accepted; keep setting
found = 1 when the regex matches.
In @.github/workflows/test-release-scripts.yml:
- Line 22: Update the actions/checkout step to explicitly disable credential
persistence by setting persist-credentials: false on the checkout action; locate
the checkout usage (the line using
actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd) and add the
persist-credentials: false input so the workflow does not write GITHUB_TOKEN
credentials to disk.
---
Nitpick comments:
In @.github/workflows/scripts/parse-release.test.sh:
- Around line 89-101: Add a regression test covering version-prefix collisions
for the changelog-notes parser: create a test case invoking "$PARSE
changelog-notes" against a temporary CHANGELOG content (TMP/CHANGELOG.md) that
contains ambiguous headers like "v0.2.1" and "v0.2.10" and assert that
changelog-notes returns the exact section for the requested version (e.g.,
"0.2.1") using assert_eq. Ensure the test mirrors the existing pattern (the
notes="$("$PARSE" changelog-notes ...)" setup and expected_notes string) but
includes both headers and verifies the parser does not match the shorter prefix
(v0.2.1) to v0.2.10.
🪄 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: 1ac32433-6718-4a5d-9f7d-c0a0c6ca1c24
📒 Files selected for processing (8)
.github/workflows/release-please.yaml.github/workflows/reusable-release-please.yaml.github/workflows/scripts/parse-release.sh.github/workflows/scripts/parse-release.test.sh.github/workflows/test-release-scripts.yml.release-please-manifest.jsonpkg/js/.prettierignorerelease-please-config.json
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
Chores
Tests