Skip to content

Commit ed6652b

Browse files
committed
Merge tag 'github-api-1.325' into release/v1.x-unbridged
github-api-1.325
2 parents 13610e7 + 90e1b6f commit ed6652b

File tree

23 files changed

+8789
-38
lines changed

23 files changed

+8789
-38
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ jobs:
4141
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
4242

4343
steps:
44+
- name: Set up JDK
45+
uses: actions/setup-java@v2
46+
with:
47+
distribution: 'temurin'
48+
java-version: 17
49+
4450
- name: Checkout repository
4551
uses: actions/checkout@v4
4652

.github/workflows/maven-build.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,14 @@ jobs:
6060
run: mvn -B clean site -D enable-ci --file pom.xml
6161
test:
6262
name: test (${{ matrix.os }}, Java ${{ matrix.java }})
63+
# Does not require build output, but orders execution to prevent launching test workflows when simple build fails
64+
needs: build
6365
runs-on: ${{ matrix.os }}-latest
6466
strategy:
6567
fail-fast: false
6668
matrix:
6769
os: [ ubuntu, windows ]
68-
java: [ 11, 17 ]
70+
java: [ 17, 21 ]
6971
steps:
7072
- uses: actions/checkout@v4
7173
- name: Set up JDK
@@ -128,3 +130,22 @@ jobs:
128130
cache: 'maven'
129131
- name: Maven Test (no build) Java 8
130132
run: mvn -B surefire:test -DfailIfNoTests -Dsurefire.excludesFile=src/test/resources/slow-or-flaky-tests.txt
133+
134+
test-java-11:
135+
name: test Java 11 (no-build)
136+
needs: build
137+
runs-on: ubuntu-latest
138+
steps:
139+
- uses: actions/checkout@v4
140+
- uses: actions/download-artifact@v4
141+
with:
142+
name: maven-target-directory
143+
path: target
144+
- name: Set up JDK
145+
uses: actions/setup-java@v4
146+
with:
147+
java-version: 8
148+
distribution: 'temurin'
149+
cache: 'maven'
150+
- name: Maven Test (no build) Java 11
151+
run: mvn -B surefire:test -DfailIfNoTests -Dsurefire.excludesFile=src/test/resources/slow-or-flaky-tests.txt

pom.xml

Lines changed: 48 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<modelVersion>4.0.0</modelVersion>
33
<groupId>org.kohsuke</groupId>
44
<artifactId>github-api</artifactId>
5-
<version>1.324</version>
5+
<version>1.325</version>
66
<name>GitHub API for Java</name>
77
<url>https://github-api.kohsuke.org/</url>
88
<description>GitHub API for Java</description>
@@ -32,11 +32,12 @@
3232
</distributionManagement>
3333

