Skip to content

Commit

Permalink
Add build_flavor back to info api rest response (#88336) (#88361)
Browse files Browse the repository at this point in the history
The build_flavor was previously removed since it is no longer relevant;
only the default distribution now exists. However, the removal of build
flavor included removing it from the version information on the info
response for the root path. This API is supposed to be stable, so
removing that key was a compatibility break. This commit adds the
build_flavor back to that API, hardcoded to `default`. Additionally, a
test is added to ensure the key exists going forward, until it can be
properly deprecated.

closes #88318
  • Loading branch information
rjernst committed Jul 8, 2022
1 parent 98dba59 commit 5a572d8
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 2 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,9 @@ tasks.register("verifyVersions") {
* after the backport of the backcompat code is complete.
*/

boolean bwc_tests_enabled = true
boolean bwc_tests_enabled = false
// place a PR link here when committing bwc changes:
String bwc_tests_disabled_issue = ""
String bwc_tests_disabled_issue = "https://github.com/elastic/elasticsearch/pull/88336"
if (bwc_tests_enabled == false) {
if (bwc_tests_disabled_issue.isEmpty()) {
throw new GradleException("bwc_tests_disabled_issue must be set when bwc_tests_enabled == false")
Expand Down
6 changes: 6 additions & 0 deletions docs/changelog/88336.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pr: 88336
summary: Add `build_flavor` back to info api rest response
area: Infra/Core
type: bug
issues:
- 88318
1 change: 1 addition & 0 deletions docs/plugins/discovery-azure-classic.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ This command should give you a JSON result:
"number" : "{version_qualified}",
"build_type" : "{build_type}",
"build_hash" : "f27399d",
"build_flavor": "default",
"build_date" : "2016-03-30T09:51:41.449Z",
"build_snapshot" : false,
"lucene_version" : "{lucene_version}",
Expand Down
1 change: 1 addition & 0 deletions docs/reference/setup/install/check-running.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ GET /
"number" : "{version_qualified}",
"build_type" : "{build_type}",
"build_hash" : "f27399d",
"build_flavor" : "default",
"build_date" : "2016-03-30T09:51:41.449Z",
"build_snapshot" : false,
"lucene_version" : "{lucene_version}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,11 @@
- is_true: tagline
- is_true: version
- is_true: version.number

---
"Info build flavor":
- skip:
version: "8.3.0 - 8.3.2"
reason: "build flavor in info was missing in 8.3.0 to 8.3.2"
- do: {info: {}}
- match: { version.build_flavor: default }
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws
builder.field("cluster_uuid", clusterUuid);
builder.startObject("version")
.field("number", build.qualifiedVersion())
.field("build_flavor", "default")
.field("build_type", build.type().displayName())
.field("build_hash", build.hash())
.field("build_date", build.date())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public void testToXContent() throws IOException {
"cluster_uuid": "%s",
"version": {
"number": "%s",
"build_flavor": "default",
"build_type": "%s",
"build_hash": "%s",
"build_date": "%s",
Expand Down

0 comments on commit 5a572d8

Please sign in to comment.