Skip to content

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

Merged
elharo merged 1 commit into
apache:masterfrom
sultan:version-ordering
Nov 14, 2022
Merged

elharo merged 1 commit into
apache:masterfrom
sultan:version-ordering

Conversation

@sultan

@sultan sultan commented Oct 22, 2022 •

Copy link
Copy Markdown
Contributor

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

sultan commented Nov 12, 2022

Copy link
Copy Markdown
Contributor Author

@sultan

sultan commented Nov 12, 2022

Copy link
Copy Markdown
Contributor Author

@elharo elharo 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.

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

Comment thread content/apt/pom.apt.vm Outdated
Comment thread content/apt/pom.apt.vm Outdated
Comment thread content/apt/pom.apt.vm Outdated
Comment thread content/apt/pom.apt.vm Outdated
Comment thread content/apt/pom.apt.vm Outdated
@elharo elharo changed the title [MNG-7559] Fix versions comparison [MNG-7559] Improve documentation of versions comparison Nov 13, 2022

@elharo elharo 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.

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

sultan commented Nov 13, 2022

Copy link
Copy Markdown
Contributor Author

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

Comment thread content/apt/pom.apt.vm Outdated
Comment thread content/apt/pom.apt.vm
@sultan

sultan commented Nov 13, 2022

Copy link
Copy Markdown
Contributor Author

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

@sultan

sultan commented Nov 13, 2022 •

Copy link
Copy Markdown
Contributor Author

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 ?

Comment thread content/apt/pom.apt.vm Outdated
Comment thread content/apt/pom.apt.vm Outdated
Comment thread content/apt/pom.apt.vm Outdated
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