3434
<properties>
35+
<spring.boot.version>3.3.3</spring.boot.version>
3536
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
3637
<spotbugs-maven-plugin.version>4.8.6.1</spotbugs-maven-plugin.version>
3738
<spotbugs.version>4.8.6</spotbugs.version>
3839
<spotbugs-maven-plugin.failOnError>true</spotbugs-maven-plugin.failOnError>
39-
<hamcrest.version>2.2</hamcrest.version>
40+
<hamcrest.version>3.0</hamcrest.version>
4041
<okhttp3.version>4.12.0</okhttp3.version>
4142
<okio.version>3.9.0</okio.version>
4243
<!-- Using this as the minimum bar for code coverage. Adding methods without covering them will fail this. -->
@@ -84,12 +85,12 @@
8485
<plugin>
8586
<groupId>org.codehaus.mojo</groupId>
8687
<artifactId>versions-maven-plugin</artifactId>
87-
<version>2.16.2</version>
88+
<version>2.17.1</version>
8889
</plugin>
8990
<plugin>
9091
<groupId>org.apache.maven.plugins</groupId>
9192
<artifactId>maven-help-plugin</artifactId>
92-
<version>3.4.0</version>
93+
<version>3.5.0</version>
9394
</plugin>
9495
<plugin>
9596
<artifactId>maven-surefire-plugin</artifactId>
@@ -225,7 +226,7 @@
225226
<plugin>
226227
<groupId>org.apache.maven.plugins</groupId>
227228
<artifactId>maven-javadoc-plugin</artifactId>
228-
<version>3.7.0</version>
229+
<version>3.8.0</version>
229230
<configuration>
230231
<release>8</release>
231232
<failOnWarnings>true</failOnWarnings>
@@ -243,33 +244,27 @@
243244
<autoReleaseAfterClose>true</autoReleaseAfterClose>
244245
</configuration>
245246
</plugin>
246-
<plugin>
247-
<groupId>org.codehaus.mojo</groupId>
248-
<artifactId>animal-sniffer-maven-plugin</artifactId>
249-
<version>1.22</version>
250-
<configuration>
251-
<signature>
252-
<groupId>org.codehaus.mojo.signature</groupId>
253-
<artifactId>java18</artifactId>
254-
<version>1.0</version>
255-
</signature>
256-
<ignores>
257-
java.net.http.*
258-
</ignores>
259-
</configuration>
260-
<executions>
261-
<execution>
262-
<id>ensure-java-1.8-class-library</id>
263-
<phase>test</phase>
264-
<goals>
265-
<goal>check</goal>
266-
</goals>
267-
</execution>
268-
</executions>
269-
</plugin>
270247
</plugins>
271248
</pluginManagement>
272249
<plugins>
250+
<!--
251+
This plugin is used to generate AOT metadata during tests so that it can be
252+
compared against those in META-INF/native-image/org.kohsuke/github-api/*.
253+
The tests are located in src/test/java/org.kohsuke.aot
254+
-->
255+
<plugin>
256+
<groupId>org.springframework.boot</groupId>
257+
<artifactId>spring-boot-maven-plugin</artifactId>
258+
<version>${spring.boot.version}</version>
259+
<executions>
260+
<execution>
261+
<id>process-test-aot</id>
262+
<goals>
263+
<goal>process-test-aot</goal>
264+
</goals>
265+
</execution>
266+
</executions>
267+
</plugin>
273268
<plugin>
274269
<groupId>org.apache.maven.plugins</groupId>
275270
<artifactId>maven-site-plugin</artifactId>
@@ -278,7 +273,7 @@
278273
<plugin>
279274
<groupId>org.apache.maven.plugins</groupId>
280275
<artifactId>maven-release-plugin</artifactId>
281-
<version>3.1.0</version>
276+
<version>3.1.1</version>
282277
<configuration>
283278
<autoVersionSubmodules>true</autoVersionSubmodules>
284279
<useReleaseProfile>false</useReleaseProfile>
@@ -293,7 +288,7 @@
293288
<plugin>
294289
<groupId>org.apache.maven.plugins</groupId>
295290
<artifactId>maven-project-info-reports-plugin</artifactId>
296-
<version>3.6.1</version>
291+
<version>3.7.0</version>
297292
<dependencies>
298293
<dependency>
299294
<groupId>org.apache.bcel</groupId>
@@ -465,7 +460,7 @@
465460
<dependency>
466461
<groupId>com.fasterxml.jackson</groupId>
467462
<artifactId>jackson-bom</artifactId>
468-
<version>2.17.1</version>
463+
<version>2.17.2</version>
469464
<scope>import</scope>
470465
<type>pom</type>
471466
</dependency>
@@ -490,6 +485,16 @@
490485
<version>${hamcrest.version}</version>
491486
<scope>test</scope>
492487
</dependency>
488+
<!--
489+
This plugin is used to start a spring boot application during tests
490+
to generate AOT metadata. See also spring-boot-maven-plugin
491+
-->
492+
<dependency>
493+
<groupId>org.springframework.boot</groupId>
494+
<artifactId>spring-boot-starter-test</artifactId>
495+
<version>${spring.boot.version}</version>
496+
<scope>test</scope>
497+
</dependency>
493498
<!-- This is needed in order to force junit4 and JTH tests to use newer hamcrest version -->
494499
<dependency>
495500
<groupId>org.hamcrest</groupId>
@@ -518,7 +523,14 @@
518523
<dependency>
519524
<groupId>org.awaitility</groupId>
520525
<artifactId>awaitility</artifactId>
521-
<version>4.2.1</version>
526+
<version>4.2.2</version>
527+
<scope>test</scope>
528+
</dependency>
529+
<!-- junit vintage engine is used because junit4 and junit5 tests are required -->
530+
<dependency>
531+
<groupId>org.junit.vintage</groupId>
532+
<artifactId>junit-vintage-engine</artifactId>
533+
<version>5.10.2</version>
522534
<scope>test</scope>
523535
</dependency>
524536
<dependency>
@@ -528,7 +540,7 @@
528540
<dependency>
529541
<groupId>commons-io</groupId>
530542
<artifactId>commons-io</artifactId>
531-
<version>2.8.0</version>
543+
<version>2.16.1</version>
532544
</dependency>
533545
<dependency>
534546
<groupId>com.infradna.tool</groupId>
@@ -622,7 +634,7 @@
622634
<dependency>
623635
<groupId>org.mockito</groupId>
624636
<artifactId>mockito-core</artifactId>
625-
<version>4.11.0</version>
637+
<version>5.13.0</version>
626638
<scope>test</scope>
627639
</dependency>
628640
<dependency>
@@ -646,7 +658,7 @@
646658
<dependency>
647659
<groupId>org.slf4j</groupId>
648660
<artifactId>slf4j-simple</artifactId>
649-
<version>2.0.13</version>
661+
<version>2.0.16</version>
650662
<scope>test</scope>
651663
</dependency>
652664
</dependencies>

src/main/java/org/kohsuke/github/GHLicense.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public class GHLicense extends GHObject {
4949

5050
/** The name. */
5151
// these fields are always present, even in the short form
52-
protected String key, name;
52+
protected String key, name, spdxId;
5353

