Skip to content

fix(publish): beta tags use PATCH+1 as base, fixing semver precedence - #1998

Merged
eonist merged 3 commits into
mainfrom
fix/1997-beta-semver-base
Jul 8, 2026
Merged

eonist merged 3 commits into
mainfrom
fix/1997-beta-semver-base

Conversation

@eonist

@eonist eonist commented Jul 8, 2026 •

Copy link
Copy Markdown
Member

Closes #1997

What changed

Beta tags now use PATCH+1 as their base instead of the current stable.

Before:

v0.7.2 ships → v0.7.2-beta.1, v0.7.2-beta.2, ...

v0.7.2-beta.1 < v0.7.2 by semver — betas are semver-older than stable. ❌

After:

v0.7.2 ships → v0.7.3-beta.1, v0.7.3-beta.2, ...

v0.7.3-beta.1 > v0.7.2 by semver — betas are semver-newer than stable. ✅

Why

Per the semver spec §9, a pre-release version has lower precedence than its associated normal version. Tagging betas against the already-shipped stable base means UpdateChecker (and any semver-aware tool) treats them as older than stable and never offers them as updates.

Gating stable users from receiving betas is handled by the update channel preference in UpdateChecker, not by semver precedence — so there is no regression there.

Notes

  • The rollover logic (PATCH > 9 → bump MINOR) is shared and unchanged.
  • The NEXT_BASE variable is now computed once and reused by both the beta and stable branches, removing duplication.
  • The large suppression comment block in the old code (explaining why the "wrong" base was intentional) has been replaced with a comment explaining why the correct approach is correct.

Summary by cubic

Fixes beta tag precedence by basing betas on PATCH+1 of the latest stable so semver-aware tools (including UpdateChecker) surface them correctly. Updates releasing docs and workflow comments to match the new scheme and examples.

  • Bug Fixes

    • Beta tags now use PATCH+1 of the latest stable as their base (e.g., v0.7.2 → v0.7.3-beta.1).
    • Beta availability stays gated by the update channel in UpdateChecker; only precedence changes.
  • Refactors

    • Compute NEXT_BASE once and reuse for both channels; removed duplicate rollover code.
    • Updated docs/releasing.md and workflow comments to reflect the PATCH+1 beta base, including a note that the HIGHEST_N counter resets when the beta base (NEXT_BASE) changes.

Written for commit 6dbcb2f. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Bug Fixes
    • Adjusted beta release versioning so beta tags now branch from the next patch version, with rollover handled consistently.
    • Updated release tagging behavior so release builds continue to use the new patch-based version format.
  • Documentation
    • Updated the releasing guide to reflect the revised beta vs stable tagging rules and corrected examples, including dry-run checks.

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@sourcery-ai sourcery-ai 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.

Sorry @eonist, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@github-actions

github-actions Bot commented Jul 8, 2026 •

Copy link
Copy Markdown
Contributor

🐙 Octopus Review — PR #1998

Summary

This PR reverses a previously documented design decision: beta tags now use PATCH+1 as their base (e.g. v0.7.3-beta.1 when stable is v0.7.2), rather than sharing the current stable base. The rationale is correct per semver §9 — pre-releases of the same version have lower precedence than the release, so v0.7.2-beta.1 < v0.7.2. The change also refactors the rollover logic into a shared block, removes defensive comments that no longer apply, and updates docs accordingly.

Score

Category Score Notes
Security N/A No security-relevant changes
Code Quality 5/5 Clean refactor, shared rollover, clear naming
Performance N/A CI script only
Error Handling 4/5 Rollover logic solid; one edge case worth verifying
Consistency 4/5 Docs/script/example values all updated together
Overall 4/5 Minor edge case on first-ever beta run

Risk Assessment

Metric Value
Overall Risk 🟡 Medium
Complexity Low
Test Coverage Impact Needs Attention
Breaking Change Yes — existing beta tag sequences restart under new base

Positive Highlights

  1. Correct semver reasoning. The old scheme produced v0.7.0-beta.1 < v0.7.0, making betas semver-older than the stable they followed. The fix is technically correct and the comment explaining why is genuinely useful.

  2. Shared rollover block. Extracting the PATCH+1/rollover logic into a single block before the if/else eliminates the duplication that existed in the old script and makes both channels use the same arithmetic — a clear improvement.

  3. Documentation kept in sync. The docs/releasing.md update mirrors every changed assumption, including the worked example and the semver spec citation. This is exactly the right level of care for a CI/release script change.


Important Files Changed

