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

feat(maven): Leverage index HTML for Maven Central #12607

Merged

Conversation

zharinov
Copy link
Collaborator

Changes:

  • When fetching from Maven Central, parse package index.html file instead of metadata
  • For any error, fallback to current implementation

Context:

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please tick one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

@zharinov
Copy link
Collaborator Author

DEBUG: http statistics (repository=renovate-testing/test-3866-is-conflicted-refactor)
"urls": {
  "https://api.github.com/graphql (POST)": 4,
  "https://api.github.com/repos/renovate-testing/test-3866-is-conflicted-refactor/commits/renovate/org.apache.lucene-lucene-queries-8.x/check-runs (GET)": 1,
  "https://api.github.com/repos/renovate-testing/test-3866-is-conflicted-refactor/commits/renovate/org.apache.lucene-lucene-queries-8.x/status (GET)": 1,
  "https://api.github.com/repos/renovate-testing/test-3866-is-conflicted-refactor/pulls (GET)": 1,
  "https://repo.maven.apache.org/maven2/org/apache/apache/23/apache-23.pom (GET)": 1,
  "https://repo.maven.apache.org/maven2/org/apache/lucene/lucene-parent/8.10.1/lucene-parent-8.10.1.pom (GET)": 1,
  "https://repo.maven.apache.org/maven2/org/apache/lucene/lucene-queries/8.10.1/lucene-queries-8.10.1.pom (GET)": 1,
  "https://repo.maven.apache.org/maven2/org/apache/lucene/lucene-queries/index.html (GET)": 1,
  "https://repo.maven.apache.org/maven2/org/apache/lucene/lucene-solr-grandparent/8.10.1/lucene-solr-grandparent-8.10.1.pom (GET)": 1
},
"hostStats": {
  "api.github.com": {"requestCount": 7, "requestAvgMs": 327, "queueAvgMs": 0},
  "repo.maven.apache.org": {
    "requestCount": 5,
    "requestAvgMs": 290,
    "queueAvgMs": 0
  }
},
"totalRequests": 12

@zharinov
Copy link
Collaborator Author

We may want to live test for Maven Central and then spread this approach to other common Maven registries

@rarkins
Copy link
Collaborator

rarkins commented Nov 11, 2021

Any impact on our ability to detect each version's release date?

@zharinov
Copy link
Collaborator Author

Any impact on our ability to detect each version's release date?

We're losing seconds/millisecond precision, which seems to be insufficient. However, I think we need to apply both approaches. For older releases, HTML parsing is okay. For newer ones, we still may have to make additional queres (if release is absent in HTML).

So, marking PR as draft for now.

@zharinov zharinov marked this pull request as draft November 11, 2021 08:14
@zharinov zharinov marked this pull request as ready for review November 14, 2021 15:01
Sergei Zharinov added 2 commits November 14, 2021 18:04
@zharinov
Copy link
Collaborator Author

Tested with real repo

@rarkins rarkins merged commit 51961d9 into renovatebot:main Nov 16, 2021
@rarkins rarkins deleted the feat/maven-central-releases-from-index-html branch November 16, 2021 09:49
@renovate-release
Copy link
Collaborator

🎉 This PR is included in version 29.9.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@astellingwerf
Copy link
Collaborator

Is the release timestamp an absolute requirement? I'm asking in the light of #5667. For example, if you look at the https://repo1.maven.org/maven2/ant/ant/, you'll see that there is no timestamp for 1.7.0 (and it's not advertised in the maven-metadata.xml) but it's also the sole version that declares the relocation of the group from "ant" to "org.apache.ant".

@rarkins
Copy link
Collaborator

rarkins commented Nov 22, 2021

@astellingwerf probably not necessary to be mandatory, please raise as a bug report issue

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants