chore: keep unreleased changelog entries in per-package fragment files - #10642
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe PR replaces unpublished Priority: ⬇️ Low Change: Other Merge Risk: ⚪ Minimal · up to The fragment workflow validates entries, preserves rename changes, rejects duplicate metadata, and handles release migrations without an actionable merge-blocking risk. 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
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.
Actionable comments posted: 6
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: a6a96be0-aaef-49b0-8d27-e4fae69a2f6c
📒 Files selected for processing (21)
.github/PULL_REQUEST_TEMPLATE.md.github/workflows/changelog-check.ymlAGENTS.mdpackage.jsonpackages/react-native-reanimated/.changelog/.gitkeeppackages/react-native-reanimated/.changelog/unreleased-changelog-entries-now-live-in-one-file.mdpackages/react-native-reanimated/CHANGELOG.mdpackages/react-native-reanimated/RELEASE.mdpackages/react-native-worklets/.changelog/.gitkeeppackages/react-native-worklets/.changelog/unreleased-changelog-entries-now-live-in-one-file.mdpackages/react-native-worklets/CHANGELOG.mdscripts/__tests__/add-changelog-entry.test.mtsscripts/__tests__/changelog-entries.test.mtsscripts/__tests__/check-changelog.test.mtsscripts/__tests__/collect-changelog-entries.test.mtsscripts/__tests__/lint-changelog.test.mtsscripts/add-changelog-entry.mtsscripts/changelog-entries.mtsscripts/check-changelog.mtsscripts/collect-changelog-entries.mtsscripts/lint-changelog.mts
💤 Files with no reviewable changes (2)
- packages/react-native-reanimated/CHANGELOG.md
- packages/react-native-worklets/CHANGELOG.md
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
🟡 Minor · Reject duplicate front-matter keys. · changelog-entries.mts:70
scripts/changelog-entries.mts:70
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winReject duplicate front-matter keys.
Map.setreplaces an earliertype,author, orprvalue. An entry with two validtypelines passes validation and is released under the last type. Reject a key whenfieldsalready contains it. Add a regression test for each duplicated key.Proposed fix
- fields.set(key, value.trim()); + if (fields.has(key)) { + errors.push(`\`${key}\` is declared more than once.`); + continue; + } + fields.set(key, value.trim());
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: f8c8ffe0-bd03-4252-9faf-1c16384f2f56
📒 Files selected for processing (12)
AGENTS.mdpackages/react-native-reanimated/RELEASE.mdpackages/react-native-worklets/.changelog/bump-worklets-version-to-0-14-0.mdscripts/__tests__/changelog-entries.test.mtsscripts/__tests__/check-changelog.test.mtsscripts/__tests__/collect-changelog-entries.test.mtsscripts/__tests__/lint-changelog.test.mtsscripts/add-changelog-entry.mtsscripts/changelog-entries.mtsscripts/check-changelog.mtsscripts/collect-changelog-entries.mtsscripts/lint-changelog.mts
🚧 Files skipped from review as they are similar to previous changes (5)
- AGENTS.md
- scripts/tests/lint-changelog.test.mts
- packages/react-native-reanimated/RELEASE.md
- scripts/tests/check-changelog.test.mts
- scripts/tests/collect-changelog-entries.test.mts
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
bddf7ab to
a01e532
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 0caa821a-f845-4048-b404-10080952bfbd
📒 Files selected for processing (18)
.github/PULL_REQUEST_TEMPLATE.mdAGENTS.mdpackage.jsonpackages/react-native-reanimated/RELEASE.mdpackages/react-native-reanimated/changelog/README.mdpackages/react-native-reanimated/changelog/oxlint-migration.other.mdpackages/react-native-worklets/CHANGELOG.mdpackages/react-native-worklets/changelog/README.mdpackages/react-native-worklets/changelog/dev-flag-in-js.fix.mdpackages/react-native-worklets/changelog/oxlint-migration.other.mdscripts/__tests__/add-changelog.test.mtsscripts/__tests__/changelog-fragments.test.mtsscripts/__tests__/check-changelog.test.mtsscripts/__tests__/squash-changelog.test.mtsscripts/add-changelog.mtsscripts/changelog-fragments.mtsscripts/check-changelog.mtsscripts/squash-changelog.mts
💤 Files with no reviewable changes (1)
- packages/react-native-worklets/CHANGELOG.md
🚧 Files skipped from review as they are similar to previous changes (1)
- .github/PULL_REQUEST_TEMPLATE.md
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
9adfcdd to
43a9c4e
Compare
Each pull request adds `packages/<pkg>/changelog/<slug>.<type>.md` and no longer edits `CHANGELOG.md`, so two pull requests never touch the same file. `yarn changelog:add` writes a fragment, `yarn changelog:squash` moves the fragments into `CHANGELOG.md` at release, and the changelog check validates the fragments.
43a9c4e to
8ae2cf2
Compare
tjzel
left a comment
There was a problem hiding this comment.
@coderabbitai approve machen
software-mansion#10642) > [!NOTE] > This pull request was authored by AI on behalf of @pawicao. Every pull request that changed a package edited the same `## Unpublished` section, so pull requests conflicted with each other. I moved unreleased entries into one file per pull request in `packages/<pkg>/changelog/` and left `CHANGELOG.md` with released versions only. A fragment holds only the entry text, because the release script reads the pull request number from the squash commit that added the file and asks GitHub for the author. I added `changelog:add` and `changelog:squash` to both package workspaces, the first to write a fragment and the second to move the fragments into `CHANGELOG.md`, and I rewrote `changelog-check` to validate fragments. I added fragments for the 4.7.0 cut, and removed their lines from `CHANGELOG.md`. - **In a pull request:** run `yarn workspace <pkg> changelog:add --type <breaking|feature|fix|other> --message '<One sentence>'`, or write `packages/<pkg>/changelog/<slug>.<type>.md` by hand. The script writes into the package of the workspace, and the slug defaults to the branch name. Do not write the pull request link or the author, and do not edit `CHANGELOG.md`. - **To read the unpublished entries:** `yarn workspace <pkg> changelog:squash` prints them and changes no file. - **In a release pull request on the stable branch:** `yarn workspace <pkg> changelog:squash x.y.z` writes the `## x.y.z — <date>` section and deletes the fragments. - **In the post-release pull request on `main`:** `yarn workspace <pkg> changelog:squash x.y.0 --date <release date> --cut origin/x.y-stable` does the same, but leaves the fragments that came to `main` after the stable branch was cut. - **Cherry-picks:** the fragment comes with the cherry-pick, and the first `(#N)` in the commit subject still points to the original pull request. - **When the script cannot resolve an entry:** add a `pr: <number>` or a `by: @user1, @user2` line to the fragment. `by:` always takes precedence. - `changelog-check` needs a new fragment for each changed package. It rejects edits of `CHANGELOG.md` and deleted fragments, unless the pull request changes the package `version`, which marks a release or post-release pull request. `yarn test:scripts` passes. I also ran the three scripts in scratch repositories with real squash merges, and the author lookup against GitHub. `changelog-check` fails on this pull request, because it removes the `## Unpublished` section from both `CHANGELOG.md` files and does not change a `version`. This is expected and happens only for this migration. - [x] I added a changelog fragment with `yarn changelog:add` for each changed package, or this PR does not change `react-native-reanimated` or `react-native-worklets`.
Note
This pull request was authored by AI on behalf of @pawicao.
Summary
Every pull request that changed a package edited the same
## Unpublishedsection, so pull requests conflicted with each other. I moved unreleased entries into one file per pull request inpackages/<pkg>/changelog/and leftCHANGELOG.mdwith released versions only. A fragment holds only the entry text, because the release script reads the pull request number from the squash commit that added the file and asks GitHub for the author. I addedchangelog:addandchangelog:squashto both package workspaces, the first to write a fragment and the second to move the fragments intoCHANGELOG.md, and I rewrotechangelog-checkto validate fragments. I added fragments for #10584, #10632, #10587, #10629 and #10650, which merged tomainafter the 4.7.0 cut, and removed their lines fromCHANGELOG.md.How we use the changelog from now on
yarn workspace <pkg> changelog:add --type <breaking|feature|fix|other> --message '<One sentence>', or writepackages/<pkg>/changelog/<slug>.<type>.mdby hand. The script writes into the package of the workspace, and the slug defaults to the branch name. Do not write the pull request link or the author, and do not editCHANGELOG.md.yarn workspace <pkg> changelog:squashprints them and changes no file.yarn workspace <pkg> changelog:squash x.y.zwrites the## x.y.z — <date>section and deletes the fragments.main:yarn workspace <pkg> changelog:squash x.y.0 --date <release date> --cut origin/x.y-stabledoes the same, but leaves the fragments that came tomainafter the stable branch was cut.(#N)in the commit subject still points to the original pull request.pr: <number>or aby: @user1, @user2line to the fragment.by:always takes precedence.changelog-checkneeds a new fragment for each changed package. It rejects edits ofCHANGELOG.mdand deleted fragments, unless the pull request changes the packageversion, which marks a release or post-release pull request.Test plan
yarn test:scriptspasses. I also ran the three scripts in scratch repositories with real squash merges, and the author lookup against GitHub.changelog-checkfails on this pull request, because it removes the## Unpublishedsection from bothCHANGELOG.mdfiles and does not change aversion. This is expected and happens only for this migration.Changelog
yarn changelog:addfor each changed package, or this PR does not changereact-native-reanimatedorreact-native-worklets.