Skip to content

Commit 3a8c158

Browse files
authored
Merge branch 'main' into feature/hub4j#1497
2 parents ac7799c + 30ff8e6 commit 3a8c158

File tree

484 files changed

+21615
-1974
lines changed

Some content is hidden

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

484 files changed

+21615
-1974
lines changed

.github/workflows/maven-build.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
strategy:
4444
fail-fast: false
4545
matrix:
46-
java: [ 11 ]
46+
java: [ 17 ]
4747
steps:
4848
- uses: actions/checkout@v3
4949
- name: Set up JDK
@@ -53,6 +53,8 @@ jobs:
5353
distribution: 'adopt'
5454
cache: 'maven'
5555
- name: Maven Site
56+
env:
57+
MAVEN_OPTS: ${{ env.JAVA_11_PLUS_MAVEN_OPTS }}
5658
run: mvn -B clean site -D enable-ci --file pom.xml
5759
test-8:
5860
name: test (${{ matrix.os }}, Java 8)

pom.xml

Lines changed: 5 additions & 5 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.309-SNAPSHOT</version>
5+
<version>1.312-SNAPSHOT</version>
66
<name>GitHub API for Java</name>
77
<url>https://github-api.kohsuke.org/</url>
88
<description>GitHub API for Java</description>
@@ -213,9 +213,9 @@
213213
<plugin>
214214
<groupId>org.apache.maven.plugins</groupId>
215215
<artifactId>maven-javadoc-plugin</artifactId>
216-
<version>3.4.0</version>
216+
<version>3.4.1</version>
217217
<configuration>
218-
<source>8</source>
218+
<source>11</source>
219219
<failOnWarnings>true</failOnWarnings>
220220
<doclint>all</doclint>
221221
</configuration>
@@ -333,7 +333,7 @@
333333
<plugin>
334334
<groupId>com.diffplug.spotless</groupId>
335335
<artifactId>spotless-maven-plugin</artifactId>
336-
<version>2.24.0</version>
336+
<version>2.25.0</version>
337337
<executions>
338338
<execution>
339339
<id>spotless-check</id>
@@ -567,7 +567,7 @@
567567
<dependency>
568568
<groupId>org.mockito</groupId>
569569
<artifactId>mockito-core</artifactId>
570-
<version>4.6.1</version>
570+
<version>4.7.0</version>
571571
<scope>test</scope>
572572
</dependency>
573573
<dependency>

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

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

8+
// TODO: Auto-generated Javadoc
89
/**
910
* An abstract data object builder/updater.
1011
*
@@ -32,13 +33,12 @@
3233
* If {@link S} is not the same as {@link R}, {@link #with(String, Object)} will batch together multiple changes and let
3334
* the user call {@link #done()} when they are ready.
3435
*
36+
* @author Liam Newman
3537
* @param <R>
3638
* Final return type built by this builder returned when {@link #done()}} is called.
3739
* @param <S>
3840
* Intermediate return type for this builder returned by calls to {@link #with(String, Object)}. If {@link S}
3941
* the same as {@link R}, this builder will commit changes after each call to {@link #with(String, Object)}.
40-
*
41-
* @author Liam Newman
4242
*/
4343
abstract class AbstractBuilder<R, S> extends GitHubInteractiveObject {
4444

@@ -50,26 +50,28 @@ abstract class AbstractBuilder<R, S> extends GitHubInteractiveObject {
5050
@CheckForNull
5151
private final R baseInstance;
5252

53+
/** The requester. */
5354
@Nonnull
5455
protected final Requester requester;
5556

5657
// TODO: Not sure how update-in-place behavior should be controlled
5758
// However, it certainly can be controlled dynamically down to the instance level or inherited for all children of
5859
// some
60+
/** The update in place. */
5961
// connection.
6062
protected boolean updateInPlace;
6163

6264
/**
6365
* Creates a builder.
6466
*
65-
* @param root
66-
* the GitHub instance to connect to.
67+
* @param finalReturnType
68+
* the final return type for built by this builder returned when {@link #done()}} is called.
6769
* @param intermediateReturnType
6870
* the intermediate return type of type {@link S} returned by calls to {@link #with(String, Object)}.
6971
* Must either be equal to {@code builtReturnType} or this instance must be castable to this class. If
7072
* not, the constructor will throw {@link IllegalArgumentException}.
71-
* @param finalReturnType
72-
* the final return type for built by this builder returned when {@link #done()}} is called.
73+
* @param root
74+
* the GitHub instance to connect to.
7375
* @param baseInstance
7476
* optional instance on which to base this builder.
7577
*/

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
import javax.annotation.Nonnull;
1010

11+
// TODO: Auto-generated Javadoc
1112
/**
1213
* Pluggable strategy to determine what to do when the API abuse limit is hit.
1314
*

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,27 @@
22

33
import java.util.Locale;
44

5+
// TODO: Auto-generated Javadoc
56
/**
67
* This was added during preview API period but it has changed since then.
78
*
89
* @author Kohsuke Kawaguchi
910
*/
1011
@Deprecated
1112
public enum EnforcementLevel {
12-
OFF, NON_ADMINS, EVERYONE;
1313

14+
/** The off. */
15+
OFF,
16+
/** The non admins. */
17+
NON_ADMINS,
18+
/** The everyone. */
19+
EVERYONE;
20+
21+
/**
22+
* To string.
23+
*
24+
* @return the string
25+
*/
1426
public String toString() {
1527
return name().toLowerCase(Locale.ENGLISH);
1628
}

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
import static org.kohsuke.github.internal.Previews.MACHINE_MAN;
1414

15+
// TODO: Auto-generated Javadoc
1516
/**
1617
* A Github App.
1718
*
@@ -22,6 +23,7 @@ public class GHApp extends GHObject {
2223

2324
private GHUser owner;
2425
private String name;
26+
private String slug;
2527
private String description;
2628
private String externalUrl;
2729
private Map<String, String> permissions;
@@ -60,6 +62,15 @@ public String getName() {
6062
return name;
6163
}
6264

65+
/**
66+
* Gets the slug name of the GitHub app.
67+
*
68+
* @return the slug name of the GitHub app
69+
*/
70+
public String getSlug() {
71+
return slug;
72+
}
73+
6374
/**
6475
* Sets name.
6576
*
@@ -158,6 +169,11 @@ public void setInstallationsCount(long installationsCount) {
158169
throw new RuntimeException("Do not use this method.");
159170
}
160171

172+
/**
173+
* Gets the html url.
174+
*
175+
* @return the html url
176+
*/
161177
public URL getHtmlUrl() {
162178
return GitHubClient.parseURL(htmlUrl);
163179
}

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

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,45 @@
77

88
import static org.kohsuke.github.internal.Previews.MACHINE_MAN;
99

10+
// TODO: Auto-generated Javadoc
1011
/**
11-
* Creates a access token for a GitHub App Installation
12+
* Creates a access token for a GitHub App Installation.
1213
*
1314
* @author Paulo Miguel Almeida
1415
* @see GHAppInstallation#createToken(Map) GHAppInstallation#createToken(Map)
1516
* @see GHAppInstallation#createToken() GHAppInstallation#createToken()
1617
*/
1718
public class GHAppCreateTokenBuilder extends GitHubInteractiveObject {
19+
20+
/** The builder. */
1821
protected final Requester builder;
1922
private final String apiUrlTail;
2023

24+
/**
25+
* Instantiates a new GH app create token builder.
26+
*
27+
* @param root
28+
* the root
29+
* @param apiUrlTail
30+
* the api url tail
31+
*/
2132
@BetaApi
2233
GHAppCreateTokenBuilder(GitHub root, String apiUrlTail) {
2334
super(root);
2435
this.apiUrlTail = apiUrlTail;
2536
this.builder = root.createRequest();
2637
}
2738

39+
/**
40+
* Instantiates a new GH app create token builder.
41+
*
42+
* @param root
43+
* the root
44+
* @param apiUrlTail
45+
* the api url tail
46+
* @param permissions
47+
* the permissions
48+
*/
2849
@BetaApi
2950
GHAppCreateTokenBuilder(GitHub root, String apiUrlTail, Map<String, GHPermissionType> permissions) {
3051
this(root, apiUrlTail);

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import static org.kohsuke.github.internal.Previews.GAMBIT;
1717
import static org.kohsuke.github.internal.Previews.MACHINE_MAN;
1818

19+
// TODO: Auto-generated Javadoc
1920
/**
2021
* A Github App Installation.
2122
*
@@ -50,6 +51,11 @@ public class GHAppInstallation extends GHObject {
5051
private GHRepositorySelection repositorySelection;
5152
private String htmlUrl;
5253

54+
/**
55+
* Gets the html url.
56+
*
57+
* @return the html url
58+
*/
5359
public URL getHtmlUrl() {
5460
return GitHubClient.parseURL(htmlUrl);
5561
}
@@ -122,7 +128,15 @@ public String getRepositoriesUrl() {
122128
* List repositories that this app installation can access.
123129
*
124130
* @return the paged iterable
131+
* @deprecated This method cannot work on a {@link GHAppInstallation} retrieved from
132+
* {@link GHApp#listInstallations()} (for example), except when resorting to unsupported hacks involving
133+
* {@link GHAppInstallation#setRoot(GitHub)} to switch from an application client to an installation
134+
* client. This method will be removed. You should instead use an installation client (with an
135+
* installation token, not a JWT), retrieve a {@link GHAuthenticatedAppInstallation} from
136+
* {@link GitHub#getInstallation()}, then call
137+
* {@link GHAuthenticatedAppInstallation#listRepositories()}.
125138
*/
139+
@Deprecated
126140
@Preview(MACHINE_MAN)
127141
public PagedSearchIterable<GHRepository> listRepositories() {
128142
GitHubRequest request;

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import java.io.IOException;
77
import java.util.*;
88

9+
// TODO: Auto-generated Javadoc
910
/**
1011
* A Github App Installation Token.
1112
*
@@ -14,6 +15,8 @@
1415
*/
1516
public class GHAppInstallationToken extends GitHubInteractiveObject {
1617
private String token;
18+
19+
/** The expires at. */
1720
protected String expires_at;
1821
private Map<String, String> permissions;
1922
private List<GHRepository> repositories;

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

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,34 @@
44

55
import javax.annotation.Nonnull;
66

7+
// TODO: Auto-generated Javadoc
78
/**
89
* Iterable for GHAppInstallation listing.
910
*/
1011
class GHAppInstallationsIterable extends PagedIterable<GHAppInstallation> {
12+
13+
/** The Constant APP_INSTALLATIONS_URL. */
1114
public static final String APP_INSTALLATIONS_URL = "/user/installations";
1215
private final transient GitHub root;
1316
private GHAppInstallationsPage result;
1417

18+
/**
19+
* Instantiates a new GH app installations iterable.
20+
*
21+
* @param root
22+
* the root
23+
*/
1524
public GHAppInstallationsIterable(GitHub root) {
1625
this.root = root;
1726
}
1827

28+
/**
29+
* Iterator.
30+
*
31+
* @param pageSize
32+
* the page size
33+
* @return the paged iterator
34+
*/
1935
@Nonnull
2036
@Override
2137
public PagedIterator<GHAppInstallation> _iterator(int pageSize) {
@@ -25,6 +41,13 @@ public PagedIterator<GHAppInstallation> _iterator(int pageSize) {
2541
null);
2642
}
2743

44+
/**
45+
* Adapt.
46+
*
47+
* @param base
48+
* the base
49+
* @return the iterator
50+
*/
2851
protected Iterator<GHAppInstallation[]> adapt(final Iterator<GHAppInstallationsPage> base) {
2952
return new Iterator<GHAppInstallation[]>() {
3053
public boolean hasNext() {

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

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

3+
// TODO: Auto-generated Javadoc
34
/**
45
* Represents the one page of GHAppInstallations.
56
*/
67
class GHAppInstallationsPage {
78
private int total_count;
89
private GHAppInstallation[] installations;
910

11+
/**
12+
* Gets the total count.
13+
*
14+
* @return the total count
15+
*/
1016
public int getTotalCount() {
1117
return total_count;
1218
}
1319

20+
/**
21+
* Gets the installations.
22+
*
23+
* @return the installations
24+
*/
1425
GHAppInstallation[] getInstallations() {
1526
return installations;
1627
}

0 commit comments

Comments
 (0)