Skip to content

Commit eeff849

Browse files
committed
Merge tag 'github-api-1.323' into release/v1.x
github-api-1.323
2 parents 2c2e8fb + 7aa31d5 commit eeff849

File tree

3,021 files changed

+10259
-7145
lines changed

Some content is hidden

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

3,021 files changed

+10259
-7145
lines changed

.github/workflows/maven-build.yml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches:
66
- main
7+
- main-2.x
78
- '!/refs/heads/dependabot/*'
89
pull_request:
910
branches:
@@ -84,9 +85,30 @@ jobs:
8485
env:
8586
MAVEN_OPTS: ${{ env.JAVA_11_PLUS_MAVEN_OPTS }}
8687
run: mvn -B clean install -D enable-ci --file pom.xml "-Dsurefire.argLine=--add-opens java.base/java.net=ALL-UNNAMED"
87-
- name: Codecov Report
88+
- name: Save coverage data
8889
if: matrix.os == 'ubuntu' && matrix.java == '17'
89-
uses: codecov/[email protected]
90+
uses: actions/upload-artifact@v4
91+
with:
92+
name: maven-test-target-directory
93+
path: target/
94+
retention-days: 3
95+
codecov-upload:
96+
name: codecov-upload (Upload to codecov.io)
97+
needs: test
98+
runs-on: ubuntu-latest
99+
steps:
100+
- uses: actions/checkout@v4
101+
- uses: actions/download-artifact@v4
102+
with:
103+
name: maven-test-target-directory
104+
path: target
105+
- name: Codecov Report
106+
uses: codecov/[email protected]
107+
with:
108+
# Codecov token from https://app.codecov.io/gh/hub4j/github-api/settings
109+
token: ${{ secrets.CODECOV_TOKEN }}
110+
fail_ci_if_error: true
111+
verbose: true
90112

91113
test-java-8:
92114
name: test Java 8 (no-build)

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Run `mvn spotless:apply` to fix any formatting, etc issues.
88

99
If the following does not succeed, you will not pass the pull request checks.
1010

11-
`mvn -D enable-ci clean install site`
11+
`mvn -D enable-ci clean install site "-Dsurefire.argLine=--add-opens java.base/java.net=ALL-UNNAMED"`
1212

1313
## Using WireMock and Snapshots
1414

pom.xml

Lines changed: 24 additions & 25 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.322</version>
5+
<version>1.323</version>
66
<name>GitHub API for Java</name>
77
<url>https://github-api.kohsuke.org/</url>
88
<description>GitHub API for Java</description>
@@ -33,18 +33,18 @@
3333

3434
<properties>
3535
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
36-
<spotbugs-maven-plugin.version>4.8.1.0</spotbugs-maven-plugin.version>
37-
<spotbugs.version>4.7.3</spotbugs.version>
36+
<spotbugs-maven-plugin.version>4.8.6.1</spotbugs-maven-plugin.version>
37+
<spotbugs.version>4.8.6</spotbugs.version>
3838
<spotbugs-maven-plugin.failOnError>true</spotbugs-maven-plugin.failOnError>
3939
<hamcrest.version>2.2</hamcrest.version>
40-
<okhttp3.version>4.9.2</okhttp3.version>
41-
<okio.version>3.7.0</okio.version>
40+
<okhttp3.version>4.12.0</okhttp3.version>
41+
<okio.version>3.9.0</okio.version>
4242
<!-- Using this as the minimum bar for code coverage. Adding methods without covering them will fail this. -->
4343
<jacoco.coverage.target.bundle.method>0.70</jacoco.coverage.target.bundle.method>
4444
<jacoco.coverage.target.class.method>0.50</jacoco.coverage.target.class.method>
4545
<!-- For non-ci builds we'd like the build to still complete if jacoco metrics aren't met. -->
4646
<jacoco.haltOnFailure>false</jacoco.haltOnFailure>
47-
<jjwt.suite.version>0.12.5</jjwt.suite.version>
47+
<jjwt.suite.version>0.12.6</jjwt.suite.version>
4848

