-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Fix IT tests after version bumps #15827
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 IT tests after version bumps #15827
Conversation
5eedf52
to
23aeb32
Compare
This commit fixes IT failures that frequently occur after version bumps due to missing unified release snapshot builds for the new version. This commit uses project specific DRA snapshot URLs for ES and Filebeat in all cases apart from release builds. Closes elastic#2825
23aeb32
to
fff8ec5
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.
Left a couple of suggestions.
Given that the code in 2 tasks downloadFilebeat
and downloadEs
are becoming more and more complex, and essentially identical, I was wonder if we can share the same code in some way, static function or something else.
The most complex is to create custom task and add those to the tooling, but that could be a follow up PR or issue to create to clean up the things a little bit.
build.gradle
Outdated
@@ -180,6 +181,11 @@ tasks.register("configureArtifactInfo") { | |||
def dlVersions = new JsonSlurper().parseText(apiResponse) | |||
String qualifiedVersion = dlVersions['versions'].grep(isReleaseBuild ? ~/^${version}$/ : ~/^${version}-SNAPSHOT/)[0] | |||
if (qualifiedVersion == null) { | |||
if (isReleaseBuild == false) { |
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 (isReleaseBuild == false) { | |
if (!isReleaseBuild) { |
isReleaseBuild
is a boolean so no need to use == false
to force any Groovy magic. I think that at this point we can also change the definition of isReleaseBuild
to make the type more explicit:
boolean isReleaseBuild = System.getenv('RELEASE') == "1" || versionQualifier
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.
Fix (both comments) in b9edfe4
build.gradle
Outdated
} | ||
else { |
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.
} | |
else { | |
} else { |
Just a note on indentation. Applies also to all other newly added if
s
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.
Fixed in ab38677
String packageShaUrl = packageArtifactUrls["projects"]["${project}"]["packages"]["${downloadedPackageName}.tar.gz"]["sha_url"] | ||
|
||
return [packageUrl, packageShaUrl] | ||
|
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.
String packageUrl = packageArtifactUrls["projects"]["${project}"]["packages"]["${downloadedPackageName}.tar.gz"]["url"] | ||
String packageShaUrl = packageArtifactUrls["projects"]["${project}"]["packages"]["${downloadedPackageName}.tar.gz"]["sha_url"] | ||
|
||
return [packageUrl, packageShaUrl] |
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.
I would go with a more self explanatory data structure. The clients of this method has to know what to find in first and second positions. I would with something more structured, so that the data can be accessed like:
res.packageUrl
res.packageShaUrl
instead of
res[0]
res[1]
in order of complexity you can choose:
return ["packageUrl": packageUrl, "packageShaUrl":packageShaUrl]
- an Expando instance, which generates a class on the fly without the need to declare it https://blog.mrhaki.com/2009/10/groovy-goodness-expando-as-dynamic-bean.html
return new Expando(packageUrl: packageUrl, packageShaUrl: packageShaUrl)
- plain old POJO, declaring a class with the 2 fields (they can be
public final
because are read only, without pedant getters)
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.
Thank you! I used the groovy-maps in 56d5b42
Thank you, they were very helpful! I've addressed them no, I'd appreciate if you'd take another look when possible.
Agreed and got the same feeling. I wanted to stop the bleeding of failures with this one as soon as possible hence didn't proceed to larger refactorings in the interest of time. I will start by filing an issue for the follow up work. |
|
💚 Build Succeeded
History
cc @dliappis |
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.
LGTM
@logstashmachine backport 8.12 |
@logstashmachine backport 7.17 |
This commit fixes IT failures that frequently occur after version bumps due to missing unified release snapshot builds for the new version. This commit uses project specific DRA snapshot URLs for ES and Filebeat in all cases apart from release builds. Closes #2825 (cherry picked from commit d74fea4)
This commit fixes IT failures that frequently occur after version bumps due to missing unified release snapshot builds for the new version. This commit uses project specific DRA snapshot URLs for ES and Filebeat in all cases apart from release builds. (cherry picked from commit d74fea4) Co-authored-by: Dimitrios Liappis <[email protected]>
This commit fixes IT failures that frequently occur after version bumps due to missing unified release snapshot builds for the new version. This commit uses project specific DRA snapshot URLs for ES and Filebeat in all cases apart from release builds. Closes #2825 (cherry picked from commit d74fea4) Co-authored-by: Dimitrios Liappis <[email protected]>
This commit fixes IT failures that frequently occur after version bumps due to missing unified release snapshot builds for the new version. This commit uses project specific DRA snapshot URLs for ES and Filebeat in all cases apart from release builds. (cherry picked from commit d74fea4)
Release notes
[rn:skip]
What does this PR do?
This commit fixes IT failures that frequently occur after version bumps due to missing unified release snapshot builds for the new version.
This commit uses project specific DRA snapshot URLs for ES and Filebeat
in all cases apart from release builds.
Why is it important/What is the impact to the user?
This is a very important to fix as several pipelines (PR, exhaustive, JDK matrix, aarch64) run IT tests as a prerequisite and produce unnecessary failures shortly
after version bumps, possibly blinding us from genuine issues.
How to test this PR locally
See CI from backporting this PR to
8.12
:and compare to https://buildkite.com/elastic/logstash-exhaustive-tests-pipeline/builds/126#018d31b4-8da9-4dbf-b43e-217f2a4f7518/46-469 showing current failures on the
8.12
branchRelated issues