Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate site using Java 17 #1434

Merged
merged 9 commits into from Sep 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/maven-build.yml
Expand Up @@ -43,7 +43,7 @@ jobs:
strategy:
fail-fast: false
matrix:
java: [ 11 ]
java: [ 17 ]
bitwiseman marked this conversation as resolved.
Show resolved Hide resolved
steps:
- uses: actions/checkout@v3
- name: Set up JDK
Expand All @@ -53,6 +53,8 @@ jobs:
distribution: 'adopt'
cache: 'maven'
- name: Maven Site
env:
MAVEN_OPTS: ${{ env.JAVA_11_PLUS_MAVEN_OPTS }}
run: mvn -B clean site -D enable-ci --file pom.xml
test-8:
name: test (${{ matrix.os }}, Java 8)
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -215,7 +215,7 @@
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.4.1</version>
<configuration>
<source>8</source>
<source>11</source>
<failOnWarnings>true</failOnWarnings>
<doclint>all</doclint>
</configuration>
Expand Down
14 changes: 8 additions & 6 deletions src/main/java/org/kohsuke/github/AbstractBuilder.java
Expand Up @@ -5,6 +5,7 @@
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;

// TODO: Auto-generated Javadoc
/**
* An abstract data object builder/updater.
*
Expand Down Expand Up @@ -32,13 +33,12 @@
* If {@link S} is not the same as {@link R}, {@link #with(String, Object)} will batch together multiple changes and let
* the user call {@link #done()} when they are ready.
*
* @author Liam Newman
* @param <R>
* Final return type built by this builder returned when {@link #done()}} is called.
* @param <S>
* Intermediate return type for this builder returned by calls to {@link #with(String, Object)}. If {@link S}
* the same as {@link R}, this builder will commit changes after each call to {@link #with(String, Object)}.
*
* @author Liam Newman
*/
abstract class AbstractBuilder<R, S> extends GitHubInteractiveObject {

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

/** The requester. */
@Nonnull
protected final Requester requester;

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

/**
* Creates a builder.
*
* @param root
* the GitHub instance to connect to.
* @param finalReturnType
* the final return type for built by this builder returned when {@link #done()}} is called.
* @param intermediateReturnType
* the intermediate return type of type {@link S} returned by calls to {@link #with(String, Object)}.
* Must either be equal to {@code builtReturnType} or this instance must be castable to this class. If
* not, the constructor will throw {@link IllegalArgumentException}.
* @param finalReturnType
* the final return type for built by this builder returned when {@link #done()}} is called.
* @param root
* the GitHub instance to connect to.
* @param baseInstance
* optional instance on which to base this builder.
*/
Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/kohsuke/github/AbuseLimitHandler.java
Expand Up @@ -8,6 +8,7 @@

import javax.annotation.Nonnull;

// TODO: Auto-generated Javadoc
/**
* Pluggable strategy to determine what to do when the API abuse limit is hit.
*
Expand Down
14 changes: 13 additions & 1 deletion src/main/java/org/kohsuke/github/EnforcementLevel.java
Expand Up @@ -2,15 +2,27 @@

import java.util.Locale;

// TODO: Auto-generated Javadoc
/**
* This was added during preview API period but it has changed since then.
*
* @author Kohsuke Kawaguchi
*/
@Deprecated
public enum EnforcementLevel {
OFF, NON_ADMINS, EVERYONE;

/** The off. */
OFF,
/** The non admins. */
NON_ADMINS,
/** The everyone. */
EVERYONE;

/**
* To string.
*
* @return the string
*/
public String toString() {
return name().toLowerCase(Locale.ENGLISH);
}
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/org/kohsuke/github/GHApp.java
Expand Up @@ -12,6 +12,7 @@

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

// TODO: Auto-generated Javadoc
/**
* A Github App.
*
Expand Down Expand Up @@ -168,6 +169,11 @@ public void setInstallationsCount(long installationsCount) {
throw new RuntimeException("Do not use this method.");
}

/**
* Gets the html url.
*
* @return the html url
*/
public URL getHtmlUrl() {
return GitHubClient.parseURL(htmlUrl);
}
Expand Down
23 changes: 22 additions & 1 deletion src/main/java/org/kohsuke/github/GHAppCreateTokenBuilder.java
Expand Up @@ -7,24 +7,45 @@

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

// TODO: Auto-generated Javadoc
/**
* Creates a access token for a GitHub App Installation
* Creates a access token for a GitHub App Installation.
*
* @author Paulo Miguel Almeida
* @see GHAppInstallation#createToken(Map) GHAppInstallation#createToken(Map)
* @see GHAppInstallation#createToken() GHAppInstallation#createToken()
*/
public class GHAppCreateTokenBuilder extends GitHubInteractiveObject {

/** The builder. */
protected final Requester builder;
private final String apiUrlTail;

/**
* Instantiates a new GH app create token builder.
*
* @param root
* the root
* @param apiUrlTail
* the api url tail
*/
@BetaApi
GHAppCreateTokenBuilder(GitHub root, String apiUrlTail) {
super(root);
this.apiUrlTail = apiUrlTail;
this.builder = root.createRequest();
}

/**
* Instantiates a new GH app create token builder.
*
* @param root
* the root
* @param apiUrlTail
* the api url tail
* @param permissions
* the permissions
*/
@BetaApi
GHAppCreateTokenBuilder(GitHub root, String apiUrlTail, Map<String, GHPermissionType> permissions) {
this(root, apiUrlTail);
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/org/kohsuke/github/GHAppInstallation.java
Expand Up @@ -14,6 +14,7 @@
import static org.kohsuke.github.internal.Previews.GAMBIT;
import static org.kohsuke.github.internal.Previews.MACHINE_MAN;

// TODO: Auto-generated Javadoc
/**
* A Github App Installation.
*
Expand Down Expand Up @@ -45,6 +46,11 @@ public class GHAppInstallation extends GHObject {
private GHRepositorySelection repositorySelection;
private String htmlUrl;

/**
* Gets the html url.
*
* @return the html url
*/
public URL getHtmlUrl() {
return GitHubClient.parseURL(htmlUrl);
}
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/org/kohsuke/github/GHAppInstallationToken.java
Expand Up @@ -6,6 +6,7 @@
import java.io.IOException;
import java.util.*;

// TODO: Auto-generated Javadoc
/**
* A Github App Installation Token.
*
Expand All @@ -14,6 +15,8 @@
*/
public class GHAppInstallationToken extends GitHubInteractiveObject {
private String token;

/** The expires at. */
protected String expires_at;
private Map<String, String> permissions;
private List<GHRepository> repositories;
Expand Down
23 changes: 23 additions & 0 deletions src/main/java/org/kohsuke/github/GHAppInstallationsIterable.java
Expand Up @@ -4,18 +4,34 @@

import javax.annotation.Nonnull;

// TODO: Auto-generated Javadoc
/**
* Iterable for GHAppInstallation listing.
*/
class GHAppInstallationsIterable extends PagedIterable<GHAppInstallation> {

/** The Constant APP_INSTALLATIONS_URL. */
public static final String APP_INSTALLATIONS_URL = "/user/installations";
private final transient GitHub root;
private GHAppInstallationsPage result;

/**
* Instantiates a new GH app installations iterable.
*
* @param root
* the root
*/
public GHAppInstallationsIterable(GitHub root) {
this.root = root;
}

/**
* Iterator.
*
* @param pageSize
* the page size
* @return the paged iterator
*/
@Nonnull
@Override
public PagedIterator<GHAppInstallation> _iterator(int pageSize) {
Expand All @@ -25,6 +41,13 @@ public PagedIterator<GHAppInstallation> _iterator(int pageSize) {
null);
}

/**
* Adapt.
*
* @param base
* the base
* @return the iterator
*/
protected Iterator<GHAppInstallation[]> adapt(final Iterator<GHAppInstallationsPage> base) {
return new Iterator<GHAppInstallation[]>() {
public boolean hasNext() {
Expand Down
11 changes: 11 additions & 0 deletions src/main/java/org/kohsuke/github/GHAppInstallationsPage.java
@@ -1,16 +1,27 @@
package org.kohsuke.github;

// TODO: Auto-generated Javadoc
/**
* Represents the one page of GHAppInstallations.
*/
class GHAppInstallationsPage {
private int total_count;
private GHAppInstallation[] installations;

/**
* Gets the total count.
*
* @return the total count
*/
public int getTotalCount() {
return total_count;
}

/**
* Gets the installations.
*
* @return the installations
*/
GHAppInstallation[] getInstallations() {
return installations;
}
Expand Down
15 changes: 14 additions & 1 deletion src/main/java/org/kohsuke/github/GHArtifact.java
Expand Up @@ -12,6 +12,7 @@

import static java.util.Objects.requireNonNull;

// TODO: Auto-generated Javadoc
/**
* An artifact from a workflow run.
*
Expand Down Expand Up @@ -85,6 +86,11 @@ public GHRepository getRepository() {
}

/**
* Gets the html url.
*
* @return the html url
* @throws IOException
* Signals that an I/O exception has occurred.
* @deprecated This object has no HTML URL.
*/
@Override
Expand All @@ -109,9 +115,9 @@ public void delete() throws IOException {
* the type of result
* @param streamFunction
* The {@link InputStreamFunction} that will process the stream
* @return the result of reading the stream.
* @throws IOException
* The IO exception.
* @return the result of reading the stream.
*/
public <T> T download(InputStreamFunction<T> streamFunction) throws IOException {
requireNonNull(streamFunction, "Stream function must not be null");
Expand All @@ -128,6 +134,13 @@ private String getApiRoute() {
return "/repos/" + owner.getOwnerName() + "/" + owner.getName() + "/actions/artifacts/" + getId();
}

/**
* Wrap up.
*
* @param owner
* the owner
* @return the GH artifact
*/
GHArtifact wrapUp(GHRepository owner) {
this.owner = owner;
return this;
Expand Down
23 changes: 23 additions & 0 deletions src/main/java/org/kohsuke/github/GHArtifactsIterable.java
Expand Up @@ -4,6 +4,7 @@

import javax.annotation.Nonnull;

// TODO: Auto-generated Javadoc
/**
* Iterable for artifacts listing.
*/
Expand All @@ -13,11 +14,26 @@ class GHArtifactsIterable extends PagedIterable<GHArtifact> {

private GHArtifactsPage result;

/**
* Instantiates a new GH artifacts iterable.
*
* @param owner
* the owner
* @param requestBuilder
* the request builder
*/
public GHArtifactsIterable(GHRepository owner, GitHubRequest.Builder<?> requestBuilder) {
this.owner = owner;
this.request = requestBuilder.build();
}

/**
* Iterator.
*
* @param pageSize
* the page size
* @return the paged iterator
*/
@Nonnull
@Override
public PagedIterator<GHArtifact> _iterator(int pageSize) {
Expand All @@ -26,6 +42,13 @@ public PagedIterator<GHArtifact> _iterator(int pageSize) {
null);
}

/**
* Adapt.
*
* @param base
* the base
* @return the iterator
*/
protected Iterator<GHArtifact[]> adapt(final Iterator<GHArtifactsPage> base) {
return new Iterator<GHArtifact[]>() {
public boolean hasNext() {
Expand Down