Merge branch 'stable-3.2'
* stable-3.2: Update git submodules Fix documentation of `container.slave` Fix documentation of `container.slave` Update git submodules Update git submodules Submit: Use updated change for response Remove Content-Type header from 'Submit Revision' example Update git submodules Add support for Elasticsearch version 7.8.* Fix `parent` in `gr-change-metadata` when there is no revision Change-Id: Ifaaad90a7343da4e301137616bc7c82e92bd6f3c
This commit is contained in:
@@ -1703,7 +1703,8 @@ operations.
|
||||
|
||||
[[container.slave]]container.slave::
|
||||
+
|
||||
Backward compatibility for 'container.slave' config setting.
|
||||
Backward compatibility for link:#container.replica[`container.replica`]
|
||||
config setting.
|
||||
|
||||
[[container.startupTimeout]]container.startupTimeout::
|
||||
+
|
||||
|
||||
@@ -4249,7 +4249,6 @@ Submits a revision.
|
||||
.Request
|
||||
----
|
||||
POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/submit HTTP/1.0
|
||||
Content-Type: application/json; charset=UTF-8
|
||||
----
|
||||
|
||||
As response a link:#submit-info[SubmitInfo] entity is returned that
|
||||
|
||||
@@ -28,7 +28,8 @@ public enum ElasticVersion {
|
||||
V7_4("7.4.*"),
|
||||
V7_5("7.5.*"),
|
||||
V7_6("7.6.*"),
|
||||
V7_7("7.7.*");
|
||||
V7_7("7.7.*"),
|
||||
V7_8("7.8.*");
|
||||
|
||||
private final String version;
|
||||
private final Pattern pattern;
|
||||
|
||||
@@ -214,7 +214,7 @@ public class Submit
|
||||
|
||||
updatedChange = op.merge(change, submitter, true, input, false);
|
||||
if (updatedChange.isMerged()) {
|
||||
return Response.ok(new Output(change));
|
||||
return Response.ok(new Output(updatedChange));
|
||||
}
|
||||
|
||||
throw new IllegalStateException(
|
||||
|
||||
@@ -31,7 +31,7 @@ public class ElasticReindexIT extends AbstractReindexTests {
|
||||
|
||||
@ConfigSuite.Config
|
||||
public static Config elasticsearchV7() {
|
||||
return getConfig(ElasticVersion.V7_7);
|
||||
return getConfig(ElasticVersion.V7_8);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -33,7 +33,7 @@ public class ElasticIndexIT extends AbstractIndexTests {
|
||||
|
||||
@ConfigSuite.Config
|
||||
public static Config elasticsearchV7() {
|
||||
return getConfig(ElasticVersion.V7_7);
|
||||
return getConfig(ElasticVersion.V7_8);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -60,6 +60,8 @@ public class ElasticContainer extends ElasticsearchContainer {
|
||||
return "blacktop/elasticsearch:7.6.2";
|
||||
case V7_7:
|
||||
return "blacktop/elasticsearch:7.7.1";
|
||||
case V7_8:
|
||||
return "blacktop/elasticsearch:7.8.0";
|
||||
}
|
||||
throw new IllegalStateException("No tests for version: " + version.name());
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ public class ElasticV7QueryAccountsTest extends AbstractQueryAccountsTest {
|
||||
public static void startIndexService() {
|
||||
if (container == null) {
|
||||
// Only start Elasticsearch once
|
||||
container = ElasticContainer.createAndStart(ElasticVersion.V7_7);
|
||||
container = ElasticContainer.createAndStart(ElasticVersion.V7_8);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ public class ElasticV7QueryChangesTest extends AbstractQueryChangesTest {
|
||||
public static void startIndexService() {
|
||||
if (container == null) {
|
||||
// Only start Elasticsearch once
|
||||
container = ElasticContainer.createAndStart(ElasticVersion.V7_7);
|
||||
container = ElasticContainer.createAndStart(ElasticVersion.V7_8);
|
||||
client = HttpAsyncClients.createDefault();
|
||||
client.start();
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ public class ElasticV7QueryGroupsTest extends AbstractQueryGroupsTest {
|
||||
public static void startIndexService() {
|
||||
if (container == null) {
|
||||
// Only start Elasticsearch once
|
||||
container = ElasticContainer.createAndStart(ElasticVersion.V7_7);
|
||||
container = ElasticContainer.createAndStart(ElasticVersion.V7_8);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ public class ElasticV7QueryProjectsTest extends AbstractQueryProjectsTest {
|
||||
public static void startIndexService() {
|
||||
if (container == null) {
|
||||
// Only start Elasticsearch once
|
||||
container = ElasticContainer.createAndStart(ElasticVersion.V7_7);
|
||||
container = ElasticContainer.createAndStart(ElasticVersion.V7_8);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -54,6 +54,9 @@ public class ElasticVersionTest {
|
||||
|
||||
assertThat(ElasticVersion.forVersion("7.7.0")).isEqualTo(ElasticVersion.V7_7);
|
||||
assertThat(ElasticVersion.forVersion("7.7.1")).isEqualTo(ElasticVersion.V7_7);
|
||||
|
||||
assertThat(ElasticVersion.forVersion("7.8.0")).isEqualTo(ElasticVersion.V7_8);
|
||||
assertThat(ElasticVersion.forVersion("7.8.1")).isEqualTo(ElasticVersion.V7_8);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -81,6 +84,7 @@ public class ElasticVersionTest {
|
||||
assertThat(ElasticVersion.V7_5.isAtLeastMinorVersion(ElasticVersion.V6_7)).isFalse();
|
||||
assertThat(ElasticVersion.V7_6.isAtLeastMinorVersion(ElasticVersion.V6_7)).isFalse();
|
||||
assertThat(ElasticVersion.V7_7.isAtLeastMinorVersion(ElasticVersion.V6_7)).isFalse();
|
||||
assertThat(ElasticVersion.V7_8.isAtLeastMinorVersion(ElasticVersion.V6_7)).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -96,6 +100,7 @@ public class ElasticVersionTest {
|
||||
assertThat(ElasticVersion.V7_5.isV6OrLater()).isTrue();
|
||||
assertThat(ElasticVersion.V7_6.isV6OrLater()).isTrue();
|
||||
assertThat(ElasticVersion.V7_7.isV6OrLater()).isTrue();
|
||||
assertThat(ElasticVersion.V7_8.isV6OrLater()).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -111,5 +116,6 @@ public class ElasticVersionTest {
|
||||
assertThat(ElasticVersion.V7_5.isV7OrLater()).isTrue();
|
||||
assertThat(ElasticVersion.V7_6.isV7OrLater()).isTrue();
|
||||
assertThat(ElasticVersion.V7_7.isV7OrLater()).isTrue();
|
||||
assertThat(ElasticVersion.V7_8.isV7OrLater()).isTrue();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ class GrChangeMetadata extends mixinBehaviors( [
|
||||
|
||||
_currentParents: {
|
||||
type: Array,
|
||||
computed: '_computeParents(revision)',
|
||||
computed: '_computeParents(change, revision)',
|
||||
},
|
||||
|
||||
/** @type {?} */
|
||||
@@ -493,9 +493,11 @@ class GrChangeMetadata extends mixinBehaviors( [
|
||||
return null;
|
||||
}
|
||||
|
||||
_computeParents(revision) {
|
||||
_computeParents(change, revision) {
|
||||
if (!revision || !revision.commit) {
|
||||
return undefined;
|
||||
if (!change || !change.current_revision) { return []; }
|
||||
revision = change.revisions[change.current_revision];
|
||||
if (!revision || !revision.commit) { return []; }
|
||||
}
|
||||
return revision.commit.parents;
|
||||
}
|
||||
|
||||
@@ -426,20 +426,38 @@ suite('gr-change-metadata tests', () => {
|
||||
});
|
||||
|
||||
test('_computeParents', () => {
|
||||
const revision = {commit: {parents: [{commit: '123', subject: 'abc'}]}};
|
||||
assert.isUndefined(element._computeParents({}));
|
||||
assert.equal(element._computeParents(revision), revision.commit.parents);
|
||||
const parents = [{commit: '123', subject: 'abc'}];
|
||||
const revision = {commit: {parents}};
|
||||
assert.deepEqual(element._computeParents({}, {}), []);
|
||||
assert.equal(element._computeParents(null, revision), parents);
|
||||
const change = current_revision => {
|
||||
return {current_revision, revisions: {456: revision}};
|
||||
};
|
||||
assert.deepEqual(element._computeParents(change(null), null), []);
|
||||
const change_bad_revision = change('789');
|
||||
assert.deepEqual(element._computeParents(change_bad_revision, {}), []);
|
||||
const change_no_commit = {current_revision: '456', revisions: {456: {}}};
|
||||
assert.deepEqual(element._computeParents(change_no_commit, null), []);
|
||||
const change_good = change('456');
|
||||
assert.equal(element._computeParents(change_good, null), parents);
|
||||
});
|
||||
|
||||
test('_currentParents', () => {
|
||||
element.revision = {
|
||||
commit: {parents: [{commit: '123', subject: 'abc'}]},
|
||||
const revision = parent => {
|
||||
return {commit: {parents: [{commit: parent, subject: 'abc'}]}};
|
||||
};
|
||||
assert.equal(element._currentParents[0].commit, '123');
|
||||
element.revision = {
|
||||
commit: {parents: [{commit: '12345', subject: 'abc'}]},
|
||||
element.change = {
|
||||
current_revision: '456',
|
||||
revisions: {456: revision('111')},
|
||||
};
|
||||
assert.equal(element._currentParents[0].commit, '12345');
|
||||
element.revision = revision('222');
|
||||
assert.equal(element._currentParents[0].commit, '222');
|
||||
element.revision = revision('333');
|
||||
assert.equal(element._currentParents[0].commit, '333');
|
||||
element.revision = null;
|
||||
assert.equal(element._currentParents[0].commit, '111');
|
||||
element.change = {current_revision: null};
|
||||
assert.deepEqual(element._currentParents, []);
|
||||
});
|
||||
|
||||
test('_computeParentsLabel', () => {
|
||||
|
||||
@@ -96,8 +96,8 @@ def declare_nongoogle_deps():
|
||||
# and httpasyncclient as necessary.
|
||||
maven_jar(
|
||||
name = "elasticsearch-rest-client",
|
||||
artifact = "org.elasticsearch.client:elasticsearch-rest-client:7.7.1",
|
||||
sha1 = "6d44a8e35c11df6883747200bcf46f476a1782b8",
|
||||
artifact = "org.elasticsearch.client:elasticsearch-rest-client:7.8.0",
|
||||
sha1 = "ab28f6110bdc7d2ec886e1d6ff29a6c8ee30b883",
|
||||
)
|
||||
|
||||
maven_jar(
|
||||
|
||||
Reference in New Issue
Block a user