Skip to content

Commit 8e90d6c

Browse files
Merge branch 'master' into BUG-id-can-be-bigger-than-int32
2 parents 3f23ebc + fbcd82c commit 8e90d6c

28 files changed

+1233
-217
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.3-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>1726146382</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
}
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)