Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pkg/version/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ var (
minPDVersion = semver.New("7.5.0-alpha")
// maxPDVersion is the version of the maximum compatible PD.
// Compatible versions are in [minPDVersion, maxPDVersion)
maxPDVersion = semver.New("15.0.0")
maxPDVersion = semver.New("9999.0.0")

// MinTiKVVersion is the version of the minimal compatible TiKV.
// The min version should be 7.5 for new arch.
MinTiKVVersion = semver.New("7.5.0-alpha")
// maxTiKVVersion is the version of the maximum compatible TiKV.
// Compatible versions are in [MinTiKVVersion, maxTiKVVersion)
maxTiKVVersion = semver.New("15.0.0")
maxTiKVVersion = semver.New("9999.0.0")
Comment on lines 43 to +52
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The comments on lines 44 and 51, which describe the compatible version range as [min, max), are now misleading since this change effectively removes the upper bound. Please update them to clarify that no upper version limit is enforced.

Additionally, using the literal "9999.0.0" is using a magic number. It would be more maintainable and readable to define this as a constant with a descriptive name (e.g., unboundedMaxVersion) and use that constant here.


// New Arch Starts From 9.0.0,
// we use the minimal release version as default.
Expand All @@ -59,7 +59,7 @@ var (
MinTiCDCVersion = semver.New("7.5.0-alpha")
// MaxTiCDCVersion is the version of the maximum allowed TiCDC version.
// for version `x.y.z`, max allowed `x+2.0.0`
MaxTiCDCVersion = semver.New("15.0.0-alpha")
MaxTiCDCVersion = semver.New("9999.0.0-alpha")
Comment on lines 60 to +62
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The comment on line 61 (// for version 'x.y.z', max allowed 'x+2.0.0') is now incorrect with this change and should be removed or updated. The logic it describes is no longer applicable.

Also, as with the other max version variables, consider defining "9999.0.0-alpha" as a named constant to avoid this magic string and improve clarity.

Comment on lines 60 to +62
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.

⚠️ Potential issue | 🟡 Minor

Update stale TiCDC max-version comment.

The comment still describes an x+2.0.0 policy, but the code now uses a sentinel bound (9999.0.0-alpha). Please align the comment with current behavior.

Proposed comment fix
-	// MaxTiCDCVersion is the version of the maximum allowed TiCDC version.
-	// for version `x.y.z`, max allowed `x+2.0.0`
+	// MaxTiCDCVersion is a sentinel upper bound to avoid rejecting newer upstream versions.
+	// Compatible versions are in [MinTiCDCVersion, MaxTiCDCVersion).
 	MaxTiCDCVersion = semver.New("9999.0.0-alpha")
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// MaxTiCDCVersion is the version of the maximum allowed TiCDC version.
// for version `x.y.z`, max allowed `x+2.0.0`
MaxTiCDCVersion = semver.New("15.0.0-alpha")
MaxTiCDCVersion = semver.New("9999.0.0-alpha")
// MaxTiCDCVersion is a sentinel upper bound to avoid rejecting newer upstream versions.
// Compatible versions are in [MinTiCDCVersion, MaxTiCDCVersion).
MaxTiCDCVersion = semver.New("9999.0.0-alpha")
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/version/check.go` around lines 60 - 62, Update the stale comment for
MaxTiCDCVersion to reflect the current sentinel bound behavior instead of the
old "x+2.0.0" policy: explain that MaxTiCDCVersion is a sentinel maximum TiCDC
version (set via semver.New("9999.0.0-alpha")) used to allow effectively
unlimited versions rather than computing x+2.0.0, and mention the semver.New
call (MaxTiCDCVersion) so readers can find the value being used.

)

var versionHash = regexp.MustCompile("-[0-9]+-g[0-9a-f]{7,}(-dev)?")
Expand Down
Loading