Skip to content

Commit 441e937

Browse files
committed
Modernize
1 parent 2fafa01 commit 441e937

13 files changed

+136
-110
lines changed

Diff for: build.gradle

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
plugins {
22
id "checkstyle"
33
id "java"
4-
id "io.spring.javaformat" version "0.0.35"
5-
id "org.springframework.boot" version "3.0.1"
4+
id "io.spring.javaformat" version "0.0.43"
5+
id "org.springframework.boot" version "3.4.2"
66
}
77

88
group = "io.spring.issuebot"
@@ -15,21 +15,21 @@ dependencies {
1515
annotationProcessor(platform(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES))
1616
annotationProcessor("org.springframework.boot:spring-boot-configuration-processor")
1717

18-
checkstyle("io.spring.javaformat:spring-javaformat-checkstyle:0.0.35")
18+
checkstyle("io.spring.javaformat:spring-javaformat-checkstyle:0.0.43")
1919

2020
implementation(platform(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES))
2121
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310")
2222
implementation("org.apache.httpcomponents.client5:httpclient5")
2323
implementation("org.springframework.boot:spring-boot-starter-web")
2424

25-
runtimeOnly(platform("com.azure.spring:spring-cloud-azure-dependencies:4.5.0"))
25+
runtimeOnly(platform("com.azure.spring:spring-cloud-azure-dependencies:5.20.0"))
2626
runtimeOnly("com.azure.spring:spring-cloud-azure-starter-keyvault-secrets")
2727

2828
testImplementation("org.springframework.boot:spring-boot-starter-test")
2929
}
3030

3131
checkstyle {
32-
toolVersion = "10.6.0"
32+
toolVersion = "10.21.2"
3333
}
3434

3535
java {

Diff for: gradle/wrapper/gradle-wrapper.jar

868 Bytes
Binary file not shown.

Diff for: gradle/wrapper/gradle-wrapper.properties

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip
4+
networkTimeout=10000
45
zipStoreBase=GRADLE_USER_HOME
56
zipStorePath=wrapper/dists

Diff for: gradlew

+8-4
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
# Darwin, MinGW, and NonStop.
5656
#
5757
# (3) This script is generated from the Groovy template
58-
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
58+
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
5959
# within the Gradle project.
6060
#
6161
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -80,10 +80,10 @@ do
8080
esac
8181
done
8282

83-
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
84-
85-
APP_NAME="Gradle"
83+
# This is normally unused
84+
# shellcheck disable=SC2034
8685
APP_BASE_NAME=${0##*/}
86+
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
8787

8888
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
8989
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
@@ -143,12 +143,16 @@ fi
143143
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
144144
case $MAX_FD in #(
145145
max*)
146+
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
147+
# shellcheck disable=SC3045
146148
MAX_FD=$( ulimit -H -n ) ||
147149
warn "Could not query maximum file descriptor limit"
148150
esac
149151
case $MAX_FD in #(
150152
'' | soft) :;; #(
151153
*)
154+
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
155+
# shellcheck disable=SC3045
152156
ulimit -n "$MAX_FD" ||
153157
warn "Could not set maximum file descriptor limit to $MAX_FD"
154158
esac

Diff for: gradlew.bat

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ if "%OS%"=="Windows_NT" setlocal
2626

2727
set DIRNAME=%~dp0
2828
if "%DIRNAME%"=="" set DIRNAME=.
29+
@rem This is normally unused
2930
set APP_BASE_NAME=%~n0
3031
set APP_HOME=%DIRNAME%
3132

Diff for: settings.gradle

+1-22
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,13 @@ pluginManagement {
22
repositories {
33
mavenCentral()
44
gradlePluginPortal()
5-
maven {
6-
url "https://repo.spring.io/release"
7-
content {
8-
includeGroup("io.spring.ge.conventions")
9-
}
10-
}
115
}
126
}
137

148
plugins {
15-
id "com.gradle.enterprise" version "3.12.1"
16-
id "io.spring.ge.conventions" version "0.0.12"
9+
id "io.spring.develocity.conventions" version "0.0.22"
1710
}
1811

1912
rootProject.name="issue-bot"
2013

2114
enableFeaturePreview("STABLE_CONFIGURATION_CACHE")
22-
23-
settings.gradle.projectsLoaded {
24-
gradleEnterprise {
25-
buildScan {
26-
def buildDir = settings.gradle.rootProject.getBuildDir()
27-
buildDir.mkdirs()
28-
new File(buildDir, "build-scan-uri.txt").text = "build scan not generated"
29-
buildScanPublished { scan ->
30-
buildDir.mkdirs()
31-
new File(buildDir, "build-scan-uri.txt").text = "<${scan.buildScanUri}|build scan>\n"
32-
}
33-
}
34-
}
35-
}

