Skip to content
Merged
Changes from 1 commit
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
17 changes: 17 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,22 @@ tasks.register("verifyVersions") {
}
}

def generateUpgradeCompatibilityFile = tasks.register("generateUpgradeCompatibilityFile") {
def outputFile = project.layout.buildDirectory.file("rolling-upgrade-compatible.json")
def rollingUpgradeCompatibleVersions = buildParams.bwcVersions.wireCompatible - VersionProperties.elasticsearchVersion
inputs.property("rollingUpgradeCompatibleVersions", rollingUpgradeCompatibleVersions)
outputs.file(outputFile)
doLast {
def versionsString = rollingUpgradeCompatibleVersions.collect { "\"${it.toString()}\"" }.join(', ')
outputFile.get().asFile.write("""{"rolling_upgrade_compatible_versions" : [${versionsString}]}""")
}
}

def upgradeCompatibilityZip = tasks.register("upgradeCompatibilityZip", Zip) {
Copy link
Contributor

Choose a reason for hiding this comment

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

we release other non zip plain files already (e.g. the taco file https://github.com/elastic/infra/blob/4d9aaee586fcfef69c4e97f1e90f877ca4fae0f5/cd/release/release-manager/project-configs/master/elasticsearch.gradle#L83) I wonder if we can skip the zipping bit

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 .taco file though is a zip file. Maybe we can hack this but it's not clear if release manager does any validation here to ensure those are proper archives.

archiveFile.set(project.layout.buildDirectory.file("rolling-upgrade-compatible.zip"))
from(generateUpgradeCompatibilityFile)
}

// TODO: This flag existed as a mechanism to disable bwc tests during a backport. It is no
// longer used for that purpose, but instead a way to run only functional tests. We should
// rework the functionalTests task to be more explicit about which tasks it wants to run
Expand Down Expand Up @@ -483,6 +499,7 @@ tasks.register("buildReleaseArtifacts").configure {
}
.collect { GradleUtils.findByName(it.tasks, 'assemble') }
.findAll { it != null }
dependsOn upgradeCompatibilityZip
}

tasks.register("spotlessApply").configure {
Expand Down