Skip to content

[MNG-5180] merge snapshotVersions in repository metadata correctly - #681

Closed
kwin wants to merge 1 commit into
apache:masterfrom
kwin:bugfix/MNG-5180
Closed

kwin wants to merge 1 commit into
apache:masterfrom
kwin:bugfix/MNG-5180

Conversation

@kwin

@kwin kwin commented Feb 22, 2022 •

Copy link
Copy Markdown
Member

Following this checklist to help us incorporate your
contribution quickly and easily:

  • Make sure there is a JIRA issue filed
    for the change (usually before you start working on it). Trivial changes like typos do not
    require a JIRA issue. Your pull request should address just this issue, without
    pulling in other changes.
  • Each commit in the pull request should have a meaningful subject line and body.
  • Format the pull request title like [MNG-XXX] SUMMARY, where you replace MNG-XXX
    and SUMMARY with the appropriate JIRA issue. Best practice is to use the JIRA issue
    title in the pull request title and in the first line of the commit message.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Run mvn clean verify to make sure basic checks pass. A more thorough check will
    be performed on your pull request automatically.
  • You have run the Core IT successfully.

If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.

To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.

This builds upon the work from #371 and supersedes it.

@kwin
kwin force-pushed the bugfix/MNG-5180 branch 2 times, most recently from 779226b to d831705 Compare February 22, 2022 17:46
@kwin

kwin commented Feb 22, 2022 •

Copy link
Copy Markdown
Member Author

@michael-o This is how I think the merge is reasonable. The same named method in

is IMHO different from Metadata.merge() as the former does a recessive merge but I don't think this is reasonable here, therefore I don't think we have to consider it here any further.

I think it boils down to the question whether multiple or only one snapshotVersion is allowed per extension and classifier in https://maven.apache.org/ref/3.8.3/maven-repository-metadata/repository-metadata.html#class_snapshotVersion.
I currently assume that it is multiple ones but looking at https://repository.apache.org/content/repositories/snapshots/org/apache/maven/maven-core/4.0.0-alpha-1-SNAPSHOT/maven-metadata.xml one could also think, only one SNAPSHOT version is allowed.

Update: I updated the code to be in line with RemoteSnapshotMetadata.merge() now and made sure that only the most recent version per classifier/extension is listed in the metadata.

@michael-o

Copy link
Copy Markdown
Member

@kwin Going through. Do you think that the impl in Resolver is correct?

<version>1.1.0+</version>
<type>String</type>
<description>The timestamp when this version information was last updated. The timestamp is expressed using UTC in the format yyyyMMddHHmmss.</description>
<identifier>true</identifier>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you show where version and updated are part of an id now?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@kwin

kwin commented Feb 23, 2022

Copy link
Copy Markdown
Member Author

Do you think that the impl in Resolver is correct?

yes, but you have to keep in mind how its merge is called (

): The arguments are inverted to the merge from Metadata. For the former the destination is given as argument while for the latter the source is given as argument.

@kwin
kwin marked this pull request as ready for review February 23, 2022 16:17

@michael-o michael-o left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please remove the copied classes from Resolver. This makes the test brittle for the future.

@kwin
kwin requested a review from michael-o February 24, 2022 07:47
michael-o pushed a commit to kwin/maven that referenced this pull request Feb 26, 2022
@michael-o

Copy link
Copy Markdown
Member

Please provide a backport for 3.8.x

kwin pushed a commit to kwin/maven that referenced this pull request Feb 27, 2022
@kwin

kwin commented Feb 27, 2022

Copy link
Copy Markdown
Member Author

Please provide a backport for 3.8.x

Done in #684

kwin pushed a commit to kwin/maven that referenced this pull request Feb 27, 2022
metadata merge

Co-authored-by: Konrad Windszus <[email protected]>

This closes apache#681
@asfgit asfgit closed this in 1e33a57 Feb 27, 2022
@jira-importer

Copy link
Copy Markdown

Resolve #7003

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.

4 participants