5454
/** The featured. */
5555
// the rest is only after populated
@@ -85,6 +85,15 @@ public String getName() {
8585
return name;
8686
}
8787

88+
/**
89+
* Gets SPDX ID.
90+
*
91+
* @return the spdx id
92+
*/
93+
public String getSpdxId() {
94+
return spdxId;
95+
}
96+
8897
/**
8998
* Featured licenses are bold in the new repository drop-down.
9099
*

src/main/java/org/kohsuke/github/GHRepository.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3685,6 +3685,21 @@ public PagedIterable<GHRepositoryRule> listRulesForBranch(String branch) throws
36853685
.toIterable(GHRepositoryRule[].class, null);
36863686
}
36873687

3688+
/**
3689+
* Check, if vulnerability alerts are enabled for this repository
3690+
* (https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#check-if-vulnerability-alerts-are-enabled-for-a-repository).
3691+
*
3692+
* @return true, if vulnerability alerts are enabled
3693+
* @throws IOException
3694+
* the io exception
3695+
*/
3696+
public boolean isVulnerabilityAlertsEnabled() throws IOException {
3697+
return root().createRequest()
3698+
.method("GET")
3699+
.withUrlPath(getApiTailUrl("/vulnerability-alerts"))
3700+
.fetchHttpStatusCode() == 204;
3701+
}
3702+
36883703
/**
36893704
* A {@link GHRepositoryBuilder} that allows multiple properties to be updated per request.
36903705
*

src/main/java/org/kohsuke/github/GHUser.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ public Optional<String> getLdapDn() throws IOException {
275275
* on error
276276
*/
277277
public Date getSuspendedAt() throws IOException {
278+
super.populate();
278279
return GitHubClient.parseDate(suspendedAt);
279280
}
280281

0 commit comments

Comments
 (0)