Skip to content

Commit 571b5fe

Browse files
authored
Merge branch 'main' into dependabot/maven/main/org.junit-junit-bom-6.1.1
2 parents 50e2af0 + 9f8afcc commit 571b5fe

63 files changed

Lines changed: 3823 additions & 231 deletions

File tree

Some content is hidden

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

‎.github/workflows/codeql-analysis.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242

4343
steps:
4444
- name: Set up JDK
45-
uses: actions/setup-java@v5
45+
uses: actions/setup-java@v6
4646
with:
4747
distribution: 'temurin'
4848
java-version: 17

‎.github/workflows/create_release_tag_and_pr.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
fetch-depth: 0
1616

1717
- name: Set up Maven Central Repository
18-
uses: actions/setup-java@v5
18+
uses: actions/setup-java@v6
1919
with:
2020
java-version: '17'
2121
distribution: 'temurin'

‎.github/workflows/maven-build.yml‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
steps:
2828
- uses: actions/checkout@v7
2929
- name: Set up JDK
30-
uses: actions/setup-java@v5
30+
uses: actions/setup-java@v6
3131
with:
3232
java-version: 17
3333
distribution: 'temurin'
@@ -49,7 +49,7 @@ jobs:
4949
steps:
5050
- uses: actions/checkout@v7
5151
- name: Set up JDK
52-
uses: actions/setup-java@v5
52+
uses: actions/setup-java@v6
5353
with:
5454
java-version: 17
5555
distribution: 'temurin'
@@ -70,7 +70,7 @@ jobs:
7070
steps:
7171
- uses: actions/checkout@v7
7272
- name: Set up JDK
73-
uses: actions/setup-java@v5
73+
uses: actions/setup-java@v6
7474
with:
7575
java-version: 17
7676
distribution: 'temurin'
@@ -92,7 +92,7 @@ jobs:
9292
steps:
9393
- uses: actions/checkout@v7
9494
- name: Set up JDK
95-
uses: actions/setup-java@v5
95+
uses: actions/setup-java@v6
9696
with:
9797
java-version: ${{ matrix.java }}
9898
distribution: 'temurin'
@@ -144,7 +144,7 @@ jobs:
144144
name: maven-target-directory
145145
path: target
146146
- name: Set up JDK
147-
uses: actions/setup-java@v5
147+
uses: actions/setup-java@v6
148148
with:
149149
java-version: 11
150150
distribution: 'temurin'

‎.github/workflows/publish_release_branch.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
steps:
1515
- uses: actions/checkout@v7
1616
- name: Set up Maven Central Repository
17-
uses: actions/setup-java@v5
17+
uses: actions/setup-java@v6
1818
with:
1919
java-version: '17'
2020
distribution: 'temurin'
@@ -37,7 +37,7 @@ jobs:
3737
steps:
3838
- uses: actions/checkout@v7
3939
- name: Set up Maven Central Repository
40-
uses: actions/setup-java@v5
40+
uses: actions/setup-java@v6
4141
with:
4242
java-version: '17'
4343
distribution: 'temurin'

‎pom.xml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>org.kohsuke</groupId>
55
<artifactId>${github-api.artifactId}</artifactId>
6-
<version>2.0-rc.7-SNAPSHOT</version>
6+
<version>2.0-rc.8-SNAPSHOT</version>
77
<name>GitHub API for Java</name>
88
<description>GitHub API for Java</description>
99
<url>https://hub4j.github.io/github-api/</url>
@@ -78,7 +78,7 @@
7878
<okio.version>3.17.0</okio.version>
7979
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
8080
<spotbugs-maven-plugin.failOnError>true</spotbugs-maven-plugin.failOnError>
81-
<spotbugs-maven-plugin.version>4.9.8.3</spotbugs-maven-plugin.version>
81+
<spotbugs-maven-plugin.version>4.10.3.0</spotbugs-maven-plugin.version>
8282
<spotbugs.version>4.8.6</spotbugs.version>
8383
<spring.boot.version>3.4.5</spring.boot.version>
8484
<surefire.argLine></surefire.argLine>
@@ -89,7 +89,7 @@
8989
<dependency>
9090
<groupId>com.fasterxml.jackson</groupId>
9191
<artifactId>jackson-bom</artifactId>
92-
<version>2.21.2</version>
92+
<version>2.22.1</version>
9393
<type>pom</type>
9494
<scope>import</scope>
9595
</dependency>
@@ -602,7 +602,7 @@
602602
<plugin>
603603
<groupId>org.apache.maven.plugins</groupId>
604604
<artifactId>maven-jar-plugin</artifactId>
605-
<version>3.5.0</version>
605+
<version>3.5.1</version>
606606
<configuration>
607607
<archive>
608608
<manifestEntries>

‎src/main/java/org/kohsuke/github/GHEventPayload.java‎

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ public GHRepository getForkee() {
529529
// ContentReferenceEvent
530530
// DeployKeyEvent DownloadEvent FollowEvent ForkApplyEvent GitHubAppAuthorizationEvent GistEvent GollumEvent
531531
// InstallationEvent InstallationRepositoriesEvent IssuesEvent LabelEvent MarketplacePurchaseEvent MemberEvent
532-
// MembershipEvent MetaEvent MilestoneEvent OrganizationEvent OrgBlockEvent PackageEvent PageBuildEvent
532+
// MembershipEvent MetaEvent OrganizationEvent OrgBlockEvent PackageEvent PageBuildEvent
533533
// ProjectCardEvent ProjectColumnEvent ProjectEvent RepositoryDispatchEvent RepositoryImportEvent
534534
// RepositoryVulnerabilityAlertEvent SecurityAdvisoryEvent StarEvent StatusEvent TeamEvent TeamAddEvent WatchEvent
535535

@@ -1005,6 +1005,41 @@ void lateBind() {
10051005
}
10061006
}
10071007