4949
<jacoco.surefire.argLine />
5050
<surefire.argLine />
@@ -55,12 +55,12 @@
5555
<extension>
5656
<groupId>org.apache.maven.scm</groupId>
5757
<artifactId>maven-scm-provider-gitexe</artifactId>
58-
<version>1.13.0</version>
58+
<version>2.1.0</version>
5959
</extension>
6060
<extension>
6161
<groupId>org.apache.maven.scm</groupId>
6262
<artifactId>maven-scm-manager-plexus</artifactId>
63-
<version>2.0.1</version>
63+
<version>2.1.0</version>
6464
</extension>
6565
<!-- Doing site publishing manually for now -->
6666
<!--
@@ -102,17 +102,17 @@
102102
<plugin>
103103
<groupId>org.apache.maven.plugins</groupId>
104104
<artifactId>maven-source-plugin</artifactId>
105-
<version>3.3.0</version>
105+
<version>3.3.1</version>
106106
</plugin>
107107
<plugin>
108108
<groupId>org.apache.maven.plugins</groupId>
109109
<artifactId>maven-gpg-plugin</artifactId>
110-
<version>3.1.0</version>
110+
<version>3.2.4</version>
111111
</plugin>
112112
<plugin>
113113
<groupId>org.jacoco</groupId>
114114
<artifactId>jacoco-maven-plugin</artifactId>
115-
<version>0.8.11</version>
115+
<version>0.8.12</version>
116116
<configuration>
117117
<!-- no need to get data about external code. It dramatically reduces performance of JaCoCo for nothing -->
118118
<excludes>
@@ -190,7 +190,6 @@
190190
<exclude>org.kohsuke.github.GHCompare.User</exclude>
191191

192192
<!-- TODO: Some coverage, but more needed -->
193-
<exclude>org.kohsuke.github.GHPullRequestReviewBuilder.DraftReviewComment</exclude>
194193
<exclude>org.kohsuke.github.GHIssue.PullRequest</exclude>
195194
<exclude>org.kohsuke.github.GHCommitSearchBuilder</exclude>
196195
<exclude>org.kohsuke.github.GHRepositorySearchBuilder</exclude>
@@ -223,7 +222,7 @@
223222
<plugin>
224223
<groupId>org.apache.maven.plugins</groupId>
225224
<artifactId>maven-javadoc-plugin</artifactId>
226-
<version>3.6.3</version>
225+
<version>3.7.0</version>
227226
<configuration>
228227
<release>8</release>
229228
<failOnWarnings>true</failOnWarnings>
@@ -276,7 +275,7 @@
276275
<plugin>
277276
<groupId>org.apache.maven.plugins</groupId>
278277
<artifactId>maven-release-plugin</artifactId>
279-
<version>2.5.3</version>
278+
<version>3.1.0</version>
280279
<configuration>
281280
<autoVersionSubmodules>true</autoVersionSubmodules>
282281
<useReleaseProfile>false</useReleaseProfile>
@@ -291,18 +290,18 @@
291290
<plugin>
292291
<groupId>org.apache.maven.plugins</groupId>
293292
<artifactId>maven-project-info-reports-plugin</artifactId>
294-
<version>3.5.0</version>
293+
<version>3.6.1</version>
295294
<dependencies>
296295
<dependency>
297296
<groupId>org.apache.bcel</groupId>
298297
<artifactId>bcel</artifactId>
299-
<version>6.8.2</version>
298+
<version>6.9.0</version>
300299
</dependency>
301300
</dependencies>
302301
</plugin>
303302
<plugin>
304303
<artifactId>maven-compiler-plugin</artifactId>
305-
<version>3.10.1</version>
304+
<version>3.13.0</version>
306305
<configuration>
307306
<source>1.8</source>
308307
<target>1.8</target>
@@ -350,7 +349,7 @@
350349
<plugin>
351350
<groupId>org.apache.maven.plugins</groupId>
352351
<artifactId>maven-jar-plugin</artifactId>
353-
<version>3.4.1</version>
352+
<version>3.4.2</version>
354353
<configuration>
355354
<archive>
356355
<manifestEntries>
@@ -473,7 +472,7 @@
473472
<dependency>
474473
<groupId>com.fasterxml.jackson</groupId>
475474
<artifactId>jackson-bom</artifactId>
476-
<version>2.15.3</version>
475+
<version>2.17.1</version>
477476
<scope>import</scope>
478477
<type>pom</type>
479478
</dependency>
@@ -484,12 +483,12 @@
484483
<dependency>
485484
<groupId>org.apache.commons</groupId>
486485
<artifactId>commons-lang3</artifactId>
487-
<version>3.9</version>
486+
<version>3.14.0</version>
488487
</dependency>
489488
<dependency>
490489
<groupId>com.tngtech.archunit</groupId>
491490
<artifactId>archunit</artifactId>
492-
<version>1.2.0</version>
491+
<version>1.3.0</version>
493492
<scope>test</scope>
494493
</dependency>
495494
<dependency>
@@ -624,7 +623,7 @@
624623
<dependency>
625624
<groupId>org.kohsuke</groupId>
626625
<artifactId>wordnet-random-name</artifactId>
627-
<version>1.5</version>
626+
<version>1.6</version>
628627
<scope>test</scope>
629628
</dependency>
630629
<dependency>
@@ -648,13 +647,13 @@
648647
<dependency>
649648
<groupId>com.google.code.gson</groupId>
650649
<artifactId>gson</artifactId>
651-
<version>2.10.1</version>
650+
<version>2.11.0</version>
652651
<scope>test</scope>
653652
</dependency>
654653
<dependency>
655654
<groupId>org.slf4j</groupId>
656655
<artifactId>slf4j-simple</artifactId>
657-
<version>2.0.7</version>
656+
<version>2.0.13</version>
658657
<scope>test</scope>
659658
</dependency>
660659
</dependencies>
@@ -842,7 +841,7 @@
842841
<plugin>
843842
<groupId>org.apache.maven.plugins</groupId>
844843
<artifactId>maven-enforcer-plugin</artifactId>
845-
<version>3.2.1</version>
844+
<version>3.5.0</version>
846845
<executions>
847846
<execution>
848847
<id>enforce-jacoco-exist</id>

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package org.kohsuke.github;
22