Filename Overview
.github/workflows/publish.yml Rollover computation moved above the if/else; beta channel now uses NEXT_BASE (PATCH+1) instead of the current stable base; step name simplified.
docs/releasing.md Tag format table, version-scheme description, beta sequence explanation, and dry-run example all updated to reflect the new PATCH+1 base.

Diagram

stateDiagram-v2
    [*] --> StableShips: stable release

    state "Old scheme" as Old {
        [*] --> OldBeta: v0.7.0 ships
        OldBeta --> OldBeta2: v0.7.0-beta.1 (semver OLDER than v0.7.0)
        OldBeta2 --> OldStable: v0.7.1 ships
    }

    state "New scheme - this PR" as New {
        [*] --> NewBeta: v0.7.2 ships
        NewBeta --> NewBeta2: v0.7.3-beta.1 (semver NEWER than v0.7.2)
        NewBeta2 --> NewStable: v0.7.3 ships
    }

    StableShips --> Old
    StableShips --> New
Loading

Last reviewed commit: 3e429ef5c

Checklist

  • No hardcoded secrets or credentials
  • Error handling is comprehensive
  • Naming is clear and consistent with codebase conventions
  • No unnecessary dependencies added
  • API changes are backward compatible (if applicable)
  • Edge case: first beta run after this change targets an empty NEXT_BASE tag namespace — verified correct (resets to beta.1)
  • Breaking change acknowledged: in-flight beta sequences under the old base are implicitly abandoned

Reviewed by Octopus

@deepsource-io

deepsource-io Bot commented Jul 8, 2026 •

Copy link
Copy Markdown

DeepSource Code Review

We reviewed changes in 7235a80...6dbcb2f on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
Shell Jul 8, 2026 11:16p.m. Review ↗
Swift Jul 8, 2026 11:16p.m. Review ↗
Secrets Jul 8, 2026 11:16p.m. Review ↗

Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

@coderabbitai

coderabbitai Bot commented Jul 8, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The publish workflow now computes beta tags from the next patch version instead of the current stable version, and the release documentation is updated to match the new beta and stable versioning rules.

Changes

Beta tagging base change

Layer / File(s) Summary
Workflow tag scheme docs
.github/workflows/publish.yml
Inline Compute next tag comments are rewritten to describe the next-patch beta scheme and semver precedence.
NEXT_BASE and tag output
.github/workflows/publish.yml
The workflow computes NEXT_BASE, lists existing v${NEXT_BASE}-beta.* tags for beta numbering, and emits beta or stable tag/version outputs from that base.
Release documentation updates
docs/releasing.md
The release guide updates the beta channel format, versioning example, beta sequence rules, stable promotion wording, and dry-run tag samples to match the new behavior.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • runbot-hq/run-bot#1884: Modifies the same publish workflow tag computation and beta version derivation logic.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The workflow now computes beta tags from the next patch base, matching the linked issue's expected behavior.
Out of Scope Changes check ✅ Passed The docs and comment updates support the tagging fix and do not introduce unrelated scope.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: beta tags now use PATCH+1 as the base to fix semver precedence.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/1997-beta-semver-base

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.

@github-actions github-actions 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.

🐙 Octopus posted 3 inline findings. See the pinned Octopus summary comment for the full review.

VERSION="${NEXT_BASE}"
fi

echo "channel=$CHANNEL" >> "$GITHUB_OUTPUT"

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.

🟡 Beta and stable now produce the same NEXT_BASE, creating a tag collision risk

Both channels now derive their version from the same NEXT_BASE (PATCH+1). If a beta series is cut from stable v0.7.2 (producing v0.7.3-beta.*) and then the stable channel is also triggered before v0.7.3 ships, the stable job will also emit v0.7.3. This is semantically correct per semver but means the two channels are now tightly coupled to the same patch counter. More concretely: if a hotfix stable release of v0.7.3 ships while betas are still in flight at v0.7.3-beta.N, the next beta run will compute NEXT_BASE=0.7.4 (because stable is now v0.7.3), silently jumping the beta series. This is likely acceptable, but the comment block no longer documents this interaction, which the old design explicitly called out.

Suggested change
echo "channel=$CHANNEL" >> "$GITHUB_OUTPUT"
# After NEXT_BASE is computed, add a guard:
if git tag --list "v${NEXT_BASE}" | grep -q "."; then
echo "::error::Tag v${NEXT_BASE} already exists as a stable release; cannot create beta on this base."
exit 1
fi
AI Fix Prompt
Fix the following Medium (Logic Error) issue in `.github/workflows/publish.yml` at lines 163-176:

