Disable repositories more often and add property to continue when disabled#36060
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
7828618 to
8eb7122
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Also adjust test to clarify when Gradle disables and when it does not.
This is used to indicate that the build should not fail if the repository cannot handle dependency resolution requests.
8eb7122 to
7bf8a13
Compare
7bf8a13 to
eec58bf
Compare
eec58bf to
b59fc00
Compare
| local = new ErrorHandlingModuleComponentRepositoryAccess(delegate.getLocalAccess(), getId(), RepositoryDisabler.NoOpDisabler.INSTANCE, getName()); | ||
| remote = new ErrorHandlingModuleComponentRepositoryAccess(delegate.getRemoteAccess(), getId(), remoteRepositoryDisabler, getName()); | ||
| this.remoteRepositoryDisabler = remoteRepositoryDisabler; | ||
| local = new ErrorHandlingModuleComponentRepositoryAccess(delegate.getLocalAccess(), getId(), RepositoryDisabler.NoOpDisabler.INSTANCE, getName(), false); |
There was a problem hiding this comment.
Does it make sense to say that the local part never continues (false) or that it always continues (true) or should it match the remote part? I'm not entirely sure myself since the local side can never be disabled.
There was a problem hiding this comment.
I think leaving it as false is good for now. But the whole error handling thing should be redefined for the local part. While there are common IOException, most of the logic makes little sense for local. And with proper handling, we might be able to do better errors. But let's do that in a different PR.
This improves reproducibility of builds by making sure Gradle does not check the next repository in the list when the current one fails to answer.
Includes release notes entry
…pository DefaultUrlArtifactRepository is really about holding information about the URL and not a repository itself.
b59fc00 to
9bcf1f4
Compare
|
@bot-gradle test RfR |
This comment has been minimized.
This comment has been minimized.
|
|
||
| @Override | ||
| public boolean isRepositoryDisabled() { | ||
| return remoteRepositoryDisabler.isDisabled(getId()) || delegate.isRepositoryDisabled(); |
There was a problem hiding this comment.
If I'm following this correctly, delegate.isRepositoryDisabled is always false. The only way for it to not be false is if remoteRepositoryDisabler.isDisabled is true.
It looks like ExternalResourceResolver is the only real implementation. Could it get a RepositoryDisabler and have it check isDisabled in isRepositoryDisabled?
|
@bot-gradle test RfR |
This comment has been minimized.
This comment has been minimized.
|
The following builds have been cancelled: |
|
The following builds have passed: |
This builds on top of 36059
It is a draft because there is still some work that needs to be done in disabling repos more aggressively.Repositories are now also disabled if the max retry is reached for transient connection errors. This improves build reproducibility.
A new property can be configured per repository to indicate if a disabled repository should still allow resolution to continue.