Skip to content

Commit c0b65f3

Browse files
authored
Merge branch 'main' into data-stream-settings-rest-action
2 parents d30e656 + f492bb9 commit c0b65f3

File tree

44 files changed

+527
-136
lines changed

Some content is hidden

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

44 files changed

+527
-136
lines changed

docs/changelog/127563.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 127563
2+
summary: "ESQL: Avoid unintended attribute removal"
3+
area: ES|QL
4+
type: bug
5+
issues:
6+
- 127468

docs/changelog/128161.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 128161
2+
summary: Fix system data streams incorrectly showing up in the list of template validation
3+
problems
4+
area: Data streams
5+
type: bug
6+
issues: []

docs/reference/query-languages/esql/esql-functions-operators.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,56 +12,67 @@ mapped_pages:
1212
## Functions overview [esql-functions]
1313

1414
::::{dropdown} Aggregate functions
15+
:open:
1516
:::{include} _snippets/lists/aggregation-functions.md
1617
:::
1718
::::
1819

1920
::::{dropdown} Grouping functions
21+
:open:
2022
:::{include} _snippets/lists/grouping-functions.md
2123
:::
2224
::::
2325

2426
::::{dropdown} Conditional functions and expressions
27+
:open:
2528
:::{include} _snippets/lists/conditional-functions-and-expressions.md
2629
:::
2730
::::
2831

2932
::::{dropdown} Date and time functions
33+
:open:
3034
:::{include} _snippets/lists/date-time-functions.md
3135
:::
3236
::::
3337

3438
::::{dropdown} IP functions
39+
:open:
3540
:::{include} _snippets/lists/ip-functions.md
3641
:::
3742
::::
3843

3944
::::{dropdown} Math functions
45+
:open:
4046
:::{include} _snippets/lists/math-functions.md
4147
:::
4248
::::
4349

4450
::::{dropdown} Search functions
51+
:open:
4552
:::{include} _snippets/lists/search-functions.md
4653
:::
4754
::::
4855

4956
::::{dropdown} Spatial functions
57+
:open:
5058
:::{include} _snippets/lists/spatial-functions.md
5159
:::
5260
::::
5361

5462
::::{dropdown} String functions
63+
:open:
5564
:::{include} _snippets/lists/string-functions.md
5665
:::
5766
::::
5867

5968
::::{dropdown} Type conversion functions
69+
:open:
6070
:::{include} _snippets/lists/type-conversion-functions.md
6171
:::
6272
::::
6373

6474
::::{dropdown} Multi value functions
75+
:open:
6576
:::{include} _snippets/lists/mv-functions.md
6677
:::
6778
::::
@@ -70,6 +81,7 @@ mapped_pages:
7081
## Operators overview [esql-operators-overview]
7182

7283
::::{dropdown} Operators
84+
:open:
7385
:::{include} _snippets/lists/operators.md
7486
:::
7587
::::

libs/entitlement/src/main/java/org/elasticsearch/entitlement/bootstrap/EntitlementBootstrap.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@ public record BootstrapArgs(
4343
Function<Class<?>, PolicyManager.PolicyScope> scopeResolver,
4444
PathLookup pathLookup,
4545
Map<String, Path> sourcePaths,
46-
Set<Class<?>> suppressFailureLogClasses
46+
Set<Package> suppressFailureLogPackages
4747
) {
4848
public BootstrapArgs {
4949
requireNonNull(pluginPolicies);
5050
requireNonNull(scopeResolver);
5151
requireNonNull(pathLookup);
5252
requireNonNull(sourcePaths);
53-
requireNonNull(suppressFailureLogClasses);
53+
requireNonNull(suppressFailureLogPackages);
5454
}
5555
}
5656

