Skip to content

fix(ci): add VERSION_OVERRIDE to check-versions - #764

Merged
slin1237 merged 2 commits into
mainfrom
slin/fix-v-check
Mar 15, 2026
Merged

slin1237 merged 2 commits into
mainfrom
slin/fix-v-check

Conversation

@slin1237

@slin1237 slin1237 commented Mar 15, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Adds VERSION_OVERRIDE parameter to make check-versions that bypasses conventional commit detection and uses the specified version for all bumps
  • Fixes the case where feat: commits trigger a minor bump (e.g., 1.3.0 → 1.4.0) when only a patch bump is warranted (1.3.0 → 1.3.1)

What changed

  • Makefile: check-versions target accepts VERSION_OVERRIDE, exports it as env var to the script
  • scripts/check_release_versions.sh:
    • bump_version() returns the override when VERSION_OVERRIDE is set, skipping level-based computation
    • Displays override notice in output header for visibility

Usage

# Auto-detect bump level from conventional commits (existing behavior)
make check-versions

# Override bump level — use 1.3.1 for all bumps regardless of commit types
make check-versions VERSION_OVERRIDE=1.3.1

Test plan

  • make check-versions without override behaves as before (auto-detect from commits)
  • make check-versions VERSION_OVERRIDE=1.3.1 proposes 1.3.1 for all unbumped crates
  • Applying the fix with override correctly updates all version files and sync targets

Summary by CodeRabbit

  • Chores
    • Enhanced release version-checking tooling to always run checks and support an optional version-override parameter. The override is validated for proper semantic format (X.Y.Z), initialized safely, and when used the tool reports the override and applies it to version bumps instead of automatic detection.

…ntrol

When commits use `feat:` conventional prefix but the changes are minor
(e.g., small additions to existing features), the auto-detected bump
level can be too aggressive (minor instead of patch). This adds a
VERSION_OVERRIDE parameter that bypasses conventional commit detection
and uses the specified version for all bumps.

What changed:
- Makefile: check-versions target accepts VERSION_OVERRIDE parameter,
  passes it as an environment variable to the script
- scripts/check_release_versions.sh: bump_version() returns the
  override when VERSION_OVERRIDE is set, skipping level-based
  computation. Displays override notice in output header.

Usage: make check-versions VERSION_OVERRIDE=1.3.1

Signed-off-by: Simo Lin <linsimo.mark@gmail.com>
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 enhances the version checking process within the CI pipeline by introducing a VERSION_OVERRIDE mechanism. This allows for explicit control over the next release version, which is crucial for scenarios where automatic conventional commit detection might lead to incorrect or undesired version increments. The changes also directly address and fix a bug that caused feature commits to trigger minor rather than patch version bumps, ensuring more accurate and flexible version management for releases.

Highlights

  • Version Override Parameter: Introduced a VERSION_OVERRIDE parameter to the make check-versions command, allowing manual specification of the next version to be used for all bumps, bypassing conventional commit detection.
  • Bug Fix for Version Bumping: Resolved an issue where feat: conventional commits incorrectly triggered minor version bumps (e.g., 1.3.0 → 1.4.0) when only a patch bump (1.3.0 → 1.3.1) was warranted.
  • Makefile Updates: Modified the Makefile to correctly accept and export the VERSION_OVERRIDE environment variable to the version checking script.
  • Script Logic Enhancement: Updated the scripts/check_release_versions.sh script to prioritize VERSION_OVERRIDE for version calculation within the bump_version function and to display a clear notice when an override is active.
Changelog
  • Makefile
    • Updated the check-versions target to accept an optional VERSION_OVERRIDE parameter.
    • Modified the check-versions target to export the VERSION_OVERRIDE value as an environment variable for the script.
  • scripts/check_release_versions.sh
    • Added a conditional display message to indicate when VERSION_OVERRIDE is active in the output header.
    • Initialized the VERSION_OVERRIDE shell variable.
    • Modified the bump_version function to return the value of VERSION_OVERRIDE if it is set, effectively bypassing the conventional commit-based bump logic.
Activity
  • No specific activity (comments, reviews, or progress updates) has been recorded for this pull request yet.
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. ↩

@coderabbitai

coderabbitai Bot commented Mar 15, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 7a2aabbb-ecd0-4d93-af41-6961b13ddcef

📥 Commits

Reviewing files that changed from the base of the PR and between 028cfb0 and bee4fd6.

📒 Files selected for processing (2)
  • Makefile
  • scripts/check_release_versions.sh

📝 Walkthrough

Walkthrough

Makefile's check-versions target now accepts an optional VERSION_OVERRIDE environment variable and always invokes ./scripts/check_release_versions.sh $(TAG). The script gains a VERSION_OVERRIDE variable, validates its X.Y.Z format, and uses it to force bumped versions when provided.