3+
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
4+
35
import java.io.IOException;
46

57
import javax.annotation.CheckForNull;
@@ -75,6 +77,7 @@ abstract class AbstractBuilder<R, S> extends GitHubInteractiveObject {
7577
* @param baseInstance
7678
* optional instance on which to base this builder.
7779
*/
80+
@SuppressFBWarnings(value = { "CT_CONSTRUCTOR_THROW" }, justification = "argument validation, internal class")
7881
protected AbstractBuilder(@Nonnull Class<R> finalReturnType,
7982
@Nonnull Class<S> intermediateReturnType,
8083
@Nonnull GitHub root,

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

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
import java.util.Map;
1212
import java.util.stream.Collectors;
1313

14-
import static org.kohsuke.github.internal.Previews.MACHINE_MAN;
15-
1614
// TODO: Auto-generated Javadoc
1715
/**
1816
* A Github App.
@@ -208,7 +206,6 @@ public void setPermissions(Map<String, String> permissions) {
208206
* @return a list of App installations
209207
* @see <a href="https://developer.github.com/v3/apps/#list-installations">List installations</a>
210208
*/
211-
@Preview(MACHINE_MAN)
212209
public PagedIterable<GHAppInstallation> listInstallations() {
213210
return listInstallations(null);
214211
}
@@ -223,9 +220,8 @@ public PagedIterable<GHAppInstallation> listInstallations() {
223220
* @return a list of App installations since a given time.
224221
* @see <a href="https://developer.github.com/v3/apps/#list-installations">List installations</a>
225222
*/
226-
@Preview(MACHINE_MAN)
227223
public PagedIterable<GHAppInstallation> listInstallations(final Date since) {
228-
Requester requester = root().createRequest().withPreview(MACHINE_MAN).withUrlPath("/app/installations");
224+
Requester requester = root().createRequest().withUrlPath("/app/installations");
229225
if (since != null) {
230226
requester.with("since", GitHubClient.printDate(since));
231227
}
@@ -244,10 +240,8 @@ public PagedIterable<GHAppInstallation> listInstallations(final Date since) {
244240
* on error
245241
* @see <a href="https://developer.github.com/v3/apps/#get-an-installation">Get an installation</a>
246242
*/
247-
@Preview(MACHINE_MAN)
248243
public GHAppInstallation getInstallationById(long id) throws IOException {
249244
return root().createRequest()
250-
.withPreview(MACHINE_MAN)
251245
.withUrlPath(String.format("/app/installations/%d", id))
252246
.fetch(GHAppInstallation.class);
253247
}
@@ -265,10 +259,8 @@ public GHAppInstallation getInstallationById(long id) throws IOException {
265259
* @see <a href="https://developer.github.com/v3/apps/#get-an-organization-installation">Get an organization
266260
* installation</a>
267261
*/
268-
@Preview(MACHINE_MAN)
269262
public GHAppInstallation getInstallationByOrganization(String name) throws IOException {
270263
return root().createRequest()
271-
.withPreview(MACHINE_MAN)
272264
.withUrlPath(String.format("/orgs/%s/installation", name))
273265
.fetch(GHAppInstallation.class);
274266
}
@@ -288,10 +280,8 @@ public GHAppInstallation getInstallationByOrganization(String name) throws IOExc
288280
* @see <a href="https://developer.github.com/v3/apps/#get-a-repository-installation">Get a repository
289281
* installation</a>
290282
*/
291-
@Preview(MACHINE_MAN)
292283
public GHAppInstallation getInstallationByRepository(String ownerName, String repositoryName) throws IOException {
293284
return root().createRequest()
294-
.withPreview(MACHINE_MAN)
295285
.withUrlPath(String.format("/repos/%s/%s/installation", ownerName, repositoryName))
296286
.fetch(GHAppInstallation.class);
297287
}
@@ -308,10 +298,8 @@ public GHAppInstallation getInstallationByRepository(String ownerName, String re
308298
* on error
309299
* @see <a href="https://developer.github.com/v3/apps/#get-a-user-installation">Get a user installation</a>
310300
*/
311-
@Preview(MACHINE_MAN)
312301
public GHAppInstallation getInstallationByUser(String name) throws IOException {
313302
return root().createRequest()
314-
.withPreview(MACHINE_MAN)
315303
.withUrlPath(String.format("/users/%s/installation", name))
316304
.fetch(GHAppInstallation.class);
317305
}

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

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
import java.util.List;
66
import java.util.Map;
77

8-
import static org.kohsuke.github.internal.Previews.MACHINE_MAN;
9-
108
// TODO: Auto-generated Javadoc
119
/**
1210
* Creates a access token for a GitHub App Installation.
@@ -108,12 +106,8 @@ public GHAppCreateTokenBuilder permissions(Map<String, GHPermissionType> permiss
108106
* @throws IOException
109107
* on error
110108
*/
111-
@Preview(MACHINE_MAN)
112109
public GHAppInstallationToken create() throws IOException {
113-
return builder.method("POST")
114-
.withPreview(MACHINE_MAN)
115-
.withUrlPath(apiUrlTail)
116-
.fetch(GHAppInstallationToken.class);
110+
return builder.method("POST").withUrlPath(apiUrlTail).fetch(GHAppInstallationToken.class);
117111
}
118112

119113
}

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

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212
import java.util.Map;
1313
import java.util.stream.Collectors;
1414

15-
import static org.kohsuke.github.internal.Previews.GAMBIT;
16-
import static org.kohsuke.github.internal.Previews.MACHINE_MAN;
17-
1815
// TODO: Auto-generated Javadoc
1916
/**
2017
* A Github App Installation.
@@ -135,11 +132,10 @@ public String getRepositoriesUrl() {
135132
* {@link GHAuthenticatedAppInstallation#listRepositories()}.
136133
*/
137134
@Deprecated
138-
@Preview(MACHINE_MAN)
139135
public PagedSearchIterable<GHRepository> listRepositories() {
140136
GitHubRequest request;
141137

142-
request = root().createRequest().withPreview(MACHINE_MAN).withUrlPath("/installation/repositories").build();
138+
request = root().createRequest().withUrlPath("/installation/repositories").build();
143139

144140
return new PagedSearchIterable<>(root(), request, GHAppInstallationRepositoryResult.class);
145141
}
@@ -342,13 +338,8 @@ public GHUser getSuspendedBy() {
342338
* on error
343339
* @see <a href="https://developer.github.com/v3/apps/#delete-an-installation">Delete an installation</a>
344340
*/
345-
@Preview(GAMBIT)
346341
public void deleteInstallation() throws IOException {
347-
root().createRequest()
348-
.method("DELETE")
349-
.withPreview(GAMBIT)
350-
.withUrlPath(String.format("/app/installations/%d", getId()))
351-
.send();
342+
root().createRequest().method("DELETE").withUrlPath(String.format("/app/installations/%d", getId())).send();
352343
}
353344

354345
/**

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
package org.kohsuke.github;
22

3+
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
4+
35
// TODO: Auto-generated Javadoc
46
/**
57
* Represents the one page of artifacts result when listing artifacts.
68
*/
9+
@SuppressFBWarnings(value = { "UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD", "UWF_UNWRITTEN_FIELD", "NP_UNWRITTEN_FIELD" },
10+
justification = "JSON API")
711
class GHArtifactsPage {
812
private int total_count;
913
private GHArtifact[] artifacts;

0 commit comments

Comments
 (0)