Problem: Both channels now derive their version from the same `NEXT_BASE` (PATCH+1). If a beta series is cut from stable `v0.7.2` (producing `v0.7.3-beta.*`) and then the stable channel is also triggered before `v0.7.3` ships, the stable job will also emit `v0.7.3`. This is semantically correct per semver but means the two channels are now tightly coupled to the same patch counter. More concretely: if a hotfix stable release of `v0.7.3` ships while betas are still in flight at `v0.7.3-beta.N`, the next beta run will compute `NEXT_BASE=0.7.4` (because stable is now `v0.7.3`), silently jumping the beta series. This is likely acceptable, but the comment block no longer documents this interaction, which the old design explicitly called out.

Suggested fix:
# After NEXT_BASE is computed, add a guard:
if git tag --list "v${NEXT_BASE}" | grep -q "."; then
  echo "::error::Tag v${NEXT_BASE} already exists as a stable release; cannot create beta on this base."
  exit 1
fi

@@ -154,34 +166,11 @@ jobs:
else
NEXT_N=$(( HIGHEST_N + 1 ))
fi

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.

🟡 Existing v*.*.Z-beta.* tags on the old base scheme are silently orphaned

The HIGHEST_N lookup now searches v${NEXT_BASE}-beta.* instead of v${BASE}-beta.*. Any existing beta tags cut under the previous scheme (e.g. v0.7.2-beta.1 when stable was v0.7.2) will no longer be found by the increment logic. The next beta run will start at beta.1 even if v0.7.3-beta.5 already exists under the old naming. This is a one-time migration artifact, but it is silent — there is no warning or assertion.

Suggested change
fi
# At the start of the beta branch, warn if old-scheme tags exist:
OLD_BETA_COUNT=$(git tag --list "v${BASE}-beta.*" | wc -l | tr -d ' ')
if (( OLD_BETA_COUNT > 0 )); then
echo "::warning::Found ${OLD_BETA_COUNT} beta tag(s) under the old base v${BASE}-beta.* — these are now orphaned. Verify that the new base v${NEXT_BASE}-beta.* is intended."
fi
AI Fix Prompt
Fix the following Medium (Bug) issue in `.github/workflows/publish.yml` at lines 163-168:

Problem: The `HIGHEST_N` lookup now searches `v${NEXT_BASE}-beta.*` instead of `v${BASE}-beta.*`. Any existing beta tags cut under the previous scheme (e.g. `v0.7.2-beta.1` when stable was `v0.7.2`) will no longer be found by the increment logic. The next beta run will start at `beta.1` even if `v0.7.3-beta.5` already exists under the old naming. This is a one-time migration artifact, but it is silent — there is no warning or assertion.

Suggested fix:
# At the start of the beta branch, warn if old-scheme tags exist:
OLD_BETA_COUNT=$(git tag --list "v${BASE}-beta.*" | wc -l | tr -d ' ')
if (( OLD_BETA_COUNT > 0 )); then
  echo "::warning::Found ${OLD_BETA_COUNT} beta tag(s) under the old base v${BASE}-beta.* — these are now orphaned. Verify that the new base v${NEXT_BASE}-beta.* is intended."
fi

@@ -144,8 +135,29 @@ jobs:
BASE="${LATEST_STABLE#v}"
IFS='.' read -r MAJOR MINOR PATCH <<< "$BASE"

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.

🔵 Rollover threshold comment references docs/RELEASING.md but the file tree shows docs/releasing.md

The inline comment # rollover: intentional, see docs/RELEASING.md references an uppercase filename. The actual file in the repository is docs/releasing.md (lowercase). On case-sensitive filesystems this link is broken. It is a documentation-only issue, but it creates confusion for contributors following the reference.

Suggested change
if (( NEW_PATCH > 9 )); then # rollover: intentional, see docs/releasing.md
AI Fix Prompt
Fix the following Low (Style) issue in `.github/workflows/publish.yml` at line 137:

Problem: The inline comment `# rollover: intentional, see docs/RELEASING.md` references an uppercase filename. The actual file in the repository is `docs/releasing.md` (lowercase). On case-sensitive filesystems this link is broken. It is a documentation-only issue, but it creates confusion for contributors following the reference.

Suggested fix:
if (( NEW_PATCH > 9 )); then  # rollover: intentional, see docs/releasing.md