1008+
/**
1009+
* A milestone event has been triggered.
1010+
*
1011+
* @see <a href="https://docs.github.com/en/webhooks/webhook-events-and-payloads#milestone">milestone event</a>
1012+
*/
1013+
public static class Milestone extends GHEventPayload {
1014+
1015+
private GHMilestone milestone;
1016+
1017+
/**
1018+
* Create default Milestone instance
1019+
*/
1020+
public Milestone() {
1021+
}
1022+
1023+
/**
1024+
* Gets the milestone.
1025+
*
1026+
* @return the milestone
1027+
*/
1028+
@SuppressFBWarnings(value = { "EI_EXPOSE_REP" }, justification = "Expected behavior")
1029+
public GHMilestone getMilestone() {
1030+
return milestone;
1031+
}
1032+
1033+
@Override
1034+
void lateBind() {
1035+
super.lateBind();
1036+
GHRepository repository = getRepository();
1037+
if (repository != null && milestone != null) {
1038+
milestone.lateBind(repository);
1039+
}
1040+
}
1041+
}
1042+
10081043
/**
10091044
* A ping.
10101045
*

‎src/main/java/org/kohsuke/github/GHMilestone.java‎

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

33
import com.infradna.tool.bridge_method_injector.WithBridgeMethods;
4+
import edu.umd.cs.findbugs.annotations.CheckForNull;
45
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
6+
import org.kohsuke.github.internal.EnumUtils;
57

68
import java.io.IOException;
79
import java.net.URL;
810
import java.time.Instant;
911
import java.util.Date;
10-
import java.util.Locale;
1112

1213
// TODO: Auto-generated Javadoc
1314
/**
@@ -141,10 +142,11 @@ public GHRepository getOwner() {
141142
/**
142143
* Gets state.
143144
*
144-
* @return the state
145+
* @return the state, or {@code null} if the state is not available
145146
*/
147+
@CheckForNull
146148
public GHMilestoneState getState() {
147-
return Enum.valueOf(GHMilestoneState.class, state.toUpperCase(Locale.ENGLISH));
149+
return EnumUtils.getNullableEnumOrDefault(GHMilestoneState.class, state, GHMilestoneState.UNKNOWN);
148150
}
149151

150152
/**
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
package org.kohsuke.github;
2+
3+
/**
4+
* Lists up milestones with filtering and sorting.
5+
*
6+
* @see GHRepository#queryMilestones() GHRepository#queryMilestones()
7+
*/
8+
public class GHMilestoneQueryBuilder extends GHQueryBuilder<GHMilestone> {
9+
/**
10+
* The enum Sort.
11+
*/
12+
public enum Sort {
13+
14+
/** Sort by completeness (percentage of issues closed). */
15+
COMPLETENESS,
16+
/** Sort by due date. */
17+
DUE_ON
18+
}
19+
20+
private final GHRepository repo;
21+
22+
/**
23+
* Instantiates a new GH milestone query builder.
24+
*
25+
* @param repo
26+
* the repo
27+
*/
28+
GHMilestoneQueryBuilder(GHRepository repo) {
29+
super(repo.root());
30+
this.repo = repo;
31+
}
32+
33+
/**
34+
* Direction gh milestone query builder.
35+
*
36+
* @param d
37+
* the d
38+
* @return the gh milestone query builder
39+
*/
40+
public GHMilestoneQueryBuilder direction(GHDirection d) {
41+
req.with("direction", d);
42+
return this;
43+
}
44+
45+
/**
46+
* List.
47+
*
48+
* @return the paged iterable
49+
*/
50+
@Override
51+
public PagedIterable<GHMilestone> list() {
52+
return req.withUrlPath(repo.getApiTailUrl("milestones"))
53+
.toIterable(GHMilestone[].class, item -> item.lateBind(repo));
54+
}
55+
56+
/**
57+
* Sort gh milestone query builder.
58+
*
59+
* @param sort
60+
* the sort
61+
* @return the gh milestone query builder
62+
*/
63+
public GHMilestoneQueryBuilder sort(Sort sort) {
64+
req.with("sort", sort);
65+
return this;
66+
}
67+
68+
/**
69+
* State gh milestone query builder.
70+
*
71+
* @param state
72+
* the state
73+
* @return the gh milestone query builder
74+
*/
75+
public GHMilestoneQueryBuilder state(GHIssueState state) {
76+
req.with("state", state);
77+
return this;
78+
}
79+
}

‎src/main/java/org/kohsuke/github/GHMilestoneState.java‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,7 @@ public enum GHMilestoneState {
1111
/** The closed. */
1212
CLOSED,
1313
/** The open. */
14-
OPEN
14+
OPEN,
15+
/** The unknown. */
16+
UNKNOWN
1517
}

‎src/main/java/org/kohsuke/github/GHRepository.java‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3007,6 +3007,15 @@ public GHIssueQueryBuilder.ForRepository queryIssues() {
30073007
return new GHIssueQueryBuilder.ForRepository(this);
30083008
}
30093009

3010+
/**
3011+
* Retrieves milestones.
3012+
*
3013+
* @return the gh milestone query builder
3014+
*/
3015+
public GHMilestoneQueryBuilder queryMilestones() {
3016+
return new GHMilestoneQueryBuilder(this);
3017+
}
3018+
30103019
/**
30113020
* Retrieves pull requests.
30123021
*

0 commit comments

Comments
 (0)