refactor bump version script - #36
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 10a4188. Configure here.
| require_file "${PHP_FILE}" | ||
| sed -i '' "s/^\( \* Version:[[:space:]]*\)$(escape_sed "${CURRENT}")/\1${VERSION}/" "${ROOT_DIR}/${PHP_FILE}" | ||
| sed -i '' "s/define( 'BLOCKPARTY_FAQ_VERSION', '$(escape_sed "${CURRENT}")' )/define( 'BLOCKPARTY_FAQ_VERSION', '${VERSION}' )/" "${ROOT_DIR}/${PHP_FILE}" | ||
| log_updated "${PHP_FILE}" |
There was a problem hiding this comment.
Silent success on missed replacements
Medium Severity
sed and awk updates no longer verify that a match was found. If the PHP header, define, Stable tag, or changelog markers differ slightly from what the patterns expect, those fields stay unchanged while the script still reports a successful bump and lists the files as updated. The previous Node script failed loudly via replaceOnce in these cases.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit 10a4188. Configure here.
|
|
||
| if grep -q "^= ${VERSION} - " "${ROOT_DIR}/${README_TXT}"; then | ||
| echo "Error: readme.txt already contains a changelog entry for ${VERSION}" >&2 | ||
| exit 1 |
There was a problem hiding this comment.
Guards run after partial writes
Medium Severity
Duplicate changelog and Upgrade Notice checks run only after JSON, lockfile, PHP, and Stable tag have already been rewritten. An explicit bump to a version that already appears in readme.txt history exits with an error but leaves those version fields updated, so the working tree ends up half-bumped.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 10a4188. Configure here.


Note
Low Risk
Developer-only release tooling with no runtime plugin behavior; main caveat is the script assumes macOS sed syntax, so Linux CI may need adjustment.
Overview
Replaces the Node-based version bump with a bash script under
bin/bump.sh, and wiresnpm run bumptobash bin/bump.shinstead ofnode scripts/bump-version.js.The new script keeps the same release workflow: semver from
patch/minor/majoror an explicitx.y.z, reading the current version from.plugin-data, then updating JSON versions,package-lock.json,blockparty-faq.php,readme.txtstubs, andCHANGELOG.md. It usessed/awkrather than parsing and rewriting JSON in Node, documents macOSsed -i '', and adds guards against duplicate changelog/upgrade entries for the target version.Packaging metadata now ignores
/bininstead of/scriptsin.distignoreand.gitattributes;scripts/bump-version.jsis removed.Reviewed by Cursor Bugbot for commit 10a4188. Bugbot is set up for automated code reviews on this repo. Configure here.