-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Manually configure some cache-redirected repositories #4686
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
Open
Badya
wants to merge
3
commits into
develop
Choose a base branch
from
badya/cache-redirector
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@Badya, Why it has to be done this way?
Uh oh!
There was an error while loading. Please reload this page.
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.
This is the best way to use in such a case, and Gradle best practice.
https://docs.gradle.org/current/userguide/filtering_repository_content.html#sec:declaring-content-repositories
Looking up dev deps in central or in cache redirector (which is gonna poll central under the hood) will result in guaranteed
404, but also will count towards central's request limit bringing up potential throttling and429 Too Many Requests.By using this Gradle is guaranteed not to look up deps matching regexp elsewhere.
Additionally I suspect Gradle to continue trying other repositories on
404but in the case of429 Too Many Requestsfrom central, it just fails the build right away. Provided solution also prevents this behavior regardless of repos declaring order.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.
Wouldn't it be enough to simply move the dev repo declaration before central repo and gradle plugins portal?
Uh oh!
There was an error while loading. Please reload this page.
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.
If something is wrong with dev repo and gradle fails to find artifacts there, it still gonna try other repos in that case, which we want to avoid, since we know for 100% artifacts are not there.
This is the best way to configure gradle for this case
Uh oh!
There was an error while loading. Please reload this page.
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.
But the dev repo is specified in cases when we know for sure that the artifact should be there, isn't it?
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.
In my view, this configuration makes perfect sense. The
kotlin_dev_repoGradle property specifies: "You must use the Kotlin development repository for Kotlin!" That means we aren't supposed to use the non-development repository for Kotlin. The proposed config catches the error where 1)kotlinx.coroutinesaccidentally depends on a hardcoded version of Kotlin, or 2) where the TeamCity config got broken and passed a stable instead of the development version of Kotlin, or 3) where the Kotlin Gradle Plugin got broken and accidentally stripped out the dev version suffix during resolution... It's a reasonable way of ensuring we get exactly what we requested, instead of pulling in something undesired from Maven without noticing.