Skip to content

Commit fdf6b3f

Browse files
jasontedorandyb-elasticTim-BrooksChristoph Büscherjavanna
authored
Add 7.1 version constant to 7.x branch (#38513)
This commit adds the 7.1 version constant to the 7.x branch. Co-authored-by: Andy Bristol <[email protected]> Co-authored-by: Tim Brooks <[email protected]> Co-authored-by: Christoph Büscher <[email protected]> Co-authored-by: Luca Cavanna <[email protected]> Co-authored-by: markharwood <[email protected]> Co-authored-by: Ioannis Kakavas <[email protected]> Co-authored-by: Nhat Nguyen <[email protected]> Co-authored-by: David Roberts <[email protected]> Co-authored-by: Jason Tedor <[email protected]> Co-authored-by: Alpar Torok <[email protected]> Co-authored-by: David Turner <[email protected]> Co-authored-by: Martijn van Groningen <[email protected]> Co-authored-by: Tim Vernum <[email protected]> Co-authored-by: Albert Zaharovits <[email protected]>
1 parent 70956f6 commit fdf6b3f

File tree

23 files changed

+409
-274
lines changed

23 files changed

+409
-274
lines changed

buildSrc/src/main/java/org/elasticsearch/gradle/VersionCollection.java

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -171,30 +171,38 @@ public UnreleasedVersionInfo unreleasedInfo(Version version) {
171171
}
172172

173173
public void forPreviousUnreleased(Consumer<UnreleasedVersionInfo> consumer) {
174-
getUnreleased().stream()
174+
List<UnreleasedVersionInfo> collect = getUnreleased().stream()
175175
.filter(version -> version.equals(currentVersion) == false)
176-
.forEach(version -> consumer.accept(
177-
new UnreleasedVersionInfo(
176+
.map(version -> new UnreleasedVersionInfo(
178177
version,
179178
getBranchFor(version),
180179
getGradleProjectNameFor(version)
181180
)
182-
));
181+
)
182+
.collect(Collectors.toList());
183+
184+
collect.forEach(uvi -> consumer.accept(uvi));
183185
}
184186

185187
private String getGradleProjectNameFor(Version version) {
186188
if (version.equals(currentVersion)) {
187189
throw new IllegalArgumentException("The Gradle project to build " + version + " is the current build.");
188190
}
191+
189192
Map<Integer, List<Version>> releasedMajorGroupedByMinor = getReleasedMajorGroupedByMinor();
190193

191194
if (version.getRevision() == 0) {
192-
if (releasedMajorGroupedByMinor
193-
.get(releasedMajorGroupedByMinor.keySet().stream().max(Integer::compareTo).orElse(0))
194-
.contains(version)) {
195-
return "minor";
195+
List<Version> unreleasedStagedOrMinor = getUnreleased().stream()
196+
.filter(v -> v.getRevision() == 0)
197+
.collect(Collectors.toList());
198+
if (unreleasedStagedOrMinor.size() > 2) {
199+
if (unreleasedStagedOrMinor.get(unreleasedStagedOrMinor.size() - 2).equals(version)) {
200+
return "minor";
201+
} else{
202+
return "staged";
203+
}
196204
} else {
197-
return "staged";
205+
return "minor";
198206
}
199207
} else {
200208
if (releasedMajorGroupedByMinor
@@ -239,8 +247,10 @@ public List<Version> getUnreleased() {
239247
unreleased.add(getLatestVersionByKey(groupByMinor, greatestMinor - 1));
240248
if (groupByMinor.getOrDefault(greatestMinor - 1, emptyList()).size() == 1) {
241249
// we found that the previous minor is staged but not yet released
242-
// in this case, the minor before that has a bugfix
243-
unreleased.add(getLatestVersionByKey(groupByMinor, greatestMinor - 2));
250+
// in this case, the minor before that has a bugfix, should there be such a minor
251+
if (greatestMinor >= 2) {
252+
unreleased.add(getLatestVersionByKey(groupByMinor, greatestMinor - 2));
253+
}
244254
}
245255
}
246256

buildSrc/src/test/java/org/elasticsearch/gradle/VersionCollectionTests.java

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ public class VersionCollectionTests extends GradleUnitTestCase {
8181
"6_0_0", "6_0_1", "6_1_0", "6_1_1", "6_1_2", "6_1_3", "6_1_4", "6_2_0", "6_2_1", "6_2_2", "6_2_3",
8282
"6_2_4", "6_3_0", "6_3_1", "6_3_2", "6_4_0", "6_4_1", "6_4_2"
8383
));
84+
sampleVersions.put("7.1.0", asList(
85+
"7_1_0", "7_0_0", "6_7_0", "6_6_1", "6_6_0"
86+
));
8487
}
8588

8689
@Test(expected = IllegalArgumentException.class)
@@ -145,6 +148,11 @@ public void testWireCompatible() {
145148
singletonList("7.3.0"),
146149
getVersionCollection("8.0.0").getWireCompatible()
147150
);
151+
assertVersionsEquals(
152+
asList("6.7.0", "7.0.0"),
153+
getVersionCollection("7.1.0").getWireCompatible()
154+
);
155+
148156
}
149157

150158
public void testWireCompatibleUnreleased() {
@@ -171,6 +179,10 @@ public void testWireCompatibleUnreleased() {
171179
singletonList("7.3.0"),
172180
getVersionCollection("8.0.0").getUnreleasedWireCompatible()
173181
);
182+
assertVersionsEquals(
183+
asList("6.7.0", "7.0.0"),
184+
getVersionCollection("7.1.0").getWireCompatible()
185+
);
174186
}
175187

176188
public void testIndexCompatible() {
@@ -286,7 +298,7 @@ public void testGetBranch() {
286298
getVersionCollection("6.4.2")
287299
);
288300
assertUnreleasedBranchNames(
289-
asList("5.6", "6.4", "6.5"),
301+
asList("5.6", "6.4", "6.x"),
290302
getVersionCollection("6.6.0")
291303
);
292304
assertUnreleasedBranchNames(
@@ -309,13 +321,17 @@ public void testGetGradleProjectName() {
309321
getVersionCollection("6.4.2")
310322
);
311323
assertUnreleasedGradleProjectNames(
312-
asList("maintenance", "bugfix", "staged"),
324+
asList("maintenance", "bugfix", "minor"),
313325
getVersionCollection("6.6.0")
314326
);
315327
assertUnreleasedGradleProjectNames(
316328
asList("bugfix", "staged", "minor"),
317329
getVersionCollection("8.0.0")
318330
);
331+
assertUnreleasedGradleProjectNames(
332+
asList("staged", "minor"),
333+
getVersionCollection("7.1.0")
334+
);
319335
}
320336

321337
public void testCompareToAuthoritative() {

buildSrc/version.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
elasticsearch = 7.0.0
1+
elasticsearch = 7.1.0
22
lucene = 8.0.0-snapshot-83f9835
33

44
# optional dependencies

distribution/bwc/build.gradle

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,12 @@ bwcVersions.forPreviousUnreleased { VersionCollection.UnreleasedVersionInfo unre
141141
extension += '.gz'
142142
}
143143
}
144+
if (bwcVersion.onOrAfter('7.0.0') && projectName.contains('deb')) {
145+
classifier = "-amd64"
146+
}
147+
if (bwcVersion.onOrAfter('7.0.0') && projectName.contains('rpm')) {
148+
classifier = "-x86_64"
149+
}
144150
if (bwcVersion.onOrAfter('6.3.0')) {
145151
baseDir += projectName.endsWith('zip') || projectName.endsWith('tar') ? '/archives' : '/packages'
146152
// add oss variant first

distribution/docker/src/docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ RUN groupadd -g 1000 elasticsearch && \
3131
WORKDIR /usr/share/elasticsearch
3232

3333
COPY ${elasticsearch} /opt/
34+
3435
RUN tar zxf /opt/${elasticsearch} --strip-components=1
3536
RUN mkdir -p config data logs
3637
RUN chmod 0775 config data logs
3738
COPY config/elasticsearch.yml config/log4j2.properties config/
3839

39-
4040
################################################################################
4141
# Build stage 1 (the actual elasticsearch image):
4242
# Copy elasticsearch from stage 0

docs/Versions.asciidoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
:version: 7.0.0-alpha2
1+
:version: 7.1.0
22
:major-version: 7.x
33
:lucene_version: 8.0.0
44
:lucene_version_path: 8_0_0
5-
:branch: master
5+
:branch: 7.x
66
:jdk: 1.8.0_131
77
:jdk_major: 8
88
:build_flavor: default

0 commit comments

Comments
 (0)