Skip to content

Commit 71c5351

Browse files
committed
Merge branch 'main' into fix-ipinfo-module-access
2 parents ad2abd9 + 2d180d2 commit 71c5351

File tree

268 files changed

+8005
-3156
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

268 files changed

+8005
-3156
lines changed

build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/transport/TransportVersionGenerationFuncTest.groovy

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,4 +513,19 @@ class TransportVersionGenerationFuncTest extends AbstractTransportVersionFuncTes
513513
assertGenerateAndValidateSuccess(result)
514514
assertUpperBound("9.2", "existing_92,8123000")
515515
}
516+
517+
def "generation cannot run on release branch"() {
518+
given:
519+
file("myserver/build.gradle") << """
520+
tasks.named('generateTransportVersion') {
521+
currentUpperBoundName = '9.1'
522+
}
523+
"""
524+
525+
when:
526+
def result = runGenerateTask().buildAndFail()
527+
528+
then:
529+
assertGenerateFailure(result, "Transport version generation cannot run on release branches")
530+
}
516531
}

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/transport/GenerateTransportVersionDefinitionTask.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,12 @@ public abstract class GenerateTransportVersionDefinitionTask extends DefaultTask
9696
@TaskAction
9797
public void run() throws IOException {
9898
TransportVersionResourcesService resources = getResourceService().get();
99+
List<TransportVersionUpperBound> upstreamUpperBounds = resources.getUpperBoundsFromGitBase();
100+
boolean onReleaseBranch = resources.checkIfDefinitelyOnReleaseBranch(upstreamUpperBounds, getCurrentUpperBoundName().get());
101+
if (onReleaseBranch) {
102+
throw new IllegalArgumentException("Transport version generation cannot run on release branches");
103+
}
104+
99105
Set<String> referencedNames = TransportVersionReference.collectNames(getReferencesFiles());
100106
Set<String> changedDefinitionNames = resources.getChangedReferableDefinitionNames();
101107
String targetDefinitionName = getTargetDefinitionName(resources, referencedNames, changedDefinitionNames);
@@ -109,7 +115,7 @@ public void run() throws IOException {
109115
resetAllUpperBounds(resources, idsByBase);
110116
} else {
111117
getLogger().lifecycle("Generating transport version name: " + targetDefinitionName);
112-
List<TransportVersionUpperBound> upstreamUpperBounds = resources.getUpperBoundsFromGitBase();
118+
113119
Set<String> targetUpperBoundNames = getTargetUpperBoundNames(resources, upstreamUpperBounds, targetDefinitionName);
114120

115121
List<TransportVersionId> ids = updateUpperBounds(

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/transport/TransportVersionResourcesService.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import java.nio.file.Files;
2626
import java.nio.file.Path;
2727
import java.util.ArrayList;
28+
import java.util.Collection;
2829
import java.util.Collections;
2930
import java.util.Comparator;
3031
import java.util.HashMap;
@@ -259,6 +260,20 @@ private Path getUpperBoundRelativePath(String name) {
259260
return UPPER_BOUNDS_DIR.resolve(name + ".csv");
260261
}
261262

263+
boolean checkIfDefinitelyOnReleaseBranch(Collection<TransportVersionUpperBound> upperBounds, String currentUpperBoundName) {
264+
// only want to look at definitions <= the current upper bound.
265+
// TODO: we should filter all of the upper bounds/definitions that are validated by this, not just in this method
266+
TransportVersionUpperBound currentUpperBound = upperBounds.stream()
267+
.filter(u -> u.name().equals(currentUpperBoundName))
268+
.findFirst()
269+
.orElse(null);
270+
if (currentUpperBound == null) {
271+
// since there is no current upper bound, we don't know if we are on a release branch
272+
return false;
273+
}
274+
return upperBounds.stream().anyMatch(u -> u.definitionId().complete() > currentUpperBound.definitionId().complete());
275+
}
276+
262277
private String getBaseRefName() {
263278
if (baseRefName.get() == null) {
264279
synchronized (baseRefName) {

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/transport/ValidateTransportVersionResourcesTask.java

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public void validateTransportVersions() throws IOException {
8484
Map<Integer, List<IdAndDefinition>> idsByBase = resources.getIdsByBase();
8585
Map<String, TransportVersionUpperBound> upperBounds = resources.getUpperBounds();
8686
TransportVersionUpperBound currentUpperBound = upperBounds.get(getCurrentUpperBoundName().get());
87-
boolean onReleaseBranch = checkIfDefinitelyOnReleaseBranch(upperBounds);
87+
boolean onReleaseBranch = resources.checkIfDefinitelyOnReleaseBranch(upperBounds.values(), getCurrentUpperBoundName().get());
8888
boolean validateModifications = onReleaseBranch == false || getCI().get();
8989

9090
for (var definition : referableDefinitions.values()) {
@@ -330,15 +330,6 @@ private void validatePrimaryIds(
330330
);
331331
}
332332

333-
private boolean checkIfDefinitelyOnReleaseBranch(Map<String, TransportVersionUpperBound> upperBounds) {
334-
// only want to look at definitions <= the current upper bound.
335-
// TODO: we should filter all of the upper bounds/definitions that are validated by this, not just in this method
336-
String currentUpperBoundName = getCurrentUpperBoundName().get();
337-
TransportVersionUpperBound currentUpperBound = upperBounds.get(currentUpperBoundName);
338-
339-
return upperBounds.values().stream().anyMatch(u -> u.definitionId().complete() > currentUpperBound.definitionId().complete());
340-
}
341-
342333
private void throwDefinitionFailure(TransportVersionDefinition definition, String message) {
343334
Path relativePath = getResources().get().getDefinitionPath(definition);
344335
throw new VerificationException("Transport version definition file [" + relativePath + "] " + message);

docs/changelog/135231.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 135231
2+
summary: Improve retrying PIT contexts for read-only indices
3+
area: Search
4+
type: enhancement
5+
issues: []

docs/changelog/136632.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 136632
2+
summary: Field caps transport changes to return for each original expression what
3+
it was resolved to
4+
area: Search
5+
type: enhancement
6+
issues: []

docs/changelog/137023.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 137023
2+
summary: Support choosing the downsampling method in data stream lifecycle
3+
area: "Data streams"
4+
type: enhancement
5+
issues: []

docs/changelog/137220.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 137220
2+
summary: Skip dataframes when disabled
3+
area: Machine Learning
4+
type: bug
5+
issues: []

docs/changelog/137302.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 137302
2+
summary: Add audit log testing for cert-based cross-cluster authentication
3+
area: Security
4+
type: enhancement
5+
issues: []

docs/changelog/137331.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 137331
2+
summary: Add ES93BloomFilterStoredFieldsFormat for efficient field existence checks
3+
area: TSDB
4+
type: enhancement
5+
issues: []

0 commit comments

Comments
 (0)