Skip to content
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

Make packer cache branches explicit #41990

Merged
merged 7 commits into from
May 22, 2019
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .ci/packer_cache.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ export JAVA8_HOME="${HOME}"/.java/java8
export JAVA11_HOME="${HOME}"/.java/java11
export JAVA12_HOME="${HOME}"/.java/openjdk12
./gradlew --parallel clean --scan -Porg.elasticsearch.acceptScanTOS=true -s resolveAllDependencies

Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,7 @@ public int compareTo(Version other) {
return Integer.compare(getId(), other.getId());
}

public boolean isNextMajor() {
return getRevision() == 0 && getMinor() == 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem right. A version string without context cannot possibly determine if it is the next major version. This should really live in BwcVersions. For example Version.fromString("7.0.0").isNextMajor() would return true which is obviously incorrect.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method shouldn't exist probably, and we should just do the check directly.
BWC versions doesn't know about newer versions, e.x on 6.8 there's no way to know how far we'we got. That being said we have used x.0.0 to identify master, as we will never build ex 7.0.0 as soon as it's released we version bump and the branch becomes 7.0.1. This would break down only when we have a major staged (as we had before 7.0 was released but the 7.x branch cut). This would I think be acceptable for this use-case (without the isNextMajor method of course). WDYT @mark-vieira ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd be ok with renaming this something more pedantically accurate like isNewMajor().

}
}
6 changes: 4 additions & 2 deletions distribution/bwc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,14 @@ bwcVersions.forPreviousUnreleased { BwcVersions.UnreleasedVersionInfo unreleased

createBuildBwcTask(projectName, "${baseDir}/${projectName}", projectArtifact)
}


createRunBwcGradleTask("resolveAllBwcDependencies") {
args 'resolveAllDependencies'
}
resolveAllDependencies.dependsOn resolveAllBwcDependencies
if (Version.fromString(version).isNextMajor()) {
// We only want to resolve dependencies for live versions of master, without cascading this to older versions
resolveAllDependencies.dependsOn resolveAllBwcDependencies
}

for (e in artifactFiles) {
String projectName = e.key
Expand Down