-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Download more dependencies to decrease the chance of network errors #15797
Conversation
mvn dependency:go-offline
dependency:go-offline
dependency:go-offline
--offline
flag to Maven calls after dependency:go-offline
Does this also solve fetching Maven plugins? Or is that not an issue? |
A hypothesis I'm currently checking is that Maven tries to download POMs while building the module hierarchy. |
It seems that |
I guess we could manually download one dependency, but I see that there may be more missing pieces. |
We can make iterative improvements here. |
We'd never catch up - the end of the road is having all dependencies (transitive and direct) from all build plugins downloaded, and unless we manage to do that there's always a window of opportunity for CI breaking. We need something like |
I'll make another attempt with common CI profiles enabled during |
a6cdfc4
to
75937fe
Compare
I'm also going to check out https://github.com/qaware/go-offline-maven-plugin |
0f54eb4
to
e699b36
Compare
It seems the new plugin worked (at least up until
|
e9d020c
to
52e8dd4
Compare
--offline
flag to Maven calls after dependency:go-offline
Once this gets merged we should purge the GitHub Maven cache. |
b166d6f
to
39344d6
Compare
39344d6
to
37345b4
Compare
Failed due to #14372 |
d043387
to
269a4f2
Compare
Maven's built-in `dependency:go-offline` goal doesn't download build plugin dependencies, we need an additional tool to download them. The `maven-checks` job is responsible for: - getting as many dependencies as possible, - putting them in GitHub cache for other jobs and pipelines. Experiments have shown the new plugin also has some issues. For example it only downloads a single version of a dependency, which breaks on any module which overrides global versions of some common dependencies - so far `trino-pinot` is the only one. These overridden versions will be missing. This is one of the reasons why we can't use Maven's `--offline` flag. However, a majority of dependencies can still be downloaded at the start of the pipeline, providing quick feedback in case of network problems. Anything missing will have to be downloaded in other jobs. This won't completely eliminate the faulty networking problems, but should decrease the chances of dependency downloads failing in late pipeline stages. Add dynamic dependencies found by CI
Use cache to decrease the number of downloads from Maven Central which can potentially result in failures.
Revapi tries to compare this and previous version of any API. If it can't download the old version, if falls back to comparing with an empty file. This can lead to error reports which are not shown in daily development.
In this approach each job is responsible for downloading all dependencies.
Retries should only be attempted during dependency downloads.
This explains how to handle dynamic dependencies that aren't detected by automated tools.
269a4f2
to
8e54b75
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@findepi LGTM
Unrelated test failure:
|
thanks! |
Description
A call to
dependency:go-offline
was recently added to download all dependencies into the local Maven cache.Unfortunately it turns out the goal has some problems with multi-module projects, and Maven will still attempt to download any missing artifacts during build.
The purpose of this PR is to improve this situation by caching MORE dependencies, as every cached artifact decreases the chance of a Maven Central download failure breaking Maven builds.
Downloading ALL dependencies is NOT a requirement, although it would be ideal.
Other jobs will now depend the
maven-checks
job as they now need to unpack the cache artifact left by it.Additional context and related issues
CI workers sometimes fail to download dependencies in the middle of a build.
A workaround was proposed to download as many dependencies as possible at the start of CI pipeline, cache them for other jobs, to limit the use of Maven Central afterwards.
Release notes
(x) This is not user-visible or docs only and no release notes are required.
( ) Release notes are required, please propose a release note for me.
( ) Release notes are required, with the following suggested text: