fix: make version scripts cross-platform and add validation#250
fix: make version scripts cross-platform and add validation#250marcusquinn merged 1 commit intomainfrom
Conversation
- Add sed_inplace() helper for macOS/Linux compatibility - Add validation after each file update in update_version_in_files() - Add error handling to abort release if file updates fail - Sync all version files to 2.92.2 (fixing current inconsistency) The root cause was sed -i '' syntax which only works on macOS. On Linux (GitHub Actions), this would fail silently, leaving files with stale versions while VERSION file was updated. Now the script: 1. Uses cross-platform sed via sed_inplace() 2. Validates each file was actually updated 3. Returns error if any file fails to update 4. Aborts release/bump if update_version_in_files() fails
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 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 |
Summary of ChangesHello @marcusquinn, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly improves the robustness and cross-platform compatibility of the project's version management scripts. By addressing Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
🔍 Code Quality Report�[0;35m[MONITOR]�[0m Code Review Monitoring Report �[0;34m[INFO]�[0m Latest Quality Status: �[0;34m[INFO]�[0m Recent monitoring activity: 📈 Current Quality Metrics
Generated on: Thu Jan 29 00:52:49 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
There was a problem hiding this comment.
Code Review
This pull request is a great improvement. It addresses a critical cross-platform compatibility issue with sed and significantly enhances the robustness of the versioning scripts by adding validation and centralized error handling. The introduction of the sed_inplace helper is a clean solution to the problem. The changes to sync all version files and handle update failures gracefully will prevent future inconsistencies and make the release process more reliable.
| sed_inplace() { | ||
| local pattern="$1" | ||
| local file="$2" | ||
| if [[ "$(uname)" == "Darwin" ]]; then | ||
| sed -i '' "$pattern" "$file" | ||
| else | ||
| sed -i "$pattern" "$file" | ||
| fi | ||
| return $? | ||
| } |
There was a problem hiding this comment.
This sed_inplace function is also defined in .agent/scripts/version-manager.sh. To avoid code duplication and improve maintainability, consider moving this and other shared helper functions (like the print_* functions) into a common script that can be sourced by both this script and version-manager.sh.
| if [[ -f "$REPO_ROOT/package.json" ]]; then | ||
| sed -i '' "s/\"version\": \"[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\"/\"version\": \"$new_version\"/" "$REPO_ROOT/package.json" | ||
| print_success "Updated package.json" | ||
| sed_inplace "s/\"version\": \"[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\"/\"version\": \"$new_version\"/" "$REPO_ROOT/package.json" |
There was a problem hiding this comment.
The regex used here is a bit brittle as it assumes a very specific format for the version line in package.json (e.g., the space after the colon). A more robust regex would be less sensitive to whitespace changes and different version string formats.
| sed_inplace "s/\"version\": \"[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\"/\"version\": \"$new_version\"/" "$REPO_ROOT/package.json" | |
| sed_inplace "s/\"version\": *\"[^\"]*\"/\"version\": \"$new_version\"/" "$REPO_ROOT/package.json" |
| # Update Claude Code plugin marketplace.json | ||
| if [[ -f "$REPO_ROOT/.claude-plugin/marketplace.json" ]]; then | ||
| sed -i '' "s/\"version\": \"[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\"/\"version\": \"$new_version\"/" "$REPO_ROOT/.claude-plugin/marketplace.json" | ||
| sed_inplace "s/\"version\": \"[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\"/\"version\": \"$new_version\"/" "$REPO_ROOT/.claude-plugin/marketplace.json" |
There was a problem hiding this comment.
Similar to the package.json update, this regex is a bit brittle. A more robust regex would be less sensitive to whitespace and version format.
| sed_inplace "s/\"version\": \"[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\"/\"version\": \"$new_version\"/" "$REPO_ROOT/.claude-plugin/marketplace.json" | |
| sed_inplace "s/\"version\": *\"[^\"]*\"/\"version\": \"$new_version\"/" "$REPO_ROOT/.claude-plugin/marketplace.json" |
🤖 Augment PR SummarySummary: This PR hardens the repo’s version bump/release scripts for cross-platform use and prevents partial version updates.
🤖 Was this summary useful? React with 👍 or 👎 |
| local pattern="$1" | ||
| local file="$2" | ||
| if [[ "$(uname)" == "Darwin" ]]; then | ||
| sed -i '' "$pattern" "$file" |
There was a problem hiding this comment.
sed_inplace() is a good start, but there are still direct sed -i '' ... calls later in this script (e.g., in the TODO auto-marking flow) that will still fail on GNU sed/Linux, so the cross-platform fix looks incomplete.
Other Locations
.agent/scripts/version-manager.sh:687.agent/scripts/version-manager.sh:690
🤖 Was this useful? React with 👍 or 👎
| return 1 | ||
| fi | ||
|
|
||
| print_success "All version files updated to $new_version" |
There was a problem hiding this comment.
This unconditional print_success adds another stdout line inside update_version_in_files(), which can break callers that capture version-manager.sh bump ... output as a version string (e.g., .agent/scripts/auto-version-bump.sh assigns new_version=$(...)).
Other Locations
.agent/scripts/auto-version-bump.sh:132.opencode/tool/version-manager.ts:10
🤖 Was this useful? React with 👍 or 👎
| print_success "Updated version badge in README.md to $new_version" | ||
| else | ||
| print_error "Failed to update version badge in README.md" | ||
| print_warning "README.md has no version badge (consider adding dynamic GitHub release badge)" |
Flagged for Human ReviewReason: PR #250 (t003.5: Cross-browser and device testing) has FAIL(4) CI status in a managed private repo. Worker was terminated mid-investigation with retries available. The task involves cross-browser testing which may need human guidance on test environment setup or Playwright config before re-dispatch. This issue has been flagged by the AI supervisor for human review. Please assess and take appropriate action. Flagged by AI Supervisor (automated reasoning cycle) |
Flagged for Human ReviewReason: PR #250 (t003.5) has 4 failing CI checks. This task has already been retried (worker_terminated_mid_investigation). The CI failures need human review to determine if the approach is viable or if the task spec needs revision before another dispatch attempt. This issue has been flagged by the AI supervisor for human review. Please assess and take appropriate action. Flagged by AI Supervisor (automated reasoning cycle) |
|
t003.5 has failed 2 consecutive dispatch attempts (both at opus tier) with
Recommendation: Review the CI failure logs on PR #250 before re-dispatching. The cross-browser testing scope may need to be narrowed or the CI environment may need configuration changes. Posted by AI Supervisor (automated reasoning cycle) |



Summary
sed_inplace()helper function for macOS/Linux compatibilityupdate_version_in_files()Root Cause
The version-manager.sh script used
sed -i ''syntax which only works on macOS. On Linux (GitHub Actions runners), GNU sed requiressed -iwithout the empty string argument. This caused file updates to fail silently, leaving files with stale versions while the VERSION file was updated.Changes
version-manager.sh
sed_inplace()helper that detects OS and uses correct sed syntaxbumpandreleaseactions to abort if updates failauto-version-bump.sh
sed_inplace()helper for consistencyupdate_version_badge()to use cross-platform sedVersion Files
Testing
validate-version-consistency.sh- all files now show 2.92.2shellcheckon modified scripts - no errorsversion-manager.sh validate- passesFixes
Resolves version inconsistency errors in GitHub Actions: