fix: sync plugin.json version with latest tag#171
Conversation
plugin.json version has been stuck at 1.2.0 since the initial release, causing Claude Code's plugin cache to serve stale content. This updates the version to 1.4.1 and adds guardrails to prevent future drift: - Bump plugin.json version from 1.2.0 to 1.4.1 - Add scripts/release.sh for one-command version bump + tag + push - Add CI step in release.yml to verify tag matches plugin.json Closes affaan-m#170
📝 WalkthroughWalkthroughBumps Changes
Sequence DiagramsequenceDiagram
actor Developer
participant ReleaseScript as "scripts/release.sh"
participant PluginFile as ".claude-plugin/plugin.json"
participant Git as "git / origin"
participant CI as "GitHub Actions"
Developer->>ReleaseScript: ./scripts/release.sh v1.4.1
ReleaseScript->>ReleaseScript: Validate semver, branch (main), clean tree
ReleaseScript->>PluginFile: Read current version
ReleaseScript->>PluginFile: Replace \"version\" -> 1.4.1
ReleaseScript->>Git: git add/commit & tag v1.4.1
ReleaseScript->>Git: push origin main & push tag
Git->>CI: push triggers release workflow
CI->>Git: Read tag (v1.4.1) -> TAG_VERSION
CI->>PluginFile: Read plugin.json version -> PLUGIN_VERSION
CI->>CI: Compare TAG_VERSION vs PLUGIN_VERSION
alt match
CI->>CI: Proceed with changelog & publish
else mismatch
CI->>CI: Fail workflow with error
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@scripts/release.sh`:
- Line 49: The grep pattern used to extract OLD_VERSION uses GNU-only '\+' in
basic regex and fails on BSD grep; update the extraction command that builds
OLD_VERSION to use extended regex (grep -oE) or a POSIX-compatible BRE so it
works on macOS—specifically change the invocation that references OLD_VERSION
and PLUGIN_JSON to use grep -oE with an ERE like '"version":
*"([0-9]+\.[0-9]+\.[0-9]+)"' (and capture/extract the numeric group) or adjust
the BRE to avoid '\+' so the version string is reliably extracted.
🧹 Nitpick comments (2)
scripts/release.sh (1)
61-65: No guard against an already-existing tag.If
v$VERSIONalready exists locally or on the remote,git tagwill fail with an unhelpful message. Consider checking first and providing a clear error.Proposed improvement
+# Check if tag already exists +if git rev-parse "v$VERSION" >/dev/null 2>&1; then + echo "Error: Tag v$VERSION already exists" + exit 1 +fi + # Stage, commit, tag, and push git add "$PLUGIN_JSON" git commit -m "chore: bump plugin version to $VERSION" git tag "v$VERSION".github/workflows/release.yml (1)
33-33: Version extraction regex is looser than the one inrelease.sh.
[0-9][0-9.]*could match malformed versions like1..2or1.2.3.4. For consistency with the release script's strict semver extraction, use a tighter pattern:Proposed fix
- PLUGIN_VERSION=$(grep -o '"version": *"[^"]*"' .claude-plugin/plugin.json | grep -o '[0-9][0-9.]*') + PLUGIN_VERSION=$(grep -oE '"version": *"[^"]*"' .claude-plugin/plugin.json | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')
Fixes pre-existing ESLint no-unused-vars error that was causing CI lint failures on main.
CI Lint NoteThe Lint check failure is not caused by this PR. All failing checks are pre-existing issues on
None of these files are touched by this PR. The errors were previously hidden because an ESLint error in |
BSD grep on macOS does not support \+ in BRE mode, causing silent match failure. Switch to grep -oE (extended regex) for cross-platform compatibility. Also unify the regex pattern between release.sh and release.yml to strictly match X.Y.Z format.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: checks are failing. Please fix failures before review.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: checks are failing. Please fix failures before review.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: checks are failing. Please fix failures before review.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: checks are failing. Please fix failures before review.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: checks are failing. Please fix failures before review.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: checks are failing. Please fix failures before review.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: checks are failing. Please fix failures before review.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: checks are failing. Please fix failures before review.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: checks are failing. Please fix failures before review.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: checks are failing. Please fix failures before review.
Sync plugin.json version to 1.4.1, add CI check to verify versions match on release, and add release.sh script. Fixes affaan-m#170.
在 README 最頂部插入 fork banner,明確標示: - 本 fork 的主要貢獻在 upstream affaan-m/ECC 的 PR affaan-m#161 + affaan-m#171(已 merged) - 貢獻為 spec-driven 產出(specs by me, implementation via Claude Code, reviewed and submitted by me) - 上游 maintainer merge = 最強的 external code review signal - 保留原 upstream README 不動 目的:讓 GitHub profile 點進 fork 的 reviewer 第一眼看到 PR signal,避免誤判為「0 commit fork」。 Co-authored-by: EricCaiCai <278623129+EricCaiCai@users.noreply.github.com>
Sync plugin.json version to 1.4.1, add CI check to verify versions match on release, and add release.sh script. Fixes affaan-m#170.
Summary
plugin.jsonversion from1.2.0to1.4.1to match the latest git tagscripts/release.sh— one-command release flow: validates semver format, checks clean working tree and main branch, then bumps version → commits → tags → pushesrelease.yml— verifies the tag version matchesplugin.jsonbefore creating a GitHub Release; fails with actionable guidance if they driftContext
plugin.jsonversion has been stuck at1.2.0since the initial release, while the actual release is1.4.1. Although cached content is updated correctly via Git, the mismatched version creates inconsistent metadata in the cache path (~/.claude/plugins/cache/.../1.2.0/) and could cause issues with future cache invalidation logic.Root cause: the release workflow only validates tag format but never checks
plugin.json, and there was no script to keep them in sync.Closes #170
Test plan
bash -n scripts/release.sh— syntax validplugin.jsonversion is1.4.1release.shhas executable permission (-rwxr-xr-x)release.shmatches grep regex inrelease.ymlv$VERSION) consistent between script and workflow