RFR: Make it possible to cancel a Check

Robin Westberg rwestberg at openjdk.org
Fri Oct 4 06:08:17 UTC 2019


On Thu, 3 Oct 2019 14:05:09 GMT, Erik Helin <ehelin at openjdk.org> wrote:

> Hi all,
> 
> this patch became a bit larger than I initially thought. I added a new `CheckState` - `CANCELLED` and a new method to `CheckBuider` - `cancel()`. However to fully support this I needed to quite a bit of refactoring in both `GitHubPullRequest` and `GitLabMergeRequest` so that `createCheck` allows checks with all kinds of states to be created.
> 
> ## Testing
> - [x] `sh gradlew test` passes on Linux x86_64
> - [x] Added one new unit test
> - [x] `sh gradlew test` with credentials mostly passes against both GitHub and GitLab (there are a few known failures)
> 
> Thanks,
> Erik
> 
> ----------------
> 
> Commits:
>  - ed66f45c: Make it possible cancel a Check
> 
> Changes: https://git.openjdk.java.net/skara/pull/180/files
>  Webrev: https://webrevs.openjdk.java.net/skara/180/webrev.00
>   Stats: 245 lines in 5 files changed: 149 ins; 48 del; 48 mod
>   Patch: https://git.openjdk.java.net/skara/pull/180.diff
>   Fetch: git fetch https://git.openjdk.java.net/skara pull/180/head:pull/180

host/src/main/java/org/openjdk/skara/host/gitlab/GitLabMergeRequest.java line 454:

> 453:                 var annotationString = "  - ";
> 454:                 switch (annotation.level()) {
> 455:                     case NOTICE:

Suggestion:

                body = "❌ The merge request check **" + check.name() + "** has been cancelled.";

PR: https://git.openjdk.java.net/skara/pull/180


More information about the skara-dev mailing list