@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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/publish.yml:
- Around line 78-113: Update docs/releasing.md so its beta versioning guidance
matches the Compute next tag logic in publish.yml: describe betas as using the
next patch base (PATCH+1) rather than the current stable base, and align the
examples and wording with the new beta.N scheme so the release docs are
consistent with the workflow.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d33d6e5d-63e3-4cc7-97a4-f0ff58c77826

📥 Commits

Reviewing files that changed from the base of the PR and between 7235a80 and d2a26e5.

📒 Files selected for processing (1)
  • .github/workflows/publish.yml

Comment thread .github/workflows/publish.yml Resolved
@greptile-apps

greptile-apps Bot commented Jul 8, 2026 •

Copy link
Copy Markdown

Greptile Summary

This PR updates release tagging so beta builds use the next patch version as their semver base. The main changes are:

  • Compute NEXT_BASE once in publish.yml and reuse it for beta and stable tags.
  • Generate beta tags as vNEXT_BASE-beta.N so they sort after the current stable release.
  • Update release documentation and dry-run examples to match the new beta sequence.

Confidence Score: 5/5

Safe to merge with minimal risk.

The changed workflow computes the next version base consistently for both release channels, and the docs now describe the same behavior.

No files require special attention.

T-Rex T-Rex Logs

What T-Rex did

  • The contract validation run executed the legacy publish-tag computation, which produced v0.7.2-beta.10 and failed the semver-newer check against v0.7.2.
  • The workflow was re-run to extract a new beta tag for CHANNEL=beta, yielding v0.7.3-beta.1 with tags v0.7.2 and v0.7.2-beta.9, and the semver check v0.7.3-beta.1 > v0.7.2 passed.

View all artifacts

T-Rex Ran code and verified through T-Rex

Important Files Changed

Filename Overview
.github/workflows/publish.yml Refactors tag computation so both beta and stable releases share the same PATCH+1 base, with beta numbering scoped to the computed next base; no issues found.
docs/releasing.md Updates release documentation and dry-run examples to describe the PATCH+1 beta base and promotion behavior; no issues found.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant Maintainer
participant Workflow as publish.yml
participant Git as Git tags
participant Release as GitHub Release

Maintainer->>Workflow: Run publish with channel
Workflow->>Git: Read latest stable vX.Y.Z
Workflow->>Workflow: "Compute NEXT_BASE = X.Y.(Z+1) with rollover"
alt beta channel
    Workflow->>Git: "Scan vNEXT_BASE-beta.* tags"
    Workflow->>Workflow: Increment beta.N
    Workflow->>Release: Create prerelease vNEXT_BASE-beta.N
else release channel
    Workflow->>Release: Create stable release vNEXT_BASE
end
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant Maintainer
participant Workflow as publish.yml
participant Git as Git tags
participant Release as GitHub Release

Maintainer->>Workflow: Run publish with channel
Workflow->>Git: Read latest stable vX.Y.Z
Workflow->>Workflow: "Compute NEXT_BASE = X.Y.(Z+1) with rollover"
alt beta channel
    Workflow->>Git: "Scan vNEXT_BASE-beta.* tags"
    Workflow->>Workflow: Increment beta.N
    Workflow->>Release: Create prerelease vNEXT_BASE-beta.N
else release channel
    Workflow->>Release: Create stable release vNEXT_BASE
end
Loading

Reviews (3): Last reviewed commit: "docs(publish): add comment clarifying HI..." | Re-trigger Greptile

Comment on lines +104 to 107
# 3. Beta: compute BETA_BASE = MAJOR.MINOR.(PATCH+1), find the highest
# existing beta.N for that base and increment N
# (or start at beta.1 if none exist).
# 4. Stable: bump PATCH by 1 (with rollover at 10).

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 Update release docs
docs/releasing.md is still the release process source of truth and still says beta tags share the current stable base (v0.7.0-beta.1 → v0.7.1 stable). After this workflow change, following the docs gives maintainers the opposite beta-versioning model from CI, so the release documentation should be updated in the same PR.

Context Used: AGENTS.md (source)

Prompt To Fix With AI
This is a comment left during a code review.
Path: .github/workflows/publish.yml
Line: 104-107

Comment:
**Update release docs**
`docs/releasing.md` is still the release process source of truth and still says beta tags share the current stable base (`v0.7.0-beta.1` → `v0.7.1` stable). After this workflow change, following the docs gives maintainers the opposite beta-versioning model from CI, so the release documentation should be updated in the same PR.

