Skip to content

Commit bef45ad

Browse files
authored
Quiet test logs, deprecation warning per module (#5355)
1 parent 8ea447e commit bef45ad

24 files changed

Lines changed: 107 additions & 37 deletions

‎.github/actions/prepare-for-build/action.yml‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ runs:
1919
using: "composite"
2020
steps:
2121
- name: Set up Java (${{ inputs.java-distribution }}, ${{ inputs.java-version }})"
22-
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
22+
uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1
2323
with:
2424
distribution: ${{ inputs.java-distribution }}
2525
java-version: ${{ inputs.java-version }}
2626
java-package: jdk
2727

2828
- name: Cache gradle-wrapper.jar
29-
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
29+
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
3030
with:
3131
path: gradle/wrapper/gradle-wrapper.jar
3232
key: gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.jar.sha256') }}
@@ -38,3 +38,8 @@ runs:
3838
# increase expiry time for the temp. develocity token.
3939
# https://github.com/gradle/actions/blob/main/docs/setup-gradle.md#increasing-the-expiry-time-for-develocity-access-tokens
4040
develocity-token-expiry: 8
41+
# the default omits "wrapper", so the distribution zip is downloaded on every run
42+
gradle-home-cache-includes: |
43+
caches
44+
notifications
45+
wrapper

‎.github/workflows/docker-nightly.yml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ jobs:
9797
uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6.3.0
9898
with:
9999
develocity-token-expiry: 8
100+
# the default omits "wrapper", so the distribution zip is downloaded on every run
101+
gradle-home-cache-includes: |
102+
caches
103+
notifications
104+
wrapper
100105
101106
- name: Create custom gradle.properties
102107
run: |

‎gradle/java/javac.gradle‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@
1717

1818
// Configure Java project defaults.
1919

20+
// Projects that compile free of deprecation warnings and so can keep -Xlint:deprecation on.
21+
// Everywhere else javac prints an unsuppressable "uses or overrides a deprecated API" note
22+
// instead; move a project here once its warnings are gone.
23+
def deprecationLintProjects = [
24+
":solr:api",
25+
":solr:solrj",
26+
]
27+
2028
allprojects {
2129
plugins.withType(JavaPlugin) {
2230
java {
@@ -38,7 +46,7 @@ allprojects {
3846
tasks.withType(JavaCompile) {
3947
options.encoding = "UTF-8"
4048
options.compilerArgs += [
41-
"-Xlint:-deprecation",
49+
deprecationLintProjects.contains(project.path) ? "-Xlint:deprecation" : "-Xlint:-deprecation",
4250
"-Xlint:-serial",
4351
"-Xlint:cast",
4452
"-Xlint:classfile",

‎gradle/testing/randomization/policies/solr-tests.policy‎

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,12 @@ grant {
189189
permission java.net.NetPermission "requestPasswordAuthentication";
190190

191191
// for java.net.http.HttpClient. See HttpJdkSolrClientTest
192-
permission "java.net.URLPermission" "http://127.0.0.1:*/solr/-", "HEAD,GET,PUT,POST:*";
193-
permission "java.net.URLPermission" "https://127.0.0.1:*/solr/-", "HEAD,GET,PUT,POST:*";
194-
permission "java.net.URLPermission" "socket://127.0.0.1:*", "CONNECT:*";
192+
// JDK-8305346: a URLPermission with a numeric IPv4 host cannot be parsed while the policy is
193+
// bootstrapping, so such a grant is dropped with a warning; the SocketPermissions above are what
194+
// actually confine these to loopback, so the host is a wildcard here.
195+
permission "java.net.URLPermission" "http://*:*/solr/-", "HEAD,GET,PUT,POST:*";
196+
permission "java.net.URLPermission" "https://*:*/solr/-", "HEAD,GET,PUT,POST:*";
197+
permission "java.net.URLPermission" "socket://*:*", "CONNECT:*";
195198

196199
permission "java.net.URLPermission" "http://localhost:*/solr/-", "HEAD,GET,PUT,POST:*";
197200
permission "java.net.URLPermission" "https://localhost:*/solr/-", "HEAD,GET,PUT,POST:*";
@@ -202,8 +205,8 @@ grant {
202205
permission "java.net.URLPermission" "socket://[::1]:*", "CONNECT:*";
203206

204207
// for java.net.http.HttpClient. See ConcurrentUpdateJdkSolrClientTest
205-
permission "java.net.URLPermission" "http://127.0.0.1:*/noOneThere/-", "HEAD,GET,PUT,POST:*";
206-
permission "java.net.URLPermission" "https://127.0.0.1:*/noOneThere/-", "HEAD,GET,PUT,POST:*";
208+
permission "java.net.URLPermission" "http://*:*/noOneThere/-", "HEAD,GET,PUT,POST:*";
209+
permission "java.net.URLPermission" "https://*:*/noOneThere/-", "HEAD,GET,PUT,POST:*";
207210
permission "java.net.URLPermission" "http://localhost:*/noOneThere/-", "HEAD,GET,PUT,POST:*";
208211
permission "java.net.URLPermission" "https://localhost:*/noOneThere/-", "HEAD,GET,PUT,POST:*";
209212
permission "java.net.URLPermission" "http://[::1]:*/noOneThere/-", "HEAD,GET,PUT,POST:*";
@@ -292,4 +295,8 @@ grant {
292295

293296
grant {
294297
permission jdk.jfr.FlightRecorderPermission "accessFlightRecorder";
298+
// OtelRuntimeJvmMetrics opens a JFR recording stream for the JVM metrics
299+
permission jdk.jfr.FlightRecorderPermission "registerEvent";
300+
permission java.lang.RuntimePermission "accessClassInPackage.jdk.jfr.internal.event";
301+
permission java.lang.RuntimePermission "accessClassInPackage.jdk.internal.event";
295302
};

‎solr/api/src/java/org/apache/solr/client/api/model/AddPackageVersionRequestBody.java‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,15 @@
2424
public class AddPackageVersionRequestBody {
2525

2626
@JsonProperty("version")
27-
@Schema(description = "The version string for this package version.", required = true)
27+
@Schema(
28+
description = "The version string for this package version.",
29+
requiredMode = Schema.RequiredMode.REQUIRED)
2830
public String version;
2931

3032
@JsonProperty("files")
3133
@Schema(
3234
description = "File paths from the file store to include in this version.",
33-
required = true)
35+
requiredMode = Schema.RequiredMode.REQUIRED)
3436
public List<String> files;
3537

3638
@JsonProperty("manifest")

‎solr/api/src/java/org/apache/solr/client/api/model/AddReplicaPropertyRequestBody.java‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ public AddReplicaPropertyRequestBody(String value) {
2727
this.value = value;
2828
}
2929

30-
@Schema(description = "The value to assign to the property.", required = true)
30+
@Schema(
31+
description = "The value to assign to the property.",
32+
requiredMode = Schema.RequiredMode.REQUIRED)
3133
@JsonProperty("value")
3234
public String value;
3335

‎solr/api/src/java/org/apache/solr/client/api/model/RenameCoreRequestBody.java‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
import io.swagger.v3.oas.annotations.media.Schema;
2121

2222
public class RenameCoreRequestBody {
23-
@Schema(description = "The new name for the Solr core.", required = true)
23+
@Schema(
24+
description = "The new name for the Solr core.",
25+
requiredMode = Schema.RequiredMode.REQUIRED)
2426
@JsonProperty
2527
public String to;
2628

‎solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpJdkSolrClient.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,7 @@ private synchronized boolean maybeTryHeadRequestSync(URI uriNoQueryParams) {
473473
return headSucceeded;
474474
}
475475

476+
@SuppressWarnings("deprecation") // getContext() has no replacement yet; see SOLR-14720
476477
private void decorateRequest(HttpRequest.Builder reqb, SolrRequest<?> solrRequest) {
477478
reqb.timeout(Duration.of(requestTimeoutMillis, ChronoUnit.MILLIS));
478479

‎solr/solrj/src/java/org/apache/solr/client/solrj/request/CollectionAdminRequest.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ public RequestStatusState processAndWait(String asyncId, SolrClient client, long
261261
}
262262

263263
@Override
264+
@SuppressWarnings("deprecation") // the parameter itself is on its way out; see SOLR-17712
264265
public SolrParams getParams() {
265266
ModifiableSolrParams params = new ModifiableSolrParams(super.getParams());
266267
if (asyncId != null) {

‎solr/solrj/src/resources/java-template/api.mustache‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,8 @@ public class {{classname}} {
189189
* @param {{name}} {{description}}
190190
*/
191191
{{/description}}
192+
// the model field this writes to may itself be deprecated
193+
@SuppressWarnings("deprecation")
192194
public void {{setter}}({{{dataType}}} {{name}}) {
193195
this.requestBody.{{name}} = {{name}};
194196
}

0 commit comments

Comments
 (0)