@@ -78,7 +78,7 @@ public static BootstrapArgs bootstrapArgs() {
7878
* @param tempDir the temp directory for Elasticsearch
7979
* @param logsDir the log directory for Elasticsearch
8080
* @param pidFile path to a pid file for Elasticsearch, or {@code null} if one was not specified
81-
* @param suppressFailureLogClasses classes for which we do not need or want to log Entitlements failures
81+
* @param suppressFailureLogPackages packages for which we do not need or want to log Entitlements failures
8282
*/
8383
public static void bootstrap(
8484
Policy serverPolicyPatch,
@@ -95,7 +95,7 @@ public static void bootstrap(
9595
Path logsDir,
9696
Path tempDir,
9797
Path pidFile,
98-
Set<Class<?>> suppressFailureLogClasses
98+
Set<Package> suppressFailureLogPackages
9999
) {
100100
logger.debug("Loading entitlement agent");
101101
if (EntitlementBootstrap.bootstrapArgs != null) {
@@ -119,7 +119,7 @@ public static void bootstrap(
119119
settingResolver
120120
),
121121
sourcePaths,
122-
suppressFailureLogClasses
122+
suppressFailureLogPackages
123123
);
124124
exportInitializationToAgent();
125125
loadAgent(findAgentJar());

libs/entitlement/src/main/java/org/elasticsearch/entitlement/initialization/EntitlementInitialization.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ private static PolicyManager createPolicyManager() {
9090
EntitlementBootstrap.bootstrapArgs().sourcePaths(),
9191
ENTITLEMENTS_MODULE,
9292
pathLookup,
93-
bootstrapArgs.suppressFailureLogClasses()
93+
bootstrapArgs.suppressFailureLogPackages()
9494
);
9595
}
9696

libs/entitlement/src/main/java/org/elasticsearch/entitlement/runtime/policy/PolicyManager.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ ModuleEntitlements policyEntitlements(String componentName, Path componentPath,
256256
private final Map<String, Map<String, List<Entitlement>>> pluginsEntitlements;
257257
private final Function<Class<?>, PolicyScope> scopeResolver;
258258
private final PathLookup pathLookup;
259-
private final Set<Class<?>> mutedClasses;
259+
private final Set<Package> suppressFailureLogPackages;
260260

261261
public static final String ALL_UNNAMED = "ALL-UNNAMED";
262262

@@ -311,7 +311,7 @@ public PolicyManager(
311311
Map<String, Path> sourcePaths,
312312
Module entitlementsModule,
313313
PathLookup pathLookup,
314-
Set<Class<?>> suppressFailureLogClasses
314+
Set<Package> suppressFailureLogPackages
315315
) {
316316
this.serverEntitlements = buildScopeEntitlementsMap(requireNonNull(serverPolicy));
317317
this.apmAgentEntitlements = apmAgentEntitlements;
@@ -322,7 +322,7 @@ public PolicyManager(
322322
this.sourcePaths = sourcePaths;
323323
this.entitlementsModule = entitlementsModule;
324324
this.pathLookup = requireNonNull(pathLookup);
325-
this.mutedClasses = suppressFailureLogClasses;
325+
this.suppressFailureLogPackages = suppressFailureLogPackages;
326326

327327
List<ExclusiveFileEntitlement> exclusiveFileEntitlements = new ArrayList<>();
328328
for (var e : serverEntitlements.entrySet()) {
@@ -688,8 +688,8 @@ public void checkWriteProperty(Class<?> callerClass, String property) {
688688

689689
private void notEntitled(String message, Class<?> callerClass, ModuleEntitlements entitlements) {
690690
var exception = new NotEntitledException(message);
691-
// Don't emit a log for muted classes, e.g. classes containing self tests
692-
if (mutedClasses.contains(callerClass) == false) {
691+
// Don't emit a log for suppressed packages, e.g. packages containing self tests
692+
if (suppressFailureLogPackages.contains(callerClass.getPackage()) == false) {
693693
entitlements.logger().warn("Not entitled: {}", message, exception);
694694
}
695695
throw exception;

libs/entitlement/src/main/java/org/elasticsearch/entitlement/runtime/policy/PolicyUtils.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ public static Map<String, Policy> createPluginPolicies(
8181
return pluginPolicies;
8282
}
8383

84+
/**
85+
* @throws PolicyParserException if the supplied policy is formatted incorrectly
86+
* @throws IllegalStateException for any other error parsing the patch, such as nonexistent module names
87+
*/
8488
public static Policy parseEncodedPolicyIfExists(
8589
String encodedPolicy,
8690
String version,
@@ -106,11 +110,8 @@ public static Policy parseEncodedPolicyIfExists(
106110
version
107111
);
108112
}
109-
} catch (Exception ex) {
110-
logger.warn(
111-
Strings.format("Found a policy patch with invalid content. The patch will not be applied. Layer [%s]", layerName),
112-
ex
113-
);
113+
} catch (Exception e) {
114+
throw new IllegalStateException("Unable to parse policy patch for layer [" + layerName + "]", e);
114115
}
115116
}
116117
return null;

libs/entitlement/src/test/java/org/elasticsearch/entitlement/runtime/policy/PolicyUtilsTests.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ public void testNoPatchWithVersionMismatch() {
134134

135135
public void testNoPatchWithValidationError() {
136136

137+
// Nonexistent module names
137138
var policyPatch = """
138139
versions:
139140
- 9.0.0
@@ -149,13 +150,15 @@ public void testNoPatchWithValidationError() {
149150
StandardCharsets.UTF_8
150151
);
151152

152-
var policy = PolicyUtils.parseEncodedPolicyIfExists(base64EncodedPolicy, "9.0.0", true, "test-plugin", Set.of());
153-
154-
assertThat(policy, nullValue());
153+
assertThrows(
154+
IllegalStateException.class,
155+
() -> PolicyUtils.parseEncodedPolicyIfExists(base64EncodedPolicy, "9.0.0", true, "test-plugin", Set.of())
156+
);
155157
}
156158

157159
public void testNoPatchWithParsingError() {
158160

161+
// no <version> or <policy> field
159162
var policyPatch = """
160163
entitlement-module-name:
161164
- load_native_libraries
@@ -167,9 +170,10 @@ public void testNoPatchWithParsingError() {
167170
StandardCharsets.UTF_8
168171
);
169172

170-
var policy = PolicyUtils.parseEncodedPolicyIfExists(base64EncodedPolicy, "9.0.0", true, "test-plugin", Set.of());
171-
172-
assertThat(policy, nullValue());
173+
assertThrows(
174+
IllegalStateException.class,
175+
() -> PolicyUtils.parseEncodedPolicyIfExists(base64EncodedPolicy, "9.0.0", true, "test-plugin", Set.of())
176+
);
173177
}
174178

175179
public void testMergeScopes() {

muted-tests.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -438,9 +438,6 @@ tests:
438438
- class: org.elasticsearch.xpack.esql.qa.multi_node.EsqlSpecIT
439439
method: test {lookup-join.MvJoinKeyOnTheLookupIndex ASYNC}
440440
issue: https://github.com/elastic/elasticsearch/issues/128030
441-
- class: org.elasticsearch.compute.aggregation.PercentileIntGroupingAggregatorFunctionTests
442-
method: testManyInitialManyPartialFinalRunner
443-
issue: https://github.com/elastic/elasticsearch/issues/128092
444441
- class: org.elasticsearch.packaging.test.DockerTests
445442
method: test042KeystorePermissionsAreCorrect
446443
issue: https://github.com/elastic/elasticsearch/issues/128018
@@ -453,6 +450,18 @@ tests:
453450
- class: org.elasticsearch.packaging.test.DockerTests
454451
method: test041AmazonCaCertsAreInTheKeystore
455452
issue: https://github.com/elastic/elasticsearch/issues/128006
453+
- class: org.elasticsearch.packaging.test.DockerTests
454+
method: test130JavaHasCorrectOwnership
455+
issue: https://github.com/elastic/elasticsearch/issues/128174
456+
- class: org.elasticsearch.packaging.test.DockerTests
457+
method: test600Interrupt
458+
issue: https://github.com/elastic/elasticsearch/issues/128144
459+
- class: org.elasticsearch.packaging.test.EnrollmentProcessTests
460+
method: test20DockerAutoFormCluster
461+
issue: https://github.com/elastic/elasticsearch/issues/128113
462+
- class: org.elasticsearch.packaging.test.DockerTests
463+
method: test121CanUseStackLoggingConfig
464+
issue: https://github.com/elastic/elasticsearch/issues/128165
456465

457466
# Examples:
458467
#

rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.repository_verify_integrity.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"description":"Verifies the integrity of the contents of a snapshot repository"
66
},
77
"stability":"experimental",
8-
"visibility":"private",
8+
"visibility":"public",
99
"headers": {
1010
"accept": [
1111
"application/json"

0 commit comments

Comments
 (0)