**Context Used:** AGENTS.md ([source](https://app.greptile.com/eonist/github/eoncode/run-bot/-/custom-context?memory=02ac88f9-f20e-46ce-9bbb-decad86e51e4))

How can I resolve this? If you propose a fix, please make it concise.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@cubic-dev-ai cubic-dev-ai 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.

1 issue found across 1 file

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name=".github/workflows/publish.yml">

<violation number="1" location=".github/workflows/publish.yml:79">
P2: The workflow comment block and the rollover-logic reference both cite `docs/RELEASING.md` as the project's release-process source of truth, but that file still documents the old beta-tagging model (betas share the current stable base). With this change shipping PATCH+1 as the beta base, the documentation will actively contradict CI behavior — consider updating `docs/RELEASING.md` in this PR to keep them in sync.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

# Tag scheme:
# beta channel → vMAJOR.MINOR.PATCH-beta.N (e.g. v0.7.0-beta.1)
# release channel → vMAJOR.MINOR.PATCH (e.g. v0.7.1)
# beta channel → vMAJOR.MINOR.(PATCH+1)-beta.N (e.g. v0.7.3-beta.1)

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: The workflow comment block and the rollover-logic reference both cite docs/RELEASING.md as the project's release-process source of truth, but that file still documents the old beta-tagging model (betas share the current stable base). With this change shipping PATCH+1 as the beta base, the documentation will actively contradict CI behavior — consider updating docs/RELEASING.md in this PR to keep them in sync.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/publish.yml, line 79:

<comment>The workflow comment block and the rollover-logic reference both cite `docs/RELEASING.md` as the project's release-process source of truth, but that file still documents the old beta-tagging model (betas share the current stable base). With this change shipping PATCH+1 as the beta base, the documentation will actively contradict CI behavior — consider updating `docs/RELEASING.md` in this PR to keep them in sync.</comment>

<file context>
@@ -75,51 +75,42 @@ jobs:
       # Tag scheme:
-      #   beta channel    → vMAJOR.MINOR.PATCH-beta.N   (e.g. v0.7.0-beta.1)
-      #   release channel → vMAJOR.MINOR.PATCH           (e.g. v0.7.1)
+      #   beta channel    → vMAJOR.MINOR.(PATCH+1)-beta.N   (e.g. v0.7.3-beta.1)
+      #   release channel → vMAJOR.MINOR.PATCH              (e.g. v0.7.3)
+      #
</file context>

@github-actions github-actions 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.

🐙 Octopus posted 1 inline finding. See the pinned Octopus summary comment for the full review.

NEW_PATCH=0
NEW_MINOR=$(( MINOR + 1 ))
if (( NEW_MINOR > 9 )); then # rollover: intentional
NEW_MINOR=0

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.

💡 Rollover threshold > 9 is less readable than >= 10

The rollover condition uses (( NEW_PATCH > 9 )) and (( NEW_MINOR > 9 )). The intent is to roll over when a component reaches 10 (since single-digit is the project convention). Writing >= 10 makes the invariant — 'components stay single-digit' — immediately legible without mental subtraction.

Suggested change
NEW_MINOR=0
if (( NEW_PATCH >= 10 )); then # rollover: intentional, see docs/releasing.md
NEW_PATCH=0
NEW_MINOR=$(( MINOR + 1 ))
if (( NEW_MINOR >= 10 )); then # rollover: intentional
NEW_MINOR=0
NEW_MAJOR=$(( MAJOR + 1 ))
else
NEW_MAJOR=$MAJOR
fi
AI Fix Prompt
Fix the following Nit (Style) issue in `.github/workflows/publish.yml` at lines 138-144:

Problem: The rollover condition uses `(( NEW_PATCH > 9 ))` and `(( NEW_MINOR > 9 ))`. The intent is to roll over when a component reaches 10 (since single-digit is the project convention). Writing `>= 10` makes the invariant — 'components stay single-digit' — immediately legible without mental subtraction.

Suggested fix:
if (( NEW_PATCH >= 10 )); then  # rollover: intentional, see docs/releasing.md
  NEW_PATCH=0
  NEW_MINOR=$(( MINOR + 1 ))
  if (( NEW_MINOR >= 10 )); then  # rollover: intentional
    NEW_MINOR=0
    NEW_MAJOR=$(( MAJOR + 1 ))
  else
    NEW_MAJOR=$MAJOR
  fi

@sonarqubecloud

sonarqubecloud Bot commented Jul 8, 2026

Copy link
Copy Markdown

@eonist
eonist merged commit beeeeb6 into main Jul 8, 2026
13 checks passed
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.

fix: beta tags should use next PATCH as base, not current stable

1 participant