Skip to content

Commit 204587f

Browse files
authored
Merge pull request #1944 from bitwiseman/backport/main-1.x
Backport 2.0-alpha-2 changes 1.x
2 parents 52e725d + a0c87ae commit 204587f

File tree

193 files changed

+2324
-423
lines changed

Some content is hidden

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

193 files changed

+2324
-423
lines changed

.github/workflows/maven-build.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ jobs:
5757
- name: Maven Site
5858
env:
5959
MAVEN_OPTS: ${{ env.JAVA_11_PLUS_MAVEN_OPTS }}
60-
run: mvn -B clean site -D enable-ci --file pom.xml
60+
# running install site seems to more closely imitate real site deployment,
61+
# more likely to prevent failed deployment
62+
run: mvn -B clean install site -DskipTests --file pom.xml
6163
test:
6264
name: test (${{ matrix.os }}, Java ${{ matrix.java }})
6365
# Does not require build output, but orders execution to prevent launching test workflows when simple build fails
@@ -144,7 +146,7 @@ jobs:
144146
- name: Set up JDK
145147
uses: actions/setup-java@v4
146148
with:
147-
java-version: 8
149+
java-version: 11
148150
distribution: 'temurin'
149151
cache: 'maven'
150152
- name: Maven Test (no build) Java 11

.github/workflows/publish_release_branch.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
publish_gh_pages:
6060
runs-on: ubuntu-latest
6161
needs: build
62-
if: ${{ github.ref == 'refs/heads/release/v1.x' }}
62+
if: ${{ github.ref == 'refs/heads/release/v2.x' }}
6363
steps:
6464
- uses: actions/checkout@v4
6565
with:

pom.xml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<properties>
3535
<spring.boot.version>3.3.3</spring.boot.version>
3636
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
37-
<spotbugs-maven-plugin.version>4.8.6.1</spotbugs-maven-plugin.version>
37+
<spotbugs-maven-plugin.version>4.8.6.3</spotbugs-maven-plugin.version>
3838
<spotbugs.version>4.8.6</spotbugs.version>
3939
<spotbugs-maven-plugin.failOnError>true</spotbugs-maven-plugin.failOnError>
4040
<hamcrest.version>3.0</hamcrest.version>
@@ -94,7 +94,7 @@
9494
</plugin>
9595
<plugin>
9696
<artifactId>maven-surefire-plugin</artifactId>
97-
<version>3.2.3</version>
97+
<version>3.5.0</version>
9898
<configuration>
9999
<!-- SUREFIRE-1226 workaround -->
100100
<trimStackTrace>false</trimStackTrace>
@@ -108,7 +108,7 @@
108108
<plugin>
109109
<groupId>org.apache.maven.plugins</groupId>
110110
<artifactId>maven-gpg-plugin</artifactId>
111-
<version>3.2.4</version>
111+
<version>3.2.6</version>
112112
</plugin>
113113
<plugin>
114114
<groupId>org.jacoco</groupId>
@@ -223,7 +223,7 @@
223223
<plugin>
224224
<groupId>org.apache.maven.plugins</groupId>
225225
<artifactId>maven-javadoc-plugin</artifactId>
226-
<version>3.8.0</version>
226+
<version>3.10.0</version>
227227
<configuration>
228228
<release>8</release>
229229
<failOnWarnings>true</failOnWarnings>
@@ -247,7 +247,7 @@
247247
<!--
248248
This plugin is used to generate AOT metadata during tests so that it can be
249249
compared against those in META-INF/native-image/org.kohsuke/github-api/*.
250-
The tests are located in src/test/java/org.kohsuke.aot
250+
The tests are start with the name "Aot..."
251251
-->
252252
<plugin>
253253
<groupId>org.springframework.boot</groupId>
@@ -290,7 +290,7 @@
290290
<dependency>
291291
<groupId>org.apache.bcel</groupId>
292292
<artifactId>bcel</artifactId>
293-
<version>6.9.0</version>
293+
<version>6.10.0</version>
294294
</dependency>
295295
</dependencies>
296296
</plugin>
@@ -436,8 +436,16 @@
436436
<plugin>
437437
<groupId>com.github.siom79.japicmp</groupId>
438438
<artifactId>japicmp-maven-plugin</artifactId>
439-
<version>0.17.2</version>
439+
<version>0.23.0</version>
440440
<configuration>
441+
<oldVersion>
442+
<dependency>
443+
<groupId>${project.groupId}</groupId>
444+
<artifactId>${project.artifactId}</artifactId>
445+
<version>1.325</version>
446+
<type>jar</type>
447+
</dependency>
448+
</oldVersion>
441449
<parameter>
442450
<breakBuildOnBinaryIncompatibleModifications>true</breakBuildOnBinaryIncompatibleModifications>
443451
<onlyModified>true</onlyModified>
@@ -478,7 +486,7 @@
478486
<dependency>
479487
<groupId>org.apache.commons</groupId>
480488
<artifactId>commons-lang3</artifactId>
481-
<version>3.14.0</version>
489+
<version>3.17.0</version>
482490
</dependency>
483491
<dependency>
484492
<groupId>com.tngtech.archunit</groupId>

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

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import javax.annotation.CheckForNull;
88
import javax.annotation.Nonnull;
99

10-
// TODO: Auto-generated Javadoc
1110
/**
1211
* An abstract data object builder/updater.
1312
*
@@ -42,7 +41,7 @@
4241
* Intermediate return type for this builder returned by calls to {@link #with(String, Object)}. If {@link S}
4342
* the same as {@link R}, this builder will commit changes after each call to {@link #with(String, Object)}.
4443
*/
45-
abstract class AbstractBuilder<R, S> extends GitHubInteractiveObject {
44+
abstract class AbstractBuilder<R, S> extends GitHubInteractiveObject implements GitHubRequestBuilderDone<R> {
4645

4746
@Nonnull
4847
private final Class<R> returnType;
@@ -58,9 +57,9 @@ abstract class AbstractBuilder<R, S> extends GitHubInteractiveObject {
5857

5958
// TODO: Not sure how update-in-place behavior should be controlled
6059
// However, it certainly can be controlled dynamically down to the instance level or inherited for all children of
61-
// some
60+
// some connection.
61+
6262
/** The update in place. */
63-
// connection.
6463
protected boolean updateInPlace;
6564

6665
/**
@@ -96,14 +95,9 @@ protected AbstractBuilder(@Nonnull Class<R> finalReturnType,
9695
}
9796

9897
/**
99-
* Finishes an update, committing changes.
100-
*
101-
* This method may update-in-place or not. Either way it returns the resulting instance.
102-
*
103-
* @return an instance with updated current data
104-
* @throws IOException
105-
* if there is an I/O Exception
98+
* {@inheritDoc}
10699
*/
100+
@Override
107101
@Nonnull
108102
@BetaApi
109103
public R done() throws IOException {

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@
2525
@Deprecated
2626
public abstract class AbuseLimitHandler extends GitHubAbuseLimitHandler {
2727

28+
/**
29+
* Create default AbuseLimitHandler instance
30+
*/
31+
public AbuseLimitHandler() {
32+
}
33+
2834
/**
2935
* Called when the library encounters HTTP error indicating that the API abuse limit is reached.
3036
*
@@ -102,6 +108,9 @@ public void onError(IOException e, HttpURLConnection uc) throws IOException {
102108
}
103109
};
104110

111+
// If "Retry-After" missing, wait for unambiguously over one minute per GitHub guidance
112+
static long DEFAULT_WAIT_MILLIS = 61 * 1000;
113+
105114
/*
106115
* Exposed for testability. Given an http response, find the retry-after header field and parse it as either a
107116
* number or a date (the spec allows both). If no header is found, wait for a reasonably amount of time.
@@ -110,7 +119,7 @@ long parseWaitTime(HttpURLConnection uc) {
110119
String v = uc.getHeaderField("Retry-After");
111120
if (v == null) {
112121
// can't tell, wait for unambiguously over one minute per GitHub guidance
113-
return 61 * 1000;
122+
return DEFAULT_WAIT_MILLIS;
114123
}
115124

116125
try {

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@
2020
*/
2121
public class GHApp extends GHObject {
2222

23+
/**
24+
* Create default GHApp instance
25+
*/
26+
public GHApp() {
27+
}
28+
2329
private GHUser owner;
2430
private String name;
2531
private String slug;

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88
*/
99
public class GHAppFromManifest extends GHApp {
1010

11+
/**
12+
* Create default GHAppFromManifest instance
13+
*/
14+
public GHAppFromManifest() {
15+
}
16+
1117
private String clientId;
1218
private String clientSecret;
1319
private String webhookSecret;

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@
2424
* @see GHApp#getInstallationByUser(String) GHApp#getInstallationByUser(String)
2525
*/
2626
public class GHAppInstallation extends GHObject {
27+
28+
/**
29+
* Create default GHAppInstallation instance
30+
*/
31+
public GHAppInstallation() {
32+
}
33+
2734
private GHUser account;
2835

2936
@JsonProperty("access_tokens_url")

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@
1414
* @see GHAppInstallation#createToken(Map) GHAppInstallation#createToken(Map)
1515
*/
1616
public class GHAppInstallationToken extends GitHubInteractiveObject {
17+
18+
/**
19+
* Create default GHAppInstallationToken instance
20+
*/
21+
public GHAppInstallationToken() {
22+
}
23+
1724
private String token;
1825

1926
/** The expires at. */

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@
2020
*/
2121
public class GHArtifact extends GHObject {
2222

23+
/**
24+
* Create default GHArtifact instance
25+
*/
26+
public GHArtifact() {
27+
}
28+
2329
// Not provided by the API.
2430
@JsonIgnore
2531
private GHRepository owner;

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
*/
1414
public class GHAsset extends GHObject {
1515

16+
/**
17+
* Create default GHAsset instance
18+
*/
19+
public GHAsset() {
20+
}
21+
1622
/** The owner. */
1723
GHRepository owner;
1824
private String name;

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@
1717
*/
1818
public class GHAuthorization extends GHObject {
1919

20+
/**
21+
* Create default GHAuthorization instance
22+
*/
23+
public GHAuthorization() {
24+
}
25+
2026
/** The Constant USER. */
2127
public static final String USER = "user";
2228

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@
1616
* @see <a href="https://developer.github.com/v3/git/blobs/#get-a-blob">Get a blob</a>
1717
*/
1818
public class GHBlob {
19+
20+
/**
21+
* Create default GHBlob instance
22+
*/
23+
public GHBlob() {
24+
}
25+
1926
private String content, encoding, url, sha;
2027
private long size;
2128

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ public class GHBranch extends GitHubInteractiveObject {
4949
*/
5050
public static class Commit {
5151

52+
/**
53+
* Create default Commit instance
54+
*/
55+
public Commit() {
56+
}
57+
5258
/** The sha. */
5359
String sha;
5460

0 commit comments

Comments
 (0)