Skip to content

Conversation

@ghoshh
Copy link
Contributor

@ghoshh ghoshh commented Dec 17, 2025

What problem does this PR solve?

ref #2654

What is changed and how it works?

add a function to compare versions by splitting the version into integers to avoid the case like 8.4 > 8.10.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Code changes

  • Has exported function/method change
  • Has exported variable/fields change
  • Has interface methods change
  • Has persistent data change

Side effects

  • Possible performance regression
  • Increased code complexity
  • Breaking backward compatibility

Related changes

  • Need to cherry-pick to the release branch
  • Need to update the documentation

Release notes:

NONE

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Dec 17, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign bb7133 for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Dec 17, 2025

Welcome @ghoshh! It looks like this is your first PR to pingcap/tiup 🎉

@ti-chi-bot ti-chi-bot bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Dec 17, 2025
@pingcap-cla-assistant
Copy link

pingcap-cla-assistant bot commented Dec 17, 2025

CLA assistant check
All committers have signed the CLA.


// compareVersion compares two version strings v1 and v2.
// It returns 1 if v1 > v2, -1 if v1 < v2, and 0 if v1 == v2.
func CompareVersion(v1, v2 string) int {
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. no need to be public function
  2. add unit test to verify its behaviour

@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 18, 2025
@codecov-commenter
Copy link

codecov-commenter commented Dec 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 39.13%. Comparing base (e525ada) to head (0048aa5).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2656      +/-   ##
==========================================
+ Coverage   38.99%   39.13%   +0.13%     
==========================================
  Files         356      356              
  Lines       36898    36912      +14     
==========================================
+ Hits        14388    14443      +55     
+ Misses      20709    20665      -44     
- Partials     1801     1804       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@xhebox xhebox merged commit 9a7a5d2 into pingcap:master Dec 18, 2025
10 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contribution first-time-contributor size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants