Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MNG-7559] Improve documentation of versions comparison #331

Merged
merged 1 commit into from
Nov 14, 2022

Conversation

sultan
Copy link
Contributor

@sultan sultan commented Oct 22, 2022

Fix versions comparison https://issues.apache.org/jira/browse/MNG-7559
intention is:

  • 1.0.0.RC1 < 1.0.0-RC2
  • ( edr, pfd, etc.) < final, ga, release
  • 9.4.1.jre16 > 9.4.1.jre16-preview

following semver rules should be encouraged, natural ordering is used without the need to hard code strings, except for hard coded qualifiers 'a', 'b', 'm', 'cr', 'snapshot', 'final', 'ga', 'release', '' and 'sp':

  • alpha = a < beta = b < milestone = m < rc = cr < 'snapshot' < '' = 'final' = 'ga' = 'release' < 'sp'

the documentation should discourage the usage of 'CR', 'final', 'ga', 'release' and 'SP' qualifiers.
Maven Central should begin to reject new artifact using CR and SP qualifiers.

@sultan sultan marked this pull request as ready for review November 6, 2022 11:35
@sultan sultan marked this pull request as draft November 6, 2022 15:12
@sultan sultan marked this pull request as ready for review November 6, 2022 16:56
@sultan sultan marked this pull request as draft November 12, 2022 20:12
@sultan sultan force-pushed the version-ordering branch 5 times, most recently from 34e13ad to 1f8296b Compare November 12, 2022 21:07
@sultan sultan marked this pull request as ready for review November 12, 2022 21:08
@sultan
Copy link
Contributor Author

sultan commented Nov 12, 2022

@sultan
Copy link
Contributor Author

sultan commented Nov 12, 2022

Copy link
Contributor

@elharo elharo left a comment

Choose a reason for hiding this comment

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

It would be helpful to separate formatting and language changes from functionality changes.

content/apt/pom.apt.vm Outdated Show resolved Hide resolved
content/apt/pom.apt.vm Outdated Show resolved Hide resolved
content/apt/pom.apt.vm Outdated Show resolved Hide resolved
content/apt/pom.apt.vm Outdated Show resolved Hide resolved
content/apt/pom.apt.vm Outdated Show resolved Hide resolved
@elharo elharo changed the title [MNG-7559] Fix versions comparison [MNG-7559] Improve documentation of versions comparison Nov 13, 2022
Copy link
Contributor

@elharo elharo left a comment

Choose a reason for hiding this comment

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

This is related to MNG-7559 but does not seem to fix it. It merely changes docs. That issue requests changes in behavior.

@sultan sultan force-pushed the version-ordering branch 3 times, most recently from 8422aa5 to a7a43ed Compare November 13, 2022 13:15
@sultan
Copy link
Contributor Author

sultan commented Nov 13, 2022

reverted one comparison, and added another test case to prove website documentation right

content/apt/pom.apt.vm Outdated Show resolved Hide resolved
content/apt/pom.apt.vm Show resolved Hide resolved
@sultan
Copy link
Contributor Author

sultan commented Nov 13, 2022

i think i resolved everything, thank you for your feedback. waiting approval of last fixes.

@sultan
Copy link
Contributor Author

sultan commented Nov 13, 2022

This is related to MNG-7559 but does not seem to fix it. It merely changes docs. That issue requests changes in behavior.

The test cases for MNG 7559 are here:

maven-artifact/src/test/java/org/apache/maven/artifact/versioning/ComparableVersionTest.java

     * Test <a href="https://issues.apache.org/jira/browse/MNG-7559">MNG-7559</a> edge cases
     * 1.0.0.RC1 < 1.0.0-RC2
     * -pfd < final, ga, release
     * 2.0.1.MR < 2.0.1
     * 9.4.1.jre16 > 9.4.1.jre16-preview
     */
    @Test
    public void testMng7559()
    {
        checkVersionsOrder( "1.0.0.RC1", "1.0.0-RC2" );
        checkVersionsOrder( "4.0.0.Beta3", "4.0.0-RC2" );
        checkVersionsOrder( "2.3-pfd", "2.3" );
        checkVersionsOrder( "2.0.1.MR", "2.0.1" );
        checkVersionsOrder( "9.4.1.jre16-preview", "9.4.1.jre16" );
        checkVersionsEqual( "2.0.a", "2.0.0.a" ); // previously ordered, now equals
        checkVersionsOrder( "1-sp-1", "1-ga-1" ); // proving website documentation right.
    }

of all the error cases 2.3-pfd was the first declared on the issue and fixed.

did i miss something ?

content/apt/pom.apt.vm Outdated Show resolved Hide resolved
content/apt/pom.apt.vm Outdated Show resolved Hide resolved
content/apt/pom.apt.vm Outdated Show resolved Hide resolved
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.

2 participants