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

fix(maven): do not track registries when fetching requirements #1466

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

cuixq
Copy link
Contributor

@cuixq cuixq commented Dec 23, 2024

#1447

When fetching requirements of a Maven dependency, we should not keep track of the registries defined in pom.xml of dependencies. Doing that will add a lot irrelevant registries to the client and sends unnecessary requests, and finally slows down the resolution.

This PR also disables PreFetch in Maven transitive scanning. PreFetch calls MatchVersions which sends requests to maven-metadata.xml for native Maven client. maven-metadata.xml is not necessarily needed for all dependencies. Disabling PreFetch will save us from making requests to these files. However, calling PreFetch should be fine for deps.dev client, and this can be a TODO in the future.

With this fix, resolving pom.xml is now shortened to 10-20 seconds.

@codecov-commenter
Copy link

codecov-commenter commented Dec 23, 2024

Codecov Report

Attention: Patch coverage is 60.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 67.08%. Comparing base (9d28c7f) to head (c422c68).

Files with missing lines Patch % Lines
...nternal/resolution/client/maven_registry_client.go 33.33% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1466      +/-   ##
==========================================
- Coverage   67.32%   67.08%   -0.24%     
==========================================
  Files         192      192              
  Lines       18161    18164       +3     
==========================================
- Hits        12226    12185      -41     
- Misses       5283     5324      +41     
- Partials      652      655       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cuixq cuixq changed the title fix(maven): do not add registries when fetching requirements fix(maven): do not track registries when fetching requirements Dec 23, 2024
@cuixq cuixq marked this pull request as ready for review December 23, 2024 03:10
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