Changes

Cohort / File(s) Summary
Makefile target
Makefile
Updated check-versions usage string and invocation: always calls ./scripts/check_release_versions.sh $(TAG) and supports VERSION_OVERRIDE passed via environment.
Version check script
scripts/check_release_versions.sh
Added VERSION_OVERRIDE initialization, format validation (X.Y.Z), notice printing, and logic to return/use the override for all bumps instead of conventional-commit detection when set.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • CatherineSue

Poem

🐰 With twitching nose and tidy paws, I hop to say hello,
A version line I gently cross and tell the script to go.
If bumps are shy and hides away, an override I bring —
X.Y.Z, a single string, and all the versions sing! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding a VERSION_OVERRIDE parameter to the check-versions workflow in the Makefile and associated scripts.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch slin/fix-v-check
📝 Coding Plan
  • Generate coding plan for human review comments

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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 028cfb0dcd

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread scripts/check_release_versions.sh

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

Copy link
Copy Markdown
Contributor

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 introduces a VERSION_OVERRIDE feature to the check-versions script, allowing manual control over version bumps. The implementation is mostly correct, but I've identified a couple of areas for improvement. In the Makefile, the script invocation can be significantly simplified for better readability and maintainability. More critically, the check_release_versions.sh script is missing validation for the VERSION_OVERRIDE input, which could lead to corrupted version files if an invalid format is provided. This aligns with our rule on ensuring accurate external resource versions to prevent build failures. My review includes suggestions to address both of these points.

Comment thread scripts/check_release_versions.sh Outdated
Comment thread Makefile Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@scripts/check_release_versions.sh`:
- Around line 229-237: The bump_version function currently returns
VERSION_OVERRIDE without validation; modify bump_version to validate
VERSION_OVERRIDE against a semantic version regex before echoing it. In the
bump_version function, when VERSION_OVERRIDE is non-empty, check it matches a
semver pattern (e.g., MAJOR.MINOR.PATCH with optional pre-release/build if your
project allows) and if valid echo it, otherwise fail early (non-zero exit or
error message via echo/stderr) so invalid values are rejected; reference the
bump_version function and the VERSION_OVERRIDE variable when implementing this
check.
- Around line 126-128: The script reads VERSION_OVERRIDE (in the if [[ -n
"$VERSION_OVERRIDE" ]] block) before it's defined, which breaks under set -u;
move the initialization VERSION_OVERRIDE="${VERSION_OVERRIDE:-}" so it runs
before that if check (i.e., initialize VERSION_OVERRIDE early in the script or
at least before the conditional that echoes the override) to ensure the variable
is always defined when referenced.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: de051a04-7532-4387-97d6-b95d2d969f93

📥 Commits

Reviewing files that changed from the base of the PR and between 52a8db4 and 028cfb0.

📒 Files selected for processing (2)
  • Makefile
  • scripts/check_release_versions.sh

Comment thread scripts/check_release_versions.sh
Comment thread scripts/check_release_versions.sh
What changed:
- scripts/check_release_versions.sh: move VERSION_OVERRIDE initialization
  before first use (fixes unbound variable error under set -u), add X.Y.Z
  format validation to reject invalid version strings
- Makefile: simplify check-versions target to single line by passing
  VERSION_OVERRIDE as env var and TAG as positional arg directly

Signed-off-by: Simo Lin <linsimo.mark@gmail.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bee4fd6d6f

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread Makefile
./scripts/check_release_versions.sh; \
fi
check-versions: ## Check workspace crate versions against latest tag (usage: make check-versions [TAG=v1.0.0] [VERSION_OVERRIDE=1.3.1])
@VERSION_OVERRIDE="$(VERSION_OVERRIDE)" ./scripts/check_release_versions.sh $(TAG)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Quote TAG when invoking version-check script

The new check-versions recipe passes $(TAG) to the shell unquoted, so any shell metacharacters in the value are interpreted by /bin/sh instead of being treated as a single tag argument. This is a regression from the previous implementation, which quoted "$(TAG)"; for example, make check-versions TAG='release; echo injected' runs an extra command and does not validate the intended tag.

Useful? React with 👍 / 👎.

@slin1237
slin1237 merged commit 622c01c into main Mar 15, 2026
25 checks passed
@slin1237
slin1237 deleted the slin/fix-v-check branch March 15, 2026 02:40
smfirmin pushed a commit to smfirmin/smg that referenced this pull request Mar 20, 2026
Signed-off-by: Simo Lin <linsimo.mark@gmail.com>
smfirmin pushed a commit to smfirmin/smg that referenced this pull request Mar 20, 2026
Signed-off-by: Simo Lin <linsimo.mark@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant