Skip to content

Commit 04df7c1

Browse files
authored
Merge branch 'master' into BUG-search-issues-id-can-be-bigger-than-int32
2 parents 0d9322f + eeff7bf commit 04df7c1

40 files changed

+1246
-228
lines changed

.github/workflows/release.yml

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

1616
- uses: actions/checkout@v4
1717

18-
- uses: actions/setup-java@v3
18+
- uses: actions/setup-java@v4
1919
with:
2020
java-version: 11
2121
distribution: corretto

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44

55
<artifactId>github-client</artifactId>
6-
<version>0.2.15-SNAPSHOT</version>
6+
<version>0.3.4-SNAPSHOT</version>
77

88
<parent>
99
<groupId>com.spotify</groupId>
@@ -84,7 +84,7 @@
8484
<properties>
8585
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
8686
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
87-
<project.build.outputTimestamp>1706783295</project.build.outputTimestamp>
87+
<project.build.outputTimestamp>1737127111</project.build.outputTimestamp>
8888
<spotbugs.excludeFilterFile>spotbugsexclude.xml</spotbugs.excludeFilterFile>
8989
<checkstyle.violationSeverity>error</checkstyle.violationSeverity>
9090
<checkstyle.config.location>checkstyle.xml</checkstyle.config.location>
@@ -249,7 +249,7 @@
249249
<dependency>
250250
<groupId>commons-io</groupId>
251251
<artifactId>commons-io</artifactId>
252-
<version>2.7</version>
252+
<version>2.14.0</version>
253253
<scope>compile</scope>
254254
</dependency>
255255
</dependencies>

src/main/java/com/spotify/github/async/Async.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020

2121
package com.spotify.github.async;
2222

23+
import java.util.concurrent.CompletableFuture;
24+
import java.util.function.Function;
2325
import java.util.stream.Stream;
2426

2527
import static java.util.stream.StreamSupport.stream;
@@ -34,4 +36,19 @@ public static <T> Stream<T> streamFromPaginatingIterable(final Iterable<AsyncPag
3436
return stream(iterable.spliterator(), false)
3537
.flatMap(page -> stream(page.spliterator(), false));
3638
}
39+
40+
public static <T> CompletableFuture<T> exceptionallyCompose(
41+
final CompletableFuture<T> future, final Function<Throwable, CompletableFuture<T>> handler) {
42+
43+
return future
44+
.handle(
45+
(result, throwable) -> {
46+
if (throwable != null) {
47+
return handler.apply(throwable);
48+
} else {
49+
return CompletableFuture.completedFuture(result);
50+
}
51+
})
52+
.thenCompose(Function.identity());
53+
}
3754
}

src/main/java/com/spotify/github/jackson/Json.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
package com.spotify.github.jackson;
2222

23-
import static com.fasterxml.jackson.databind.PropertyNamingStrategy.SNAKE_CASE;
23+
import com.fasterxml.jackson.databind.PropertyNamingStrategies;
2424
import static java.util.Objects.isNull;
2525

2626
import com.fasterxml.jackson.annotation.JsonInclude;
@@ -248,6 +248,6 @@ private static class DefaultMapper {
248248
.enable(SerializationFeature.WRITE_DATES_WITH_ZONE_ID)
249249
.enable(DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES)
250250
.setSerializationInclusion(JsonInclude.Include.NON_NULL)
251-
.setPropertyNamingStrategy(SNAKE_CASE);
251+
.setPropertyNamingStrategy(PropertyNamingStrategies.SNAKE_CASE);
252252
}
253253
}

src/main/java/com/spotify/github/v3/activity/events/CreateEvent.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ public interface CreateEvent extends BaseEvent {
4747
String masterBranch();
4848

4949
/** The repository's current description. */
50-
@Nullable
5150
Optional<String> description();
5251

5352
/** No doc found on github - Usually is "user". */

src/main/java/com/spotify/github/v3/activity/events/PushEvent.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ public interface PushEvent {
9393
List<PushCommit> commits();
9494

9595
/** The push commit object of the most recent commit on ref after the push. */
96-
@Nullable
9796
Optional<PushCommit> headCommit();
9897

9998
/** Pusher */

src/main/java/com/spotify/github/v3/activity/events/StatusEvent.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ public interface StatusEvent extends BaseEvent, UpdateTracking {
6666
String context();
6767

6868
/** The optional human-readable description added to the status. */
69-
@Nullable
7069
Optional<String> description();
7170

7271
/** The new state. Can be pending, success, failure, or error. */
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*-
2+
* -\-\-
3+
* github-api
4+
* --
5+
* Copyright (C) 2016 - 2020 Spotify AB
6+
* --
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
* -/-/-
19+
*/
20+
21+
package com.spotify.github.v3.clients;
22+
23+
public class ActionsClient {
24+
private final String owner;
25+
private final String repo;
26+
private final GitHubClient github;
27+
28+
ActionsClient(final GitHubClient github, final String owner, final String repo) {
29+
this.github = github;
30+
this.owner = owner;
31+
this.repo = repo;
32+
}
33+
34+
static ActionsClient create(final GitHubClient github, final String owner, final String repo) {
35+
return new ActionsClient(github, owner, repo);
36+
}
37+
38+
/**
39+
* Workflows API client
40+
*
41+
* @return Workflows API client
42+
*/
43+
public WorkflowsClient createWorkflowsClient() {
44+
return WorkflowsClient.create(github, owner, repo);
45+
}
46+
}

0 commit comments

Comments
 (0)