Skip to content

Commit

Permalink
Adapt bwc version after backport of elastic#58299
Browse files Browse the repository at this point in the history
This commit adapts the bwc version in preparation of the backport
to 7.x. The bwc tests are disabled in order to allow the merge of
elastic#58299.

Relates elastic#58299
  • Loading branch information
jimczi committed Jun 17, 2020
1 parent 51d0bc4 commit e372cad
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 16 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ tasks.register("verifyVersions") {
* after the backport of the backcompat code is complete.
*/

boolean bwc_tests_enabled = true
final String bwc_tests_disabled_issue = "" /* place a PR link here when committing bwc changes */
boolean bwc_tests_enabled = false
final String bwc_tests_disabled_issue = "https://github.com/elastic/elasticsearch/pull/58299" /* place a PR link here when committing bwc changes */
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
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,8 @@
---
"Get field caps from remote cluster with index filter":
- skip:
version: " - 7.99.99"
# TODO: Adapt version after backport
reason: Index filter support was added in 8.0
version: " - 7.8.99"
reason: Index filter support was added in 7.9

- do:
indices.create:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,8 @@ setup:
---
"Field caps with index filter":
- skip:
version: " - 7.99.99"
# TODO: Adapt version after backport
reason: Index filter support was added in 8.0
version: " - 7.8.99"
reason: Index filter support was added in 7.9

- do:
field_caps:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ public class FieldCapabilitiesIndexRequest extends ActionRequest implements Indi
index = in.readOptionalString();
fields = in.readStringArray();
originalIndices = OriginalIndices.readOriginalIndices(in);
indexFilter = in.getVersion().onOrAfter(Version.V_8_0_0) ? in.readOptionalNamedWriteable(QueryBuilder.class) : null;
nowInMillis = in.getVersion().onOrAfter(Version.V_8_0_0) ? in.readLong() : 0L;
indexFilter = in.getVersion().onOrAfter(Version.V_7_9_0) ? in.readOptionalNamedWriteable(QueryBuilder.class) : null;
nowInMillis = in.getVersion().onOrAfter(Version.V_7_9_0) ? in.readLong() : 0L;
}

FieldCapabilitiesIndexRequest(String[] fields,
Expand Down Expand Up @@ -113,7 +113,7 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeOptionalString(index);
out.writeStringArray(fields);
OriginalIndices.writeOriginalIndices(originalIndices, out);
if (out.getVersion().onOrAfter(Version.V_8_0_0)) {
if (out.getVersion().onOrAfter(Version.V_7_9_0)) {
out.writeOptionalNamedWriteable(indexFilter);
out.writeLong(nowInMillis);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class FieldCapabilitiesIndexResponse extends ActionResponse implements Wr
super(in);
this.indexName = in.readString();
this.responseMap = in.readMap(StreamInput::readString, IndexFieldCapabilities::new);
this.canMatch = in.getVersion().onOrAfter(Version.V_8_0_0) ? in.readBoolean() : true;
this.canMatch = in.getVersion().onOrAfter(Version.V_7_9_0) ? in.readBoolean() : true;
}

/**
Expand Down Expand Up @@ -80,7 +80,7 @@ public IndexFieldCapabilities getField(String field) {
public void writeTo(StreamOutput out) throws IOException {
out.writeString(indexName);
out.writeMap(responseMap, StreamOutput::writeString, (valueOut, fc) -> fc.writeTo(valueOut));
if (out.getVersion().onOrAfter(Version.V_8_0_0)) {
if (out.getVersion().onOrAfter(Version.V_7_9_0)) {
out.writeBoolean(canMatch);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ public FieldCapabilitiesRequest(StreamInput in) throws IOException {
} else {
includeUnmapped = false;
}
indexFilter = in.getVersion().onOrAfter(Version.V_8_0_0) ? in.readOptionalNamedWriteable(QueryBuilder.class) : null;
nowInMillis = in.getVersion().onOrAfter(Version.V_8_0_0) ? in.readOptionalLong() : null;
indexFilter = in.getVersion().onOrAfter(Version.V_7_9_0) ? in.readOptionalNamedWriteable(QueryBuilder.class) : null;
nowInMillis = in.getVersion().onOrAfter(Version.V_7_9_0) ? in.readOptionalLong() : null;
}

public FieldCapabilitiesRequest() {
Expand Down Expand Up @@ -97,7 +97,7 @@ public void writeTo(StreamOutput out) throws IOException {
if (out.getVersion().onOrAfter(Version.V_7_2_0)) {
out.writeBoolean(includeUnmapped);
}
if (out.getVersion().onOrAfter(Version.V_8_0_0)) {
if (out.getVersion().onOrAfter(Version.V_7_9_0)) {
out.writeOptionalNamedWriteable(indexFilter);
out.writeOptionalLong(nowInMillis);
}
Expand Down

0 comments on commit e372cad

Please sign in to comment.