Diff for: src/main/java/io/spring/issuebot/feedback/FeedbackIssueListener.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2015-2020 the original author or authors.
2+
* Copyright 2015-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -56,11 +56,11 @@ final class FeedbackIssueListener implements IssueListener {
5656
this.gitHub = gitHub;
5757
this.labelName = labelName;
5858
this.repositoryCollaborators = repositories.stream()
59-
.collect(Collectors.toMap(Function.identity(), (repository) -> {
60-
List<String> collaborators = new ArrayList<>(repository.getCollaborators());
61-
collaborators.add(username);
62-
return collaborators;
63-
}));
59+
.collect(Collectors.toMap(Function.identity(), (repository) -> {
60+
List<String> collaborators = new ArrayList<>(repository.getCollaborators());
61+
collaborators.add(username);
62+
return collaborators;
63+
}));
6464
this.feedbackListener = feedbackListener;
6565
}
6666

Diff for: src/main/java/io/spring/issuebot/github/GitHubTemplate.java

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2015-2023 the original author or authors.
2+
* Copyright 2015-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -23,6 +23,7 @@
2323
import java.nio.charset.Charset;
2424
import java.nio.charset.StandardCharsets;
2525
import java.util.Arrays;
26+
import java.util.Base64;
2627
import java.util.Collections;
2728
import java.util.Date;
2829
import java.util.HashMap;
@@ -50,7 +51,6 @@
5051
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
5152
import org.springframework.http.converter.HttpMessageNotReadableException;
5253
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
53-
import org.springframework.util.Base64Utils;
5454
import org.springframework.util.StreamUtils;
5555
import org.springframework.util.StringUtils;
5656
import org.springframework.web.client.DefaultResponseErrorHandler;
@@ -106,10 +106,10 @@ public void handleError(ClientHttpResponse response) throws IOException {
106106
}
107107
});
108108
HttpClient httpClient = HttpClientBuilder.create()
109-
.setConnectionManager(PoolingHttpClientConnectionManagerBuilder.create()
110-
.setDefaultSocketConfig(SocketConfig.custom().setSoTimeout(Timeout.ofSeconds(30)).build())
111-
.build())
112-
.build();
109+
.setConnectionManager(PoolingHttpClientConnectionManagerBuilder.create()
110+
.setDefaultSocketConfig(SocketConfig.custom().setSoTimeout(Timeout.ofSeconds(30)).build())
111+
.build())
112+
.build();
113113
BufferingClientHttpRequestFactory bufferingClient = new BufferingClientHttpRequestFactory(
114114
new HttpComponentsClientHttpRequestFactory(httpClient));
115115
rest.setRequestFactory(bufferingClient);
@@ -151,8 +151,8 @@ private String getNextUrl(ResponseEntity<?> response) {
151151
public Issue addLabel(Issue issue, String labelName) {
152152
URI uri = URI.create(issue.getLabelsUrl().replace("{/name}", ""));
153153
log.info("Adding label {} to {}", labelName, uri);
154-
ResponseEntity<Label[]> response = this.rest.exchange(
155-
new RequestEntity<>(Collections.singletonList(labelName), HttpMethod.POST, uri), Label[].class);
154+
ResponseEntity<Label[]> response = this.rest
155+
.exchange(new RequestEntity<>(Collections.singletonList(labelName), HttpMethod.POST, uri), Label[].class);
156156
if (response.getStatusCode() != HttpStatus.OK) {
157157
log.warn("Failed to add label to issue. Response status: " + response.getStatusCode());
158158
}
@@ -193,7 +193,7 @@ public Issue close(Issue issue, ClosureReason closureReason) {
193193
body.put("state_reason", closureReason.getStateReason());
194194
}
195195
ResponseEntity<Issue> response = this.rest
196-
.exchange(new RequestEntity<>(body, HttpMethod.PATCH, URI.create(issue.getUrl())), Issue.class);
196+
.exchange(new RequestEntity<>(body, HttpMethod.PATCH, URI.create(issue.getUrl())), Issue.class);
197197
if (response.getStatusCode() != HttpStatus.OK) {
198198
log.warn("Failed to close issue. Response status: " + response.getStatusCode());
199199
}
@@ -248,7 +248,7 @@ private static class BasicAuthorizationInterceptor implements ClientHttpRequestI
248248
@Override
249249
public ClientHttpResponse intercept(HttpRequest request, byte[] body, ClientHttpRequestExecution execution)
250250
throws IOException {
251-
String token = Base64Utils.encodeToString((this.username + ":" + this.password).getBytes(UTF_8));
251+
String token = Base64.getEncoder().encodeToString((this.username + ":" + this.password).getBytes(UTF_8));
252252
request.getHeaders().add("Authorization", "Basic " + token);
253253
return execution.execute(request, body);
254254
}

Diff for: src/main/java/io/spring/issuebot/triage/OpenedByCollaboratorTriageFilter.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2015-2019 the original author or authors.
2+
* Copyright 2015-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -40,7 +40,7 @@ final class OpenedByCollaboratorTriageFilter implements TriageFilter {
4040

4141
OpenedByCollaboratorTriageFilter(List<Repository> repositories) {
4242
this.repositoryCollaborators = repositories.stream()
43-
.collect(Collectors.toMap(Function.identity(), Repository::getCollaborators));
43+
.collect(Collectors.toMap(Function.identity(), Repository::getCollaborators));
4444
}
4545

4646
@Override

0 commit comments

Comments
 (0)