Skip to content

Commit ccbbc76

Browse files
authored
When downloading old servers, only cache latest version for 10 minutes (#3284)
The 4.2.3.0 release did not do a mixed-mode test against 4.2.2.0 because that was released less than 24 hours before. This changes it so that it refreshes the dynamic version after 10 minutes. This does mean that builds will have to fetch the latest version metadata more often, including for developers running locally. If this becomes a burden, we could try to add something to our release process to ensure that after a release we force an update to the cached version, but that seems trickier to manage, and we'd only really be able to test it by doing releases within 24 hours of each other.
1 parent 2c7b185 commit ccbbc76

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

yaml-tests/yaml-tests.gradle

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,19 @@ dependencies {
8181
ext.resolveOtherServer = { Set<String> rejectedVersions ->
8282
def configurationName = "resolveArtifact-${UUID.randomUUID()}"
8383
return rootProject.with {
84-
configurations.create(configurationName, { })
84+
configurations.create(configurationName, {
85+
resolutionStrategy {
86+
// Cache the latest version for 10 minutes to make sure we actually get the latest.
87+
// This should be long enough that we can do this resolution, but means that if we had a release
88+
// in the last 10 minutes.
89+
// Note: In the actions we have a build cache, which means that these versions will be cached across
90+
// builds.
91+
// The default value for this is 24 hours, which is probably, generally, fine, but in the case where
92+
// we do have two releases within 24 hours (as we did for 4.2.3.0) we don't want to miss the last
93+
// version.
94+
cacheDynamicVersionsFor 10, 'minutes'
95+
}
96+
})
8597
// If you're wondering why this doesn't just use `latest.release`:
8698
// `latest.release` becomes `LatestVersionSelector` which `requiresMetadata` in order to determine if the
8799
// version in question is a release. This means that it can't just look at the version listing, it has to

0 commit comments

Comments
 (0)