Skip to content

fix: make version scripts cross-platform and add validation#250

Merged
marcusquinn merged 1 commit intomainfrom
bugfix/bugfix-version-script-github-actions
Jan 29, 2026
Merged

fix: make version scripts cross-platform and add validation#250
marcusquinn merged 1 commit intomainfrom
bugfix/bugfix-version-script-github-actions

Conversation

@marcusquinn
Copy link
Owner

Summary

  • Add sed_inplace() helper function 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)

Root Cause

The version-manager.sh script used sed -i '' syntax which only works on macOS. On Linux (GitHub Actions runners), GNU sed requires sed -i without 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

  • Added sed_inplace() helper that detects OS and uses correct sed syntax
  • Added validation after each file update to verify the change was applied
  • Added error counting and returns failure if any file fails to update
  • Added error handling in bump and release actions to abort if updates fail

auto-version-bump.sh

  • Added same sed_inplace() helper for consistency
  • Updated update_version_badge() to use cross-platform sed

Version Files

  • Synced all version files to 2.92.2:
    • package.json
    • sonar-project.properties
    • setup.sh
    • aidevops.sh
    • .claude-plugin/marketplace.json

Testing

  • Ran validate-version-consistency.sh - all files now show 2.92.2
  • Ran shellcheck on modified scripts - no errors
  • Ran version-manager.sh validate - passes

Fixes

Resolves version inconsistency errors in GitHub Actions:

  • Version Validation workflow failure
  • Postflight Verification workflow failure

- 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
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 29, 2026

Warning

Rate limit exceeded

@marcusquinn has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 4 minutes and 19 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link

Summary of Changes

Hello @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 sed syntax differences between operating systems and introducing comprehensive validation and error handling for version file updates, it ensures that version bumps are consistently and reliably applied across all environments, including CI/CD pipelines. This prevents silent failures and maintains version consistency across the codebase, resolving previous workflow failures related to version validation.

Highlights

  • Cross-platform sed compatibility: Introduced a sed_inplace() helper function to ensure sed -i commands work correctly on both macOS and Linux environments, resolving silent failures on GitHub Actions due to syntax differences.
  • Version file update validation: Added validation checks after each version file update to confirm the changes were successfully applied, enhancing the reliability of version bumping processes.
  • Robust error handling: Implemented error handling in version management scripts to abort release processes if any file updates fail, preventing inconsistent version states and providing clear error messages.
  • Version synchronization: All version-related files (e.g., package.json, sonar-project.properties, marketplace.json, aidevops.sh, setup.sh) have been synchronized to version 2.92.2 to fix previous inconsistencies.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@sonarqubecloud
Copy link

@github-actions
Copy link

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 486 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Thu Jan 29 00:51:23 UTC 2026: Code review monitoring started
Thu Jan 29 00:51:23 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 486
Thu Jan 29 00:51:23 UTC 2026: Qlty - 0 issues found, auto-formatting applied
Thu Jan 29 00:51:25 UTC 2026: Codacy analysis completed with auto-fixes

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 486
  • VULNERABILITIES: 0

Generated on: Thu Jan 29 00:52:49 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@marcusquinn marcusquinn merged commit 13e8731 into main Jan 29, 2026
9 checks passed
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +23 to +32
sed_inplace() {
local pattern="$1"
local file="$2"
if [[ "$(uname)" == "Darwin" ]]; then
sed -i '' "$pattern" "$file"
else
sed -i "$pattern" "$file"
fi
return $?
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
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"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
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"

@augmentcode
Copy link

augmentcode bot commented Jan 29, 2026

🤖 Augment PR Summary

Summary: This PR hardens the repo’s version bump/release scripts for cross-platform use and prevents partial version updates.
Changes:

  • Introduces a `sed_inplace()` helper in both `version-manager.sh` and `auto-version-bump.sh` to handle macOS (BSD sed) vs Linux (GNU sed) in-place edits.
  • Adds per-file validation + aggregated failure reporting in `update_version_in_files()` and aborts `bump`/`release` when updates don’t apply.
  • Improves README badge handling by skipping updates when a dynamic GitHub release badge is used.
Technical Notes: Aligns all tracked version sources to 2.92.2 to resolve existing CI/workflow inconsistencies.

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 3 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

local pattern="$1"
local file="$2"
if [[ "$(uname)" == "Darwin" ]]; then
sed -i '' "$pattern" "$file"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

return 1
fi

print_success "All version files updated to $new_version"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Fix This in Augment

🤖 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)"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After attempting the sed_inplace replacement, this warning can also trigger when the badge exists but the update failed/mismatched the pattern; the log message may be misleading during CI debugging.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

@marcusquinn marcusquinn deleted the bugfix/bugfix-version-script-github-actions branch February 21, 2026 01:59
@marcusquinn marcusquinn added the needs-review Flagged for human review by AI supervisor label Feb 25, 2026
@marcusquinn
Copy link
Owner Author

marcusquinn commented Feb 25, 2026

Flagged for Human Review

Reason: 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)

@marcusquinn
Copy link
Owner Author

Flagged for Human Review

Reason: 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)

@marcusquinn
Copy link
Owner Author

t003.5 has failed 2 consecutive dispatch attempts (both at opus tier) with worker_process_died_mid_task. PR #250 shows FAIL CI status with 3 failing checks. Root causes to investigate:

  1. Are the CI failures in the PR itself (test failures) or infrastructure issues?
  2. The worker dying mid-task suggests the task may be hitting resource limits or timeouts during cross-browser testing.

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-review Flagged for human review by AI supervisor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant