Skip to content

fix: Reject beta versions older than the latest beta tag - #45

Closed
davseve wants to merge 2 commits into
mainfrom
fix/ED-24452-reject-older-beta-versions
Closed

fix: Reject beta versions older than the latest beta tag#45
davseve wants to merge 2 commits into
mainfrom
fix/ED-24452-reject-older-beta-versions

Conversation

@davseve

@davseve davseve commented Aug 4, 2026

Copy link
Copy Markdown
Member

Summary

  • validateNextBeta accepted any *-beta1 on a different version line, including regressions like 4.1.0-beta1 after latest 4.2.0-beta2.
  • Require semver.gt(candidate, latestBeta) before the existing same-line / beta1 sequencing checks.
  • Add regression coverage for older version lines and same-or-older betas on the latest line.

Test plan

  • npm test in actions/release-tag-creation (15 passed)
  • Re-run controlled-release dry-run with 4.1.0-beta1 when latest beta is 4.2.0-beta2 and confirm it fails with the new error
  • Confirm valid progressions still pass: 4.2.0-beta3, 4.3.0-beta1

Ref: ED-24452

Made with Cursor

✨ PR Description

1. Problem & Context

Beta version validation was allowing regressions by accepting older beta versions as valid. ED-24452 adds a version comparison guard to ensure new beta releases are always greater than the latest existing beta tag.

2. What Changed (Where)

  • current-version-validation.ts: Added upfront semver.gt() check rejecting any beta version not greater than latest beta tag
  • current-version-validation.test.ts: Updated error message expectations and added regression test for older version line scenario

3. How It Works

The new validation runs first in validateNextBeta(), comparing the proposed version n against the latest beta l using semver. If n is not strictly greater, it fails immediately with a clear message before attempting subsequent beta number/line validations. This prevents acceptance of versions like 4.1.0-beta1 when 4.2.0-beta2 exists.

4. Risks

None identified. Change is defensive and properly tested with explicit regression case.

Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using.
💡 Tip: You can customize your AI Description using Guidelines Learn how

validateNextBeta only required beta1 on a new version line, so a
regression like 4.1.0-beta1 after 4.2.0-beta2 was accepted. Require
semver.gt against the latest beta tag before the sequencing checks.

Ref: ED-24452
Co-authored-by: Cursor <cursoragent@cursor.com>
@davseve
davseve requested a review from Copilot August 6, 2026 06:59
@davseve davseve changed the title fix: Reject beta versions older than the latest beta tag fix: Reject beta versions older than the latest beta tag [ED-25178] Aug 6, 2026
@davseve davseve closed this Aug 6, 2026
@davseve

davseve commented Aug 6, 2026

Copy link
Copy Markdown
Member Author

We added this functionality already

@davseve davseve changed the title fix: Reject beta versions older than the latest beta tag [ED-25178] fix: Reject beta versions older than the latest beta tag Aug 6, 2026

Copilot AI 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.

Pull request overview

This PR tightens beta tag progression validation in the release-tag-creation action by ensuring a candidate beta version is strictly greater than the latest published beta tag before applying existing same-line sequencing and next-line rules.

Changes:

  • Add an early guard in validateNextBeta to reject candidate versions that are not > latestBeta.
  • Update/add unit test expectations to cover same-or-older betas and older version-line regressions.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
actions/release-tag-creation/current-version-validation.ts Adds a semver.gt(candidate, latestBeta) guard to prevent cross-version beta regressions from being accepted.
actions/release-tag-creation/current-version-validation.test.ts Adjusts/adds beta validation test cases to assert the new “must be greater than the latest beta tag” behavior.
Suppressed comments (1)

actions/release-tag-creation/current-version-validation.test.ts:116

  • With the new semver.gt guard, older version-line candidates (like 4.1.0-beta1) now throw the new "must be greater than the latest beta tag" error. There is an existing earlier table entry for 4.1.0-beta1 that still expects the old "Expected next beta line..." message, which will make the suite fail unless updated.
			'4.1.0-beta1',
			false,
			'must be greater than the latest beta tag 4.2.0-beta2',
		],

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +109 to +116
// beta — older version line must be rejected (regression)
[
'beta',
['4.2.0-beta1', '4.2.0-beta2'],
'4.1.0-beta1',
false,
'must be greater than the latest beta tag 4.2.0-beta2',
],
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants