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

SOLR-15845 SolrVersion class only recording current version, and based on SemVer #472

Merged
merged 19 commits into from
Jan 3, 2022

Conversation

janhoy
Copy link
Contributor

@janhoy janhoy commented Dec 23, 2021

https://issues.apache.org/jira/browse/SOLR-15845

This is the same patch as #469 except instead of the Lucene-style Version class which keeps a record of all previous verions (which it needs for index-file and analysis compatibility checks), this variant just keeps the current Solr version, and has functionality to enforce SemVer versioning and version comparison, based on SemVer dependency.

It now updates SolrVersion class correctly, and also has a -l <lucene-version> flag to inject a different lucene-version for luceneMatchVersion
@janhoy
Copy link
Contributor Author

janhoy commented Jan 3, 2022

I updated addVersion.py so it works as expected.
Also, instead of updating <luceneMatchVersion> in solrconfig with the new Solr version, it is now updated with the lucene version found in versions.props, alternatively a lucene-version passed as addVersion.py -l <lucene_ver> <solr_ver>.

@janhoy janhoy merged commit 02b7590 into apache:main Jan 3, 2022
@janhoy janhoy deleted the solr15845-with-semver branch January 3, 2022 22:34
@thelabdude
Copy link
Contributor

thelabdude commented Jan 5, 2022

@janhoy ... I think the semver code com.github.zafarkhaja.semver is not Locale aware:

org.apache.solr.util.TestSolrVersion > testVersionComponents FAILED
    org.junit.ComparisonFailure: expected:<[9.0.1]-rc1> but was:<[৯.০.১]-rc1>
        at __randomizedtesting.SeedInfo.seed([EBA979F6BCADAB5F:593FBB0BE14D10A9]:0)
        at org.junit.Assert.assertEquals(Assert.java:117)
        at org.junit.Assert.assertEquals(Assert.java:146)
        at org.apache.solr.util.TestSolrVersion.testVersionComponents(TestSolrVersion.java:31)

Specifically, NormalVersion needs to use a Locale here:

    public String toString() {
        return String.format("%d.%d.%d", major, minor, patch);
    }

@janhoy
Copy link
Contributor Author

janhoy commented Jan 6, 2022

I think the semver code com.github.zafarkhaja.semver is not Locale aware

How do you reproduce this? I see that the semver lib is getting old and there are other alternatives out there. Or we could file a bug there?

@janhoy
Copy link
Contributor Author

janhoy commented Jan 6, 2022

arobinski pushed a commit to arobinski/solr that referenced this pull request Jan 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants