Skip to content

Commit

Permalink
Merge branch 'main' into feature/hub4j#1497
Browse files Browse the repository at this point in the history
  • Loading branch information
bitwiseman committed Feb 25, 2023
2 parents ee9dad9 + dd1e68d commit 6597aa6
Show file tree
Hide file tree
Showing 47 changed files with 1,629 additions and 58 deletions.
22 changes: 12 additions & 10 deletions .github/dependabot.yml
@@ -1,12 +1,14 @@
version: 2
updates:
- package-ecosystem: "maven"
directory: "/"
schedule:
interval: "monthly"
time: "02:00"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
time: "02:00"
- package-ecosystem: "maven"
directory: "/"
rebase-strategy: "disabled"
schedule:
interval: "monthly"
time: "02:00"
- package-ecosystem: "github-actions"
directory: "/"
rebase-strategy: "disabled"
schedule:
interval: "monthly"
time: "02:00"
2 changes: 1 addition & 1 deletion .github/workflows/maven-build.yml
Expand Up @@ -76,7 +76,7 @@ jobs:
- name: Maven Install with Code Coverage
run: mvn -B clean install -D enable-ci -Djapicmp.skip --file pom.xml
- name: Codecov Report
uses: codecov/codecov-action@v3.1.0
uses: codecov/codecov-action@v3.1.1
test:
name: test (${{ matrix.os }}, Java ${{ matrix.java }})
runs-on: ${{ matrix.os }}-latest
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Expand Up @@ -82,7 +82,7 @@ When modifying existing tests, you can change the stubbed WireMock data files by
#### Manual editing of data (minor changes only)

If you know what data will change, it is sometimes simplest to make any required changes to the data files manually.
This can be easier if the changes are minor or when you development environment is not setup to to take updated snapshots.
This can be easier if the changes are minor or when you development environment is not setup to take updated snapshots.

#### Generating a new snapshot

Expand Down
28 changes: 14 additions & 14 deletions pom.xml
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.kohsuke</groupId>
<artifactId>github-api</artifactId>
<version>1.312-SNAPSHOT</version>
<version>1.314-SNAPSHOT</version>
<name>GitHub API for Java</name>
<url>https://github-api.kohsuke.org/</url>
<description>GitHub API for Java</description>
Expand Down Expand Up @@ -33,8 +33,8 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spotbugs-maven-plugin.version>4.7.1.1</spotbugs-maven-plugin.version>
<spotbugs.version>4.7.1</spotbugs.version>
<spotbugs-maven-plugin.version>4.7.3.0</spotbugs-maven-plugin.version>
<spotbugs.version>4.7.3</spotbugs.version>
<spotbugs-maven-plugin.failOnError>true</spotbugs-maven-plugin.failOnError>
<hamcrest.version>2.2</hamcrest.version>
<okhttp3.version>4.9.2</okhttp3.version>
Expand Down Expand Up @@ -278,12 +278,12 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.4.1</version>
<version>3.4.2</version>
<dependencies>
<dependency>
<groupId>org.apache.bcel</groupId>
<artifactId>bcel</artifactId>
<version>6.5.0</version>
<version>6.6.1</version>
</dependency>
</dependencies>
</plugin>
Expand Down Expand Up @@ -333,7 +333,7 @@
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>2.25.0</version>
<version>2.27.2</version>
<executions>
<execution>
<id>spotless-check</id>
Expand Down Expand Up @@ -468,7 +468,7 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.13.3</version>
<version>2.14.0</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
Expand All @@ -485,7 +485,7 @@
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.4</version>
<version>1.5</version>
<scope>test</scope>
</dependency>
<!-- for stapler-jetty -->
Expand All @@ -511,7 +511,7 @@
<dependency>
<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit</artifactId>
<version>6.1.0.202203080745-r</version>
<version>6.4.0.202211300538-r</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -567,7 +567,7 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>4.7.0</version>
<version>4.11.0</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -579,19 +579,19 @@
<dependency>
<groupId>com.github.tomakehurst</groupId>
<artifactId>wiremock-jre8-standalone</artifactId>
<version>2.32.0</version>
<version>2.35.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.9.1</version>
<version>2.10</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.36</version>
<version>2.0.3</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down Expand Up @@ -817,7 +817,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.2</version>
<version>3.3.0</version>
<configuration>
<archive>
<manifestEntries>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/kohsuke/github/GHCommit.java
Expand Up @@ -125,7 +125,7 @@ public static class Stats {
/**
* A file that was modified.
*/
@SuppressFBWarnings(value = "UWF_UNWRITTEN_FIELD", justification = "It's being initilized by JSON deserialization")
@SuppressFBWarnings(value = "UWF_UNWRITTEN_FIELD", justification = "It's being initialized by JSON deserialization")
public static class File {

/** The status. */
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/kohsuke/github/GHCompare.java
Expand Up @@ -224,8 +224,8 @@ GHCompare lateBind(GHRepository owner) {
}

/**
* Compare commits had a child commit element with additional details we want to capture. This extenstion of
* GHCommit provides that.
* Compare commits had a child commit element with additional details we want to capture. This extension of GHCommit
* provides that.
*/
@SuppressFBWarnings(value = { "UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD", "UWF_UNWRITTEN_FIELD" },
justification = "JSON API")
Expand Down
11 changes: 11 additions & 0 deletions src/main/java/org/kohsuke/github/GHEventPayload.java
Expand Up @@ -1043,6 +1043,7 @@ public static class Push extends GHEventPayload {
private String ref;
private int size;
private List<PushCommit> commits;
private PushCommit headCommit;
private Pusher pusher;
private String compare;

Expand Down Expand Up @@ -1124,6 +1125,16 @@ public List<PushCommit> getCommits() {
return Collections.unmodifiableList(commits);
}

/**
* The head commit of the push.
*
* @return the commit
*/
@SuppressFBWarnings(value = { "EI_EXPOSE_REP" }, justification = "Expected")
public PushCommit getHeadCommit() {
return headCommit;
}

/**
* Gets pusher.
*
Expand Down
Expand Up @@ -10,7 +10,7 @@

// TODO: Auto-generated Javadoc
/**
* Request/responce contains useful metadata. Custom exception allows store info for next diagnostics.
* Request/response contains useful metadata. Custom exception allows store info for next diagnostics.
*
* @author Kanstantsin Shautsou
*/
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/kohsuke/github/GHIOException.java
Expand Up @@ -10,7 +10,7 @@

// TODO: Auto-generated Javadoc
/**
* Request/responce contains useful metadata. Custom exception allows store info for next diagnostics.
* Request/response contains useful metadata. Custom exception allows store info for next diagnostics.
*
* @author Kanstantsin Shautsou
*/
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/kohsuke/github/GHIssue.java
Expand Up @@ -517,7 +517,7 @@ public List<GHIssueComment> getComments() throws IOException {
}

/**
* Obtains all the comments associated with this issue, witout any filter.
* Obtains all the comments associated with this issue, without any filter.
*
* @return the paged iterable
* @throws IOException
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/kohsuke/github/GHMyself.java
Expand Up @@ -70,9 +70,9 @@ public List<GHEmail> getEmails2() throws IOException {
}

/**
* Returns the read-only list of all the pulic keys of the current user.
* Returns the read-only list of all the public keys of the current user.
* <p>
* NOTE: When using OAuth authenticaiton, the READ/WRITE User scope is required by the GitHub APIs, otherwise you
* NOTE: When using OAuth authentication, the READ/WRITE User scope is required by the GitHub APIs, otherwise you
* will get a 404 NOT FOUND.
*
* @return Always non-null.
Expand Down
26 changes: 25 additions & 1 deletion src/main/java/org/kohsuke/github/GHOrganization.java
Expand Up @@ -315,6 +315,17 @@ public PagedIterable<GHUser> listPublicMembers() throws IOException {
return listMembers("public_members");
}

/**
* All the outside collaborators of this organization.
*
* @return the paged iterable
* @throws IOException
* the io exception
*/
public PagedIterable<GHUser> listOutsideCollaborators() throws IOException {
return listMembers("outside_collaborators");
}

private PagedIterable<GHUser> listMembers(String suffix) throws IOException {
return listMembers(suffix, null, null);
}
Expand All @@ -332,6 +343,19 @@ public PagedIterable<GHUser> listMembersWithFilter(String filter) throws IOExcep
return listMembers("members", filter, null);
}

/**
* List outside collaborators with filter paged iterable.
*
* @param filter
* the filter
* @return the paged iterable
* @throws IOException
* the io exception
*/
public PagedIterable<GHUser> listOutsideCollaboratorsWithFilter(String filter) throws IOException {
return listMembers("outside_collaborators", filter, null);
}

/**
* List members with specified role paged iterable.
*
Expand Down Expand Up @@ -631,7 +655,7 @@ public List<GHRepository> getRepositoriesWithOpenPullRequests() throws IOExcepti
}

/**
* Gets all the open pull requests in this organizataion.
* Gets all the open pull requests in this organization.
*
* @return the pull requests
* @throws IOException
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/kohsuke/github/GHRateLimit.java
Expand Up @@ -347,7 +347,7 @@ Record getRecord(@Nonnull RateLimitTarget rateLimitTarget) {
}

/**
* A limit record used as a placeholder when the the actual limit is not known.
* A limit record used as a placeholder when the actual limit is not known.
*
* @since 1.100
*/
Expand Down Expand Up @@ -528,7 +528,7 @@ && getRemaining() <= other.getRemaining())) {
} else if (!(other instanceof UnknownLimitRecord)) {
// If the above is not the case that means other has a later reset
// or the same resent and fewer requests remaining.
// If the other record is not an unknown record, the the other is more recent
// If the other record is not an unknown record, the other is more recent
return other;
} else if (this.isExpired() && !other.isExpired()) {
// The other is an unknown record.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/kohsuke/github/GHRef.java
Expand Up @@ -85,7 +85,7 @@ public void delete() throws IOException {
}

/**
* Retrive a ref of the given type for the current GitHub repository.
* Retrieve a ref of the given type for the current GitHub repository.
*
* @param repository
* the repository to read from
Expand Down
31 changes: 27 additions & 4 deletions src/main/java/org/kohsuke/github/GHRepository.java
Expand Up @@ -1891,7 +1891,7 @@ public GHCompare getCompare(GHBranch id1, GHBranch id2) throws IOException {
/**
* Retrieves all refs for the github repository.
*
* @return an array of GHRef elements coresponding with the refs in the remote repository.
* @return an array of GHRef elements corresponding with the refs in the remote repository.
* @throws IOException
* on failure communicating with GitHub
*/
Expand Down Expand Up @@ -1937,7 +1937,7 @@ public PagedIterable<GHRef> listRefs(String refType) throws IOException {
}

/**
* Retrive a ref of the given type for the current GitHub repository.
* Retrieve a ref of the given type for the current GitHub repository.
*
* @param refName
* eg: heads/branch
Expand All @@ -1964,7 +1964,7 @@ public GHTagObject getTagObject(String sha) throws IOException {
}

/**
* Retrive a tree of the given type for the current GitHub repository.
* Retrieve a tree of the given type for the current GitHub repository.
*
* @param sha
* sha number or branch name ex: "main"
Expand Down Expand Up @@ -2210,6 +2210,29 @@ public PagedIterable<GHCheckRun> getCheckRuns(String ref) throws IOException {
return new GHCheckRunsIterable(this, request);
}

/**
* Gets check runs for given ref which validate provided parameters
*
* @param ref
* the Git reference
* @param params
* a map of parameters to filter check runs
* @return check runs for the given ref
* @throws IOException
* the io exception
* @see <a href="https://developer.github.com/v3/checks/runs/#list-check-runs-for-a-specific-ref">List check runs
* for a specific ref</a>
*/
@Preview(ANTIOPE)
public PagedIterable<GHCheckRun> getCheckRuns(String ref, Map<String, Object> params) throws IOException {
GitHubRequest request = root().createRequest()
.withUrlPath(String.format("/repos/%s/%s/commits/%s/check-runs", getOwnerName(), name, ref))
.with(params)
.withPreview(ANTIOPE)
.build();
return new GHCheckRunsIterable(this, request);
}

/**
* Creates a commit status.
*
Expand All @@ -2222,7 +2245,7 @@ public PagedIterable<GHCheckRun> getCheckRuns(String ref) throws IOException {
* @param description
* Optional short description.
* @param context
* Optinal commit status context.
* Optional commit status context.
* @return the gh commit status
* @throws IOException
* the io exception
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/kohsuke/github/GHTree.java
Expand Up @@ -61,7 +61,7 @@ public GHTreeEntry getEntry(String path) {
/**
* Returns true if the number of items in the tree array exceeded the GitHub maximum limit.
*
* @return true true if the number of items in the tree array exceeded the GitHub maximum limit otherwise false.
* @return true if the number of items in the tree array exceeded the GitHub maximum limit otherwise false.
*/
public boolean isTruncated() {
return truncated;
Expand Down

0 comments on commit 6597aa6

Please sign in to comment.