feat: auto-sync readme.txt changelog and version on release - #50
Conversation
- changelog-release.js now mirrors each promoted version entry into readme.txt == Changelog == in WP.org format (Added/Changed/Fixed bullets) - release.yml: move changelog-release step before build:zip so the zip always contains the up-to-date readme.txt - release.yml: commit both CHANGELOG.md and readme.txt back to main - Fix readme.txt: changelog entry 0.0.1 → 0.3.0, remove REST API and Design Settings sections (already staged)
There was a problem hiding this comment.
1 issue found and verified against the latest diff
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
Previously syncReadmeChangelog re-derived entries from the auto-generated commit categorisation, ignoring any manual entries written in [Unreleased]. Now it converts the authoritative mergedBody (what was actually written to CHANGELOG.md) so readme.txt always mirrors the same content.
📝 WalkthroughWalkthroughThe release script gains two new helpers— ChangesWP readme.txt changelog sync
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 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 docstrings
🧪 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.
Actionable comments posted: 1
🤖 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 `@scripts/changelog-release.js`:
- Around line 162-179: The loop that processes changelog lines only captures
section headers (lines matching the ###\s+ pattern) and bullet points (lines
matching ^[-*]\s+ pattern), but ignores any free-form text lines that don't
match these patterns. To fix this, add an additional condition after the
bulletMatch check to handle lines that are neither section headers nor bullet
points. For any remaining non-empty lines that don't match the sectionMatch or
bulletMatch patterns, add them to the lines array with appropriate formatting
(prepending with * if needed) so that free-form content in the [Unreleased]
section is preserved and included in the readme sync output.
🪄 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 Plus
Run ID: aafe0785-0fb5-492e-9c6d-295431c3841a
📒 Files selected for processing (3)
.github/workflows/release.ymlSLASHED-for-WP/readme.txtscripts/changelog-release.js
…SDoc - changelogBodyToReadmeLines: also match numbered lists and bare free-form text lines so manually written [Unreleased] entries are not silently dropped - Add JSDoc to mergeBody() and main() to satisfy 80% docstring coverage threshold
There was a problem hiding this comment.
1 issue found across 1 file (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Fix all with cubic | Re-trigger cubic
Summary
changelog-release.jsnow mirrors each promoted version entry intoreadme.txt == Changelog ==in WP.org format (= X.Y.Z =with* Added:/* Changed:/* Fixed:bullets), generated from the same conventional commits asCHANGELOG.mdrelease.yml: moved thechangelog-releasestep to run beforebuild:zipso the distributed zip always contains the fully up-to-datereadme.txtrelease.yml: the commit-back step now stages bothCHANGELOG.mdandSLASHED-for-WP/readme.txtso both are pushed to main after a releasereadme.txt: fixed changelog entry0.0.1→0.3.0, removed the internal REST API section and the currently-disabled Design Settings sectionRelease flow after this PR
When a version tag (e.g.
v0.4.0) is pushed:version-sync --from-tagstampsStable tag,Version:headers, and PHP constantschangelog-release.js --from-tagpromotes[Unreleased]inCHANGELOG.mdand prepends= 0.4.0 =toreadme.txt == Changelog ==build:zippackages the zip — readme.txt is already up to date inside itCHANGELOG.mdandreadme.txtare committed back to mainTest plan
readme.txtwith the correct= X.Y.Z =entry under== Changelog ==CHANGELOG.mdandreadme.txtare both committed back to main by the release workflowStable tagin readme.txt matches the tag versionGenerated by Claude Code
Summary by cubic
Auto-syncs the WP.org
readme.txtchangelog from the promotedCHANGELOG.mdentry on release, and runs before packaging so the published zip always has the latest notes.New Features
scripts/changelog-release.jsmirrors each promoted version intoSLASHED-for-WP/readme.txtunder== Changelog ==in WP.org format (= X.Y.Z =), converting the mergedCHANGELOG.mdbody (includes manual notes).release.ymlruns the sync beforebuild:zipand commitsCHANGELOG.mdandreadme.txtback to the default branch.Bug Fixes
[Unreleased]notes are kept.ENOENTfor missingreadme.txt; re-throw other errors so the release fails visibly.scripts/changelog-release.jsfor clarity.Written for commit 629de00. Summary will update on new commits.
Summary by CodeRabbit
Documentation
Chores