From 11d34aeadb8bcff1aba98355873eafafb9ac6f86 Mon Sep 17 00:00:00 2001 From: cyrilico <19289022+cyrilico@users.noreply.github.com> Date: Fri, 5 Sep 2025 16:03:28 +0100 Subject: [PATCH 1/4] add force-cancel workflow run --- .../org/kohsuke/github/GHWorkflowRun.java | 20 +++++++++ .../kohsuke/github/GHEventPayloadTest.java | 2 + .../org/kohsuke/github/GHWorkflowRunTest.java | 41 +++++++++++++++++++ .../org/kohsuke/github/GHWorkflowTest.java | 1 + 4 files changed, 64 insertions(+) diff --git a/src/main/java/org/kohsuke/github/GHWorkflowRun.java b/src/main/java/org/kohsuke/github/GHWorkflowRun.java index 2bf429324a..a476ebe5a9 100644 --- a/src/main/java/org/kohsuke/github/GHWorkflowRun.java +++ b/src/main/java/org/kohsuke/github/GHWorkflowRun.java @@ -209,6 +209,7 @@ public String toString() { } private GHUser actor; private String artifactsUrl; + private String forceCancelUrl; private String cancelUrl; private String checkSuiteUrl; @@ -267,6 +268,16 @@ public void cancel() throws IOException { root().createRequest().method("POST").withUrlPath(getApiRoute(), "cancel").send(); } + /** + * Force-cancel the workflow run. + * + * @throws IOException + * the io exception + */ + public void forceCancel() throws IOException { + root().createRequest().method("POST").withUrlPath(getApiRoute(), "force-cancel").send(); + } + /** * Delete the workflow run. * @@ -336,6 +347,15 @@ public URL getCancelUrl() { return GitHubClient.parseURL(cancelUrl); } + /** + * The cancel URL, like https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/force-cancel + * + * @return the cancel url + */ + public URL getForceCancelUrl() { + return GitHubClient.parseURL(forceCancelUrl); + } + /** * The check suite URL, like https://api.github.com/repos/octo-org/octo-repo/check-suites/414944374 * diff --git a/src/test/java/org/kohsuke/github/GHEventPayloadTest.java b/src/test/java/org/kohsuke/github/GHEventPayloadTest.java index 506bb62269..4ed618a69a 100644 --- a/src/test/java/org/kohsuke/github/GHEventPayloadTest.java +++ b/src/test/java/org/kohsuke/github/GHEventPayloadTest.java @@ -1795,6 +1795,8 @@ public void workflow_run() throws Exception { is("https://api.github.com/repos/gsmet/quarkus-bot-java-playground/check-suites/2327154397")); assertThat(workflowRun.getArtifactsUrl().toString(), is("https://api.github.com/repos/gsmet/quarkus-bot-java-playground/actions/runs/680604745/artifacts")); + assertThat(workflowRun.getForceCancelUrl().toString(), + is("https://api.github.com/repos/gsmet/quarkus-bot-java-playground/actions/runs/680604745/force-cancel")); assertThat(workflowRun.getCancelUrl().toString(), is("https://api.github.com/repos/gsmet/quarkus-bot-java-playground/actions/runs/680604745/cancel")); assertThat(workflowRun.getRerunUrl().toString(), diff --git a/src/test/java/org/kohsuke/github/GHWorkflowRunTest.java b/src/test/java/org/kohsuke/github/GHWorkflowRunTest.java index 960a8e2307..7bd9d6f228 100644 --- a/src/test/java/org/kohsuke/github/GHWorkflowRunTest.java +++ b/src/test/java/org/kohsuke/github/GHWorkflowRunTest.java @@ -420,6 +420,46 @@ public void testCancelAndRerun() throws IOException { workflowRun.cancel(); } + /** + * Test force cancel a run. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ + @Test + public void testForceCancel() throws IOException { + GHWorkflow workflow = repo.getWorkflow(SLOW_WORKFLOW_PATH); + + long latestPreexistingWorkflowRunId = getLatestPreexistingWorkflowRunId(); + + workflow.dispatch(MAIN_BRANCH); + + // now that we have triggered the workflow run, we will wait until it's in progress and then force cancel it + await((nonRecordingRepo) -> getWorkflowRun(nonRecordingRepo, + SLOW_WORKFLOW_NAME, + MAIN_BRANCH, + Status.IN_PROGRESS, + latestPreexistingWorkflowRunId).isPresent()); + + GHWorkflowRun workflowRun = getWorkflowRun(SLOW_WORKFLOW_NAME, + MAIN_BRANCH, + Status.IN_PROGRESS, + latestPreexistingWorkflowRunId) + .orElseThrow(() -> new IllegalStateException("We must have a valid workflow run starting from here")); + + assertThat(workflowRun.getId(), notNullValue()); + + workflowRun.forceCancel(); + long cancelledWorkflowRunId = workflowRun.getId(); + + // let's wait until it's completed + await((nonRecordingRepo) -> getWorkflowRunStatus(nonRecordingRepo, cancelledWorkflowRunId) == Status.COMPLETED); + + // let's check that it has been properly cancelled + workflowRun = repo.getWorkflowRun(cancelledWorkflowRunId); + assertThat(workflowRun.getConclusion(), equalTo(Conclusion.CANCELLED)); + } + /** * Test delete. * @@ -591,6 +631,7 @@ public void testManualRunAndBasicInformation() throws IOException { assertThat(workflowRun.getCheckSuiteUrl().getPath(), containsString("/check-suites/")); assertThat(workflowRun.getArtifactsUrl().getPath(), endsWith("/artifacts")); assertThat(workflowRun.getCancelUrl().getPath(), endsWith("/cancel")); + assertThat(workflowRun.getForceCancelUrl().getPath(), endsWith("/force-cancel")); assertThat(workflowRun.getRerunUrl().getPath(), endsWith("/rerun")); assertThat(workflowRun.getWorkflowUrl().getPath(), containsString("/actions/workflows/")); assertThat(workflowRun.getHeadBranch(), equalTo(MAIN_BRANCH)); diff --git a/src/test/java/org/kohsuke/github/GHWorkflowTest.java b/src/test/java/org/kohsuke/github/GHWorkflowTest.java index 836907ae91..ee5825ec38 100644 --- a/src/test/java/org/kohsuke/github/GHWorkflowTest.java +++ b/src/test/java/org/kohsuke/github/GHWorkflowTest.java @@ -35,6 +35,7 @@ private static void checkWorkflowRunProperties(GHWorkflowRun workflowRun, long w assertThat(workflowRun.getCheckSuiteUrl().getPath(), containsString("/check-suites/")); assertThat(workflowRun.getArtifactsUrl().getPath(), endsWith("/artifacts")); assertThat(workflowRun.getCancelUrl().getPath(), endsWith("/cancel")); + assertThat(workflowRun.getForceCancelUrl().getPath(), endsWith("/force-cancel")); assertThat(workflowRun.getRerunUrl().getPath(), endsWith("/rerun")); assertThat(workflowRun.getWorkflowUrl().getPath(), containsString("/actions/workflows/")); assertThat(workflowRun.getHeadBranch(), equalTo("main")); From 7a05c464c5d63d8eb8b1ab69fa9658f676f0cd5e Mon Sep 17 00:00:00 2001 From: cyrilico <19289022+cyrilico@users.noreply.github.com> Date: Fri, 5 Sep 2025 16:10:21 +0100 Subject: [PATCH 2/4] mvn spotless:apply --- .../org/kohsuke/github/GHWorkflowRun.java | 42 ++++++------ .../org/kohsuke/github/GHWorkflowRunTest.java | 64 +++++++++---------- 2 files changed, 53 insertions(+), 53 deletions(-) diff --git a/src/main/java/org/kohsuke/github/GHWorkflowRun.java b/src/main/java/org/kohsuke/github/GHWorkflowRun.java index a476ebe5a9..65c0a0bc01 100644 --- a/src/main/java/org/kohsuke/github/GHWorkflowRun.java +++ b/src/main/java/org/kohsuke/github/GHWorkflowRun.java @@ -209,13 +209,13 @@ public String toString() { } private GHUser actor; private String artifactsUrl; - private String forceCancelUrl; private String cancelUrl; private String checkSuiteUrl; - private String conclusion; + private String displayTitle; private String event; + private String forceCancelUrl; private String headBranch; private HeadCommit headCommit; @@ -268,16 +268,6 @@ public void cancel() throws IOException { root().createRequest().method("POST").withUrlPath(getApiRoute(), "cancel").send(); } - /** - * Force-cancel the workflow run. - * - * @throws IOException - * the io exception - */ - public void forceCancel() throws IOException { - root().createRequest().method("POST").withUrlPath(getApiRoute(), "force-cancel").send(); - } - /** * Delete the workflow run. * @@ -319,6 +309,16 @@ public T downloadLogs(InputStreamFunction streamFunction) throws IOExcept return root().createRequest().method("GET").withUrlPath(getApiRoute(), "logs").fetchStream(streamFunction); } + /** + * Force-cancel the workflow run. + * + * @throws IOException + * the io exception + */ + public void forceCancel() throws IOException { + root().createRequest().method("POST").withUrlPath(getApiRoute(), "force-cancel").send(); + } + /** * The actor which triggered the initial run. * @@ -347,15 +347,6 @@ public URL getCancelUrl() { return GitHubClient.parseURL(cancelUrl); } - /** - * The cancel URL, like https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/force-cancel - * - * @return the cancel url - */ - public URL getForceCancelUrl() { - return GitHubClient.parseURL(forceCancelUrl); - } - /** * The check suite URL, like https://api.github.com/repos/octo-org/octo-repo/check-suites/414944374 * @@ -394,6 +385,15 @@ public GHEvent getEvent() { return EnumUtils.getNullableEnumOrDefault(GHEvent.class, event, GHEvent.UNKNOWN); } + /** + * The cancel URL, like https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/force-cancel + * + * @return the cancel url + */ + public URL getForceCancelUrl() { + return GitHubClient.parseURL(forceCancelUrl); + } + /** * The head branch name the changes are on. * diff --git a/src/test/java/org/kohsuke/github/GHWorkflowRunTest.java b/src/test/java/org/kohsuke/github/GHWorkflowRunTest.java index 7bd9d6f228..8d3a5efeab 100644 --- a/src/test/java/org/kohsuke/github/GHWorkflowRunTest.java +++ b/src/test/java/org/kohsuke/github/GHWorkflowRunTest.java @@ -421,81 +421,81 @@ public void testCancelAndRerun() throws IOException { } /** - * Test force cancel a run. + * Test delete. * * @throws IOException * Signals that an I/O exception has occurred. */ @Test - public void testForceCancel() throws IOException { - GHWorkflow workflow = repo.getWorkflow(SLOW_WORKFLOW_PATH); + public void testDelete() throws IOException { + GHWorkflow workflow = repo.getWorkflow(FAST_WORKFLOW_PATH); long latestPreexistingWorkflowRunId = getLatestPreexistingWorkflowRunId(); workflow.dispatch(MAIN_BRANCH); - // now that we have triggered the workflow run, we will wait until it's in progress and then force cancel it await((nonRecordingRepo) -> getWorkflowRun(nonRecordingRepo, - SLOW_WORKFLOW_NAME, + FAST_WORKFLOW_NAME, MAIN_BRANCH, - Status.IN_PROGRESS, + Status.COMPLETED, latestPreexistingWorkflowRunId).isPresent()); - GHWorkflowRun workflowRun = getWorkflowRun(SLOW_WORKFLOW_NAME, + GHWorkflowRun workflowRunToDelete = getWorkflowRun(FAST_WORKFLOW_NAME, MAIN_BRANCH, - Status.IN_PROGRESS, + Status.COMPLETED, latestPreexistingWorkflowRunId) .orElseThrow(() -> new IllegalStateException("We must have a valid workflow run starting from here")); - assertThat(workflowRun.getId(), notNullValue()); - - workflowRun.forceCancel(); - long cancelledWorkflowRunId = workflowRun.getId(); + assertThat(workflowRunToDelete.getId(), notNullValue()); - // let's wait until it's completed - await((nonRecordingRepo) -> getWorkflowRunStatus(nonRecordingRepo, cancelledWorkflowRunId) == Status.COMPLETED); + workflowRunToDelete.delete(); - // let's check that it has been properly cancelled - workflowRun = repo.getWorkflowRun(cancelledWorkflowRunId); - assertThat(workflowRun.getConclusion(), equalTo(Conclusion.CANCELLED)); + try { + repo.getWorkflowRun(workflowRunToDelete.getId()); + fail("The workflow " + workflowRunToDelete.getId() + " should have been deleted."); + } catch (GHFileNotFoundException e) { + // success + } } /** - * Test delete. + * Test force cancel a run. * * @throws IOException * Signals that an I/O exception has occurred. */ @Test - public void testDelete() throws IOException { - GHWorkflow workflow = repo.getWorkflow(FAST_WORKFLOW_PATH); + public void testForceCancel() throws IOException { + GHWorkflow workflow = repo.getWorkflow(SLOW_WORKFLOW_PATH); long latestPreexistingWorkflowRunId = getLatestPreexistingWorkflowRunId(); workflow.dispatch(MAIN_BRANCH); + // now that we have triggered the workflow run, we will wait until it's in progress and then force cancel it await((nonRecordingRepo) -> getWorkflowRun(nonRecordingRepo, - FAST_WORKFLOW_NAME, + SLOW_WORKFLOW_NAME, MAIN_BRANCH, - Status.COMPLETED, + Status.IN_PROGRESS, latestPreexistingWorkflowRunId).isPresent()); - GHWorkflowRun workflowRunToDelete = getWorkflowRun(FAST_WORKFLOW_NAME, + GHWorkflowRun workflowRun = getWorkflowRun(SLOW_WORKFLOW_NAME, MAIN_BRANCH, - Status.COMPLETED, + Status.IN_PROGRESS, latestPreexistingWorkflowRunId) .orElseThrow(() -> new IllegalStateException("We must have a valid workflow run starting from here")); - assertThat(workflowRunToDelete.getId(), notNullValue()); + assertThat(workflowRun.getId(), notNullValue()); - workflowRunToDelete.delete(); + workflowRun.forceCancel(); + long cancelledWorkflowRunId = workflowRun.getId(); - try { - repo.getWorkflowRun(workflowRunToDelete.getId()); - fail("The workflow " + workflowRunToDelete.getId() + " should have been deleted."); - } catch (GHFileNotFoundException e) { - // success - } + // let's wait until it's completed + await((nonRecordingRepo) -> getWorkflowRunStatus(nonRecordingRepo, cancelledWorkflowRunId) == Status.COMPLETED); + + // let's check that it has been properly cancelled + workflowRun = repo.getWorkflowRun(cancelledWorkflowRunId); + assertThat(workflowRun.getConclusion(), equalTo(Conclusion.CANCELLED)); } /** From e54d7766d6930f7c21d5600c19904e9beb16f707 Mon Sep 17 00:00:00 2001 From: cyrilico <19289022+cyrilico@users.noreply.github.com> Date: Fri, 5 Sep 2025 16:25:16 +0100 Subject: [PATCH 3/4] remove forceCancelUrl logic this property is not part of workflow_run payloads --- .../org/kohsuke/github/GHWorkflowRun.java | 10 - .../kohsuke/github/GHEventPayloadTest.java | 2 - .../org/kohsuke/github/GHWorkflowRunTest.java | 1 - .../org/kohsuke/github/GHWorkflowTest.java | 1 - .../testForceCancel/__files/1-user.json | 46 +++++ .../__files/2-r_h_ghworkflowruntest.json | 126 ++++++++++++ ..._g_actions_workflows_slow-workflowyml.json | 12 ++ .../__files/4-r_h_g_actions_runs.json | 179 ++++++++++++++++++ .../__files/6-r_h_g_actions_runs.json | 179 ++++++++++++++++++ .../8-r_h_g_actions_runs_686036126.json | 174 +++++++++++++++++ .../testForceCancel/mappings/1-user.json | 46 +++++ ...0-r_h_g_actions_runs_686036126_cancel.json | 49 +++++ .../mappings/2-r_h_ghworkflowruntest.json | 46 +++++ ..._g_actions_workflows_slow-workflowyml.json | 45 +++++ .../mappings/4-r_h_g_actions_runs.json | 46 +++++ ..._actions_workflows_6820849_dispatches.json | 45 +++++ .../mappings/6-r_h_g_actions_runs.json | 45 +++++ ...7-r_h_g_actions_runs_686036126_cancel.json | 50 +++++ .../8-r_h_g_actions_runs_686036126.json | 45 +++++ .../9-r_h_g_actions_runs_686036126_rerun.json | 52 +++++ 20 files changed, 1185 insertions(+), 14 deletions(-) create mode 100644 src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/__files/1-user.json create mode 100644 src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/__files/2-r_h_ghworkflowruntest.json create mode 100644 src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/__files/3-r_h_g_actions_workflows_slow-workflowyml.json create mode 100644 src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/__files/4-r_h_g_actions_runs.json create mode 100644 src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/__files/6-r_h_g_actions_runs.json create mode 100644 src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/__files/8-r_h_g_actions_runs_686036126.json create mode 100644 src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/mappings/1-user.json create mode 100644 src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/mappings/10-r_h_g_actions_runs_686036126_cancel.json create mode 100644 src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/mappings/2-r_h_ghworkflowruntest.json create mode 100644 src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/mappings/3-r_h_g_actions_workflows_slow-workflowyml.json create mode 100644 src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/mappings/4-r_h_g_actions_runs.json create mode 100644 src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/mappings/5-r_h_g_actions_workflows_6820849_dispatches.json create mode 100644 src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/mappings/6-r_h_g_actions_runs.json create mode 100644 src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/mappings/7-r_h_g_actions_runs_686036126_cancel.json create mode 100644 src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/mappings/8-r_h_g_actions_runs_686036126.json create mode 100644 src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/mappings/9-r_h_g_actions_runs_686036126_rerun.json diff --git a/src/main/java/org/kohsuke/github/GHWorkflowRun.java b/src/main/java/org/kohsuke/github/GHWorkflowRun.java index 65c0a0bc01..e5a2456ec8 100644 --- a/src/main/java/org/kohsuke/github/GHWorkflowRun.java +++ b/src/main/java/org/kohsuke/github/GHWorkflowRun.java @@ -215,7 +215,6 @@ public String toString() { private String displayTitle; private String event; - private String forceCancelUrl; private String headBranch; private HeadCommit headCommit; @@ -385,15 +384,6 @@ public GHEvent getEvent() { return EnumUtils.getNullableEnumOrDefault(GHEvent.class, event, GHEvent.UNKNOWN); } - /** - * The cancel URL, like https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/force-cancel - * - * @return the cancel url - */ - public URL getForceCancelUrl() { - return GitHubClient.parseURL(forceCancelUrl); - } - /** * The head branch name the changes are on. * diff --git a/src/test/java/org/kohsuke/github/GHEventPayloadTest.java b/src/test/java/org/kohsuke/github/GHEventPayloadTest.java index 4ed618a69a..506bb62269 100644 --- a/src/test/java/org/kohsuke/github/GHEventPayloadTest.java +++ b/src/test/java/org/kohsuke/github/GHEventPayloadTest.java @@ -1795,8 +1795,6 @@ public void workflow_run() throws Exception { is("https://api.github.com/repos/gsmet/quarkus-bot-java-playground/check-suites/2327154397")); assertThat(workflowRun.getArtifactsUrl().toString(), is("https://api.github.com/repos/gsmet/quarkus-bot-java-playground/actions/runs/680604745/artifacts")); - assertThat(workflowRun.getForceCancelUrl().toString(), - is("https://api.github.com/repos/gsmet/quarkus-bot-java-playground/actions/runs/680604745/force-cancel")); assertThat(workflowRun.getCancelUrl().toString(), is("https://api.github.com/repos/gsmet/quarkus-bot-java-playground/actions/runs/680604745/cancel")); assertThat(workflowRun.getRerunUrl().toString(), diff --git a/src/test/java/org/kohsuke/github/GHWorkflowRunTest.java b/src/test/java/org/kohsuke/github/GHWorkflowRunTest.java index 8d3a5efeab..f2eda74276 100644 --- a/src/test/java/org/kohsuke/github/GHWorkflowRunTest.java +++ b/src/test/java/org/kohsuke/github/GHWorkflowRunTest.java @@ -631,7 +631,6 @@ public void testManualRunAndBasicInformation() throws IOException { assertThat(workflowRun.getCheckSuiteUrl().getPath(), containsString("/check-suites/")); assertThat(workflowRun.getArtifactsUrl().getPath(), endsWith("/artifacts")); assertThat(workflowRun.getCancelUrl().getPath(), endsWith("/cancel")); - assertThat(workflowRun.getForceCancelUrl().getPath(), endsWith("/force-cancel")); assertThat(workflowRun.getRerunUrl().getPath(), endsWith("/rerun")); assertThat(workflowRun.getWorkflowUrl().getPath(), containsString("/actions/workflows/")); assertThat(workflowRun.getHeadBranch(), equalTo(MAIN_BRANCH)); diff --git a/src/test/java/org/kohsuke/github/GHWorkflowTest.java b/src/test/java/org/kohsuke/github/GHWorkflowTest.java index ee5825ec38..836907ae91 100644 --- a/src/test/java/org/kohsuke/github/GHWorkflowTest.java +++ b/src/test/java/org/kohsuke/github/GHWorkflowTest.java @@ -35,7 +35,6 @@ private static void checkWorkflowRunProperties(GHWorkflowRun workflowRun, long w assertThat(workflowRun.getCheckSuiteUrl().getPath(), containsString("/check-suites/")); assertThat(workflowRun.getArtifactsUrl().getPath(), endsWith("/artifacts")); assertThat(workflowRun.getCancelUrl().getPath(), endsWith("/cancel")); - assertThat(workflowRun.getForceCancelUrl().getPath(), endsWith("/force-cancel")); assertThat(workflowRun.getRerunUrl().getPath(), endsWith("/rerun")); assertThat(workflowRun.getWorkflowUrl().getPath(), containsString("/actions/workflows/")); assertThat(workflowRun.getHeadBranch(), equalTo("main")); diff --git a/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/__files/1-user.json b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/__files/1-user.json new file mode 100644 index 0000000000..79bade964e --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/__files/1-user.json @@ -0,0 +1,46 @@ +{ + "login": "gsmet", + "id": 1279749, + "node_id": "MDQ6VXNlcjEyNzk3NDk=", + "avatar_url": "https://avatars.githubusercontent.com/u/1279749?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/gsmet", + "html_url": "https://github.com/gsmet", + "followers_url": "https://api.github.com/users/gsmet/followers", + "following_url": "https://api.github.com/users/gsmet/following{/other_user}", + "gists_url": "https://api.github.com/users/gsmet/gists{/gist_id}", + "starred_url": "https://api.github.com/users/gsmet/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gsmet/subscriptions", + "organizations_url": "https://api.github.com/users/gsmet/orgs", + "repos_url": "https://api.github.com/users/gsmet/repos", + "events_url": "https://api.github.com/users/gsmet/events{/privacy}", + "received_events_url": "https://api.github.com/users/gsmet/received_events", + "type": "User", + "site_admin": false, + "name": "Guillaume Smet", + "company": "Red Hat", + "blog": "https://www.redhat.com/", + "location": "Lyon, France", + "email": "guillaume.smet@gmail.com", + "hireable": null, + "bio": "Happy camper at Red Hat, working on Quarkus and the Hibernate portfolio.", + "twitter_username": "gsmet_", + "public_repos": 102, + "public_gists": 14, + "followers": 127, + "following": 3, + "created_at": "2011-12-22T11:03:22Z", + "updated_at": "2021-03-23T17:35:45Z", + "private_gists": 14, + "total_private_repos": 4, + "owned_private_repos": 1, + "disk_usage": 68258, + "collaborators": 1, + "two_factor_authentication": true, + "plan": { + "name": "free", + "space": 976562499, + "collaborators": 0, + "private_repos": 10000 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/__files/2-r_h_ghworkflowruntest.json b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/__files/2-r_h_ghworkflowruntest.json new file mode 100644 index 0000000000..7e1a13a6a4 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/__files/2-r_h_ghworkflowruntest.json @@ -0,0 +1,126 @@ +{ + "id": 348674220, + "node_id": "MDEwOlJlcG9zaXRvcnkzNDg2NzQyMjA=", + "name": "GHWorkflowRunTest", + "full_name": "hub4j-test-org/GHWorkflowRunTest", + "private": false, + "owner": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://avatars.githubusercontent.com/u/7544739?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/hub4j-test-org/GHWorkflowRunTest", + "description": "Repository used by GHWorkflowRunTest", + "fork": false, + "url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest", + "forks_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/deployments", + "created_at": "2021-03-17T10:50:49Z", + "updated_at": "2021-03-17T10:56:17Z", + "pushed_at": "2021-03-22T17:53:57Z", + "git_url": "git://github.com/hub4j-test-org/GHWorkflowRunTest.git", + "ssh_url": "git@github.com:hub4j-test-org/GHWorkflowRunTest.git", + "clone_url": "https://github.com/hub4j-test-org/GHWorkflowRunTest.git", + "svn_url": "https://github.com/hub4j-test-org/GHWorkflowRunTest", + "homepage": null, + "size": 3, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 7, + "license": null, + "forks": 0, + "open_issues": 7, + "watchers": 0, + "default_branch": "main", + "permissions": { + "admin": true, + "push": true, + "pull": true + }, + "temp_clone_token": "", + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "delete_branch_on_merge": false, + "organization": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://avatars.githubusercontent.com/u/7544739?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "network_count": 0, + "subscribers_count": 9 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/__files/3-r_h_g_actions_workflows_slow-workflowyml.json b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/__files/3-r_h_g_actions_workflows_slow-workflowyml.json new file mode 100644 index 0000000000..c1c00ffc11 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/__files/3-r_h_g_actions_workflows_slow-workflowyml.json @@ -0,0 +1,12 @@ +{ + "id": 6820849, + "node_id": "MDg6V29ya2Zsb3c2ODIwODQ5", + "name": "Slow workflow", + "path": ".github/workflows/slow-workflow.yml", + "state": "active", + "created_at": "2021-03-17T11:55:06.000+01:00", + "updated_at": "2021-03-17T11:55:06.000+01:00", + "url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/workflows/6820849", + "html_url": "https://github.com/hub4j-test-org/GHWorkflowRunTest/blob/main/.github/workflows/slow-workflow.yml", + "badge_url": "https://github.com/hub4j-test-org/GHWorkflowRunTest/workflows/Slow%20workflow/badge.svg" +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/__files/4-r_h_g_actions_runs.json b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/__files/4-r_h_g_actions_runs.json new file mode 100644 index 0000000000..bbf71ed675 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/__files/4-r_h_g_actions_runs.json @@ -0,0 +1,179 @@ +{ + "total_count": 56, + "workflow_runs": [ + { + "id": 686034992, + "name": "Fast workflow", + "node_id": "MDExOldvcmtmbG93UnVuNjg2MDM0OTky", + "head_branch": "main", + "head_sha": "f6a5c19a67797d64426203b8a7a05a0fd74e5037", + "run_number": 52, + "event": "workflow_dispatch", + "status": "completed", + "conclusion": "success", + "workflow_id": 6820790, + "check_suite_id": 2341210664, + "check_suite_node_id": "MDEwOkNoZWNrU3VpdGUyMzQxMjEwNjY0", + "url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/686034992", + "html_url": "https://github.com/hub4j-test-org/GHWorkflowRunTest/actions/runs/686034992", + "pull_requests": [], + "created_at": "2021-03-25T09:36:45Z", + "updated_at": "2021-03-25T09:37:04Z", + "jobs_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/686034992/jobs", + "logs_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/686034992/logs", + "check_suite_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/check-suites/2341210664", + "artifacts_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/686034992/artifacts", + "cancel_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/686034992/cancel", + "rerun_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/686034992/rerun", + "workflow_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/workflows/6820790", + "head_commit": { + "id": "f6a5c19a67797d64426203b8a7a05a0fd74e5037", + "tree_id": "666bb9f951306171acb21632eca28a386cb35f73", + "message": "Create failing-workflow.yml", + "timestamp": "2021-03-17T10:56:14Z", + "author": { + "name": "Guillaume Smet", + "email": "guillaume.smet@gmail.com" + }, + "committer": { + "name": "GitHub", + "email": "noreply@github.com" + } + }, + "repository": { + "id": 348674220, + "node_id": "MDEwOlJlcG9zaXRvcnkzNDg2NzQyMjA=", + "name": "GHWorkflowRunTest", + "full_name": "hub4j-test-org/GHWorkflowRunTest", + "private": false, + "owner": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://avatars.githubusercontent.com/u/7544739?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/hub4j-test-org/GHWorkflowRunTest", + "description": "Repository used by GHWorkflowRunTest", + "fork": false, + "url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest", + "forks_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/deployments" + }, + "head_repository": { + "id": 348674220, + "node_id": "MDEwOlJlcG9zaXRvcnkzNDg2NzQyMjA=", + "name": "GHWorkflowRunTest", + "full_name": "hub4j-test-org/GHWorkflowRunTest", + "private": false, + "owner": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://avatars.githubusercontent.com/u/7544739?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/hub4j-test-org/GHWorkflowRunTest", + "description": "Repository used by GHWorkflowRunTest", + "fork": false, + "url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest", + "forks_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/deployments" + } + } + ] +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/__files/6-r_h_g_actions_runs.json b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/__files/6-r_h_g_actions_runs.json new file mode 100644 index 0000000000..af45cec363 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/__files/6-r_h_g_actions_runs.json @@ -0,0 +1,179 @@ +{ + "total_count": 1, + "workflow_runs": [ + { + "id": 686036126, + "name": "Slow workflow", + "node_id": "MDExOldvcmtmbG93UnVuNjg2MDM2MTI2", + "head_branch": "main", + "head_sha": "f6a5c19a67797d64426203b8a7a05a0fd74e5037", + "run_number": 16, + "event": "workflow_dispatch", + "status": "in_progress", + "conclusion": null, + "workflow_id": 6820849, + "check_suite_id": 2341213475, + "check_suite_node_id": "MDEwOkNoZWNrU3VpdGUyMzQxMjEzNDc1", + "url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/686036126", + "html_url": "https://github.com/hub4j-test-org/GHWorkflowRunTest/actions/runs/686036126", + "pull_requests": [], + "created_at": "2021-03-25T09:37:09Z", + "updated_at": "2021-03-25T09:37:19Z", + "jobs_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/686036126/jobs", + "logs_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/686036126/logs", + "check_suite_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/check-suites/2341213475", + "artifacts_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/686036126/artifacts", + "cancel_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/686036126/cancel", + "rerun_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/686036126/rerun", + "workflow_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/workflows/6820849", + "head_commit": { + "id": "f6a5c19a67797d64426203b8a7a05a0fd74e5037", + "tree_id": "666bb9f951306171acb21632eca28a386cb35f73", + "message": "Create failing-workflow.yml", + "timestamp": "2021-03-17T10:56:14Z", + "author": { + "name": "Guillaume Smet", + "email": "guillaume.smet@gmail.com" + }, + "committer": { + "name": "GitHub", + "email": "noreply@github.com" + } + }, + "repository": { + "id": 348674220, + "node_id": "MDEwOlJlcG9zaXRvcnkzNDg2NzQyMjA=", + "name": "GHWorkflowRunTest", + "full_name": "hub4j-test-org/GHWorkflowRunTest", + "private": false, + "owner": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://avatars.githubusercontent.com/u/7544739?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/hub4j-test-org/GHWorkflowRunTest", + "description": "Repository used by GHWorkflowRunTest", + "fork": false, + "url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest", + "forks_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/deployments" + }, + "head_repository": { + "id": 348674220, + "node_id": "MDEwOlJlcG9zaXRvcnkzNDg2NzQyMjA=", + "name": "GHWorkflowRunTest", + "full_name": "hub4j-test-org/GHWorkflowRunTest", + "private": false, + "owner": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://avatars.githubusercontent.com/u/7544739?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/hub4j-test-org/GHWorkflowRunTest", + "description": "Repository used by GHWorkflowRunTest", + "fork": false, + "url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest", + "forks_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/deployments" + } + } + ] +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/__files/8-r_h_g_actions_runs_686036126.json b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/__files/8-r_h_g_actions_runs_686036126.json new file mode 100644 index 0000000000..8530af18fb --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/__files/8-r_h_g_actions_runs_686036126.json @@ -0,0 +1,174 @@ +{ + "id": 686036126, + "name": "Slow workflow", + "node_id": "MDExOldvcmtmbG93UnVuNjg2MDM2MTI2", + "head_branch": "main", + "head_sha": "f6a5c19a67797d64426203b8a7a05a0fd74e5037", + "run_number": 16, + "event": "workflow_dispatch", + "status": "completed", + "conclusion": "cancelled", + "workflow_id": 6820849, + "check_suite_id": 2341213475, + "check_suite_node_id": "MDEwOkNoZWNrU3VpdGUyMzQxMjEzNDc1", + "url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/686036126", + "html_url": "https://github.com/hub4j-test-org/GHWorkflowRunTest/actions/runs/686036126", + "pull_requests": [], + "created_at": "2021-03-25T09:37:09Z", + "updated_at": "2021-03-25T09:37:43Z", + "jobs_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/686036126/jobs", + "logs_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/686036126/logs", + "check_suite_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/check-suites/2341213475", + "artifacts_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/686036126/artifacts", + "cancel_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/686036126/cancel", + "rerun_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/686036126/rerun", + "workflow_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/workflows/6820849", + "head_commit": { + "id": "f6a5c19a67797d64426203b8a7a05a0fd74e5037", + "tree_id": "666bb9f951306171acb21632eca28a386cb35f73", + "message": "Create failing-workflow.yml", + "timestamp": "2021-03-17T10:56:14Z", + "author": { + "name": "Guillaume Smet", + "email": "guillaume.smet@gmail.com" + }, + "committer": { + "name": "GitHub", + "email": "noreply@github.com" + } + }, + "repository": { + "id": 348674220, + "node_id": "MDEwOlJlcG9zaXRvcnkzNDg2NzQyMjA=", + "name": "GHWorkflowRunTest", + "full_name": "hub4j-test-org/GHWorkflowRunTest", + "private": false, + "owner": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://avatars.githubusercontent.com/u/7544739?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/hub4j-test-org/GHWorkflowRunTest", + "description": "Repository used by GHWorkflowRunTest", + "fork": false, + "url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest", + "forks_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/deployments" + }, + "head_repository": { + "id": 348674220, + "node_id": "MDEwOlJlcG9zaXRvcnkzNDg2NzQyMjA=", + "name": "GHWorkflowRunTest", + "full_name": "hub4j-test-org/GHWorkflowRunTest", + "private": false, + "owner": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://avatars.githubusercontent.com/u/7544739?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/hub4j-test-org/GHWorkflowRunTest", + "description": "Repository used by GHWorkflowRunTest", + "fork": false, + "url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest", + "forks_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/deployments" + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/mappings/1-user.json b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/mappings/1-user.json new file mode 100644 index 0000000000..9e3e9b003b --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/mappings/1-user.json @@ -0,0 +1,46 @@ +{ + "id": "671767da-fd52-4e20-8fb9-3e65fb20e6a6", + "name": "user", + "request": { + "url": "/user", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "1-user.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 25 Mar 2021 09:37:07 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"879f35eed38dcc75ca2b3a8999425e0d51678f4c73ffade3c5bcc853b59245b6\"", + "Last-Modified": "Tue, 23 Mar 2021 17:35:45 GMT", + "X-OAuth-Scopes": "repo, user, workflow", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4961", + "X-RateLimit-Reset": "1616667526", + "X-RateLimit-Used": "39", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "CD00:609B:198A5DF:1A1E31A:605C59C3" + } + }, + "uuid": "671767da-fd52-4e20-8fb9-3e65fb20e6a6", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/mappings/10-r_h_g_actions_runs_686036126_cancel.json b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/mappings/10-r_h_g_actions_runs_686036126_cancel.json new file mode 100644 index 0000000000..8c3a21d50b --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/mappings/10-r_h_g_actions_runs_686036126_cancel.json @@ -0,0 +1,49 @@ +{ + "id": "1b7916c4-c4be-42e2-8b8a-ed47c299f63c", + "name": "repos_hub4j-test-org_ghworkflowruntest_actions_runs_686036126_cancel", + "request": { + "url": "/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/686036126/cancel", + "method": "POST", + "headers": { + "Accept": { + "equalTo": "application/vnd.github+json" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 202, + "body": "{}", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 25 Mar 2021 09:37:57 GMT", + "Content-Type": "application/json; charset=utf-8", + "X-OAuth-Scopes": "repo, user, workflow", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4939", + "X-RateLimit-Reset": "1616667526", + "X-RateLimit-Used": "61", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "Vary": "Accept-Encoding, Accept, X-Requested-With", + "X-GitHub-Request-Id": "CD00:609B:198DEF3:1A21D5B:605C59F5" + } + }, + "uuid": "1b7916c4-c4be-42e2-8b8a-ed47c299f63c", + "persistent": true, + "scenarioName": "scenario-1-repos-hub4j-test-org-GHWorkflowRunTest-actions-runs-686036126-cancel", + "requiredScenarioState": "scenario-1-repos-hub4j-test-org-GHWorkflowRunTest-actions-runs-686036126-cancel-2", + "insertionIndex": 10 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/mappings/2-r_h_ghworkflowruntest.json b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/mappings/2-r_h_ghworkflowruntest.json new file mode 100644 index 0000000000..58cf803d25 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/mappings/2-r_h_ghworkflowruntest.json @@ -0,0 +1,46 @@ +{ + "id": "8b1bfd77-24af-44ed-9b8d-c63d0d041797", + "name": "repos_hub4j-test-org_ghworkflowruntest", + "request": { + "url": "/repos/hub4j-test-org/GHWorkflowRunTest", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "2-r_h_ghworkflowruntest.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 25 Mar 2021 09:37:08 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"c31f2677fb5b82356abd6930419a16b19ffad1abeca1de1d12e66e658b36d027\"", + "Last-Modified": "Wed, 17 Mar 2021 10:56:17 GMT", + "X-OAuth-Scopes": "repo, user, workflow", + "X-Accepted-OAuth-Scopes": "repo", + "X-GitHub-Media-Type": "unknown, github.v3", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4959", + "X-RateLimit-Reset": "1616667526", + "X-RateLimit-Used": "41", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "CD00:609B:198A646:1A1E38D:605C59C3" + } + }, + "uuid": "8b1bfd77-24af-44ed-9b8d-c63d0d041797", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/mappings/3-r_h_g_actions_workflows_slow-workflowyml.json b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/mappings/3-r_h_g_actions_workflows_slow-workflowyml.json new file mode 100644 index 0000000000..593c1e4848 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/mappings/3-r_h_g_actions_workflows_slow-workflowyml.json @@ -0,0 +1,45 @@ +{ + "id": "6e0a2fd8-b590-4954-be47-bfdcf94b4094", + "name": "repos_hub4j-test-org_ghworkflowruntest_actions_workflows_slow-workflowyml", + "request": { + "url": "/repos/hub4j-test-org/GHWorkflowRunTest/actions/workflows/slow-workflow.yml", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "3-r_h_g_actions_workflows_slow-workflowyml.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 25 Mar 2021 09:37:08 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"f3c669487342bb42726eeb2d3eca9c83111ab5ad0e817f04b531a49802e23276\"", + "X-OAuth-Scopes": "repo, user, workflow", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4958", + "X-RateLimit-Reset": "1616667526", + "X-RateLimit-Used": "42", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "CD00:609B:198A685:1A1E3CD:605C59C4" + } + }, + "uuid": "6e0a2fd8-b590-4954-be47-bfdcf94b4094", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/mappings/4-r_h_g_actions_runs.json b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/mappings/4-r_h_g_actions_runs.json new file mode 100644 index 0000000000..67022b6f72 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/mappings/4-r_h_g_actions_runs.json @@ -0,0 +1,46 @@ +{ + "id": "9145f708-8236-444a-8bd3-c70e00d537d4", + "name": "repos_hub4j-test-org_ghworkflowruntest_actions_runs", + "request": { + "url": "/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs?per_page=1", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "4-r_h_g_actions_runs.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 25 Mar 2021 09:37:08 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"9f779230ccdc33fc688e7cb418412e3a2bfd055aa700bd032dceba2d9d1a357b\"", + "X-OAuth-Scopes": "repo, user, workflow", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4957", + "X-RateLimit-Reset": "1616667526", + "X-RateLimit-Used": "43", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "CD00:609B:198A6B2:1A1E3F0:605C59C4", + "Link": "; rel=\"next\", ; rel=\"last\"" + } + }, + "uuid": "9145f708-8236-444a-8bd3-c70e00d537d4", + "persistent": true, + "insertionIndex": 4 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/mappings/5-r_h_g_actions_workflows_6820849_dispatches.json b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/mappings/5-r_h_g_actions_workflows_6820849_dispatches.json new file mode 100644 index 0000000000..58f908e137 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/mappings/5-r_h_g_actions_workflows_6820849_dispatches.json @@ -0,0 +1,45 @@ +{ + "id": "ef20ff92-f593-4ed2-934b-8cb50f2237e3", + "name": "repos_hub4j-test-org_ghworkflowruntest_actions_workflows_6820849_dispatches", + "request": { + "url": "/repos/hub4j-test-org/GHWorkflowRunTest/actions/workflows/6820849/dispatches", + "method": "POST", + "headers": { + "Accept": { + "equalTo": "application/vnd.github+json" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"ref\":\"main\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 204, + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 25 Mar 2021 09:37:08 GMT", + "X-OAuth-Scopes": "repo, user, workflow", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4956", + "X-RateLimit-Reset": "1616667526", + "X-RateLimit-Used": "44", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "Vary": "Accept-Encoding, Accept, X-Requested-With", + "X-GitHub-Request-Id": "CD00:609B:198A6E1:1A1E41A:605C59C4" + } + }, + "uuid": "ef20ff92-f593-4ed2-934b-8cb50f2237e3", + "persistent": true, + "insertionIndex": 5 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/mappings/6-r_h_g_actions_runs.json b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/mappings/6-r_h_g_actions_runs.json new file mode 100644 index 0000000000..971bf61b59 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/mappings/6-r_h_g_actions_runs.json @@ -0,0 +1,45 @@ +{ + "id": "e9be2e68-8827-4b57-b511-901040b055fd", + "name": "repos_hub4j-test-org_ghworkflowruntest_actions_runs", + "request": { + "url": "/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs?branch=main&status=in_progress&event=workflow_dispatch&per_page=20", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "6-r_h_g_actions_runs.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 25 Mar 2021 09:37:24 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"9713de6322f49f50d854fcc5c88e6db3f6a72e2a1211d12c8a306f773f5f9f72\"", + "X-OAuth-Scopes": "repo, user, workflow", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4951", + "X-RateLimit-Reset": "1616667526", + "X-RateLimit-Used": "49", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "CD00:609B:198BA67:1A1F811:605C59D4" + } + }, + "uuid": "e9be2e68-8827-4b57-b511-901040b055fd", + "persistent": true, + "insertionIndex": 6 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/mappings/7-r_h_g_actions_runs_686036126_cancel.json b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/mappings/7-r_h_g_actions_runs_686036126_cancel.json new file mode 100644 index 0000000000..711d74ca82 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/mappings/7-r_h_g_actions_runs_686036126_cancel.json @@ -0,0 +1,50 @@ +{ + "id": "b62513a1-6dbb-4a4d-95b6-053e7661385e", + "name": "repos_hub4j-test-org_ghworkflowruntest_actions_runs_686036126_cancel", + "request": { + "url": "/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/686036126/cancel", + "method": "POST", + "headers": { + "Accept": { + "equalTo": "application/vnd.github+json" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 202, + "body": "{}", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 25 Mar 2021 09:37:25 GMT", + "Content-Type": "application/json; charset=utf-8", + "X-OAuth-Scopes": "repo, user, workflow", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4950", + "X-RateLimit-Reset": "1616667526", + "X-RateLimit-Used": "50", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "Vary": "Accept-Encoding, Accept, X-Requested-With", + "X-GitHub-Request-Id": "CD00:609B:198BA93:1A1F838:605C59D4" + } + }, + "uuid": "b62513a1-6dbb-4a4d-95b6-053e7661385e", + "persistent": true, + "scenarioName": "scenario-1-repos-hub4j-test-org-GHWorkflowRunTest-actions-runs-686036126-cancel", + "requiredScenarioState": "Started", + "newScenarioState": "scenario-1-repos-hub4j-test-org-GHWorkflowRunTest-actions-runs-686036126-cancel-2", + "insertionIndex": 7 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/mappings/8-r_h_g_actions_runs_686036126.json b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/mappings/8-r_h_g_actions_runs_686036126.json new file mode 100644 index 0000000000..733d3058a9 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/mappings/8-r_h_g_actions_runs_686036126.json @@ -0,0 +1,45 @@ +{ + "id": "03f4192e-6863-4d68-a8c5-c9ee276b1c2e", + "name": "repos_hub4j-test-org_ghworkflowruntest_actions_runs_686036126", + "request": { + "url": "/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/686036126", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "8-r_h_g_actions_runs_686036126.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 25 Mar 2021 09:37:46 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"19fcfa727b9da4b3a137deee61f79cd3d75ecc6c38b8001b872812184d2bbf44\"", + "X-OAuth-Scopes": "repo, user, workflow", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4944", + "X-RateLimit-Reset": "1616667526", + "X-RateLimit-Used": "56", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "CD00:609B:198D1E3:1A21010:605C59EA" + } + }, + "uuid": "03f4192e-6863-4d68-a8c5-c9ee276b1c2e", + "persistent": true, + "insertionIndex": 8 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/mappings/9-r_h_g_actions_runs_686036126_rerun.json b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/mappings/9-r_h_g_actions_runs_686036126_rerun.json new file mode 100644 index 0000000000..9b90d74b6e --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/mappings/9-r_h_g_actions_runs_686036126_rerun.json @@ -0,0 +1,52 @@ +{ + "id": "c69bdcde-04b7-4850-a1b3-e03b597480e2", + "name": "repos_hub4j-test-org_ghworkflowruntest_actions_runs_686036126_rerun", + "request": { + "url": "/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/686036126/rerun", + "method": "POST", + "headers": { + "Accept": { + "equalTo": "application/vnd.github+json" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 201, + "body": "{}", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 25 Mar 2021 09:37:46 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "\"493830ad9e93c004b4464957d1d912393169741035d7d79e956ee988eeae74c3\"", + "X-OAuth-Scopes": "repo, user, workflow", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4943", + "X-RateLimit-Reset": "1616667526", + "X-RateLimit-Used": "57", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "CD00:609B:198D21A:1A21056:605C59EA" + } + }, + "uuid": "c69bdcde-04b7-4850-a1b3-e03b597480e2", + "persistent": true, + "insertionIndex": 9 +} \ No newline at end of file From 27f34b8612cf2ea18ef5744d84ee35c8898a4e49 Mon Sep 17 00:00:00 2001 From: cyrilico <19289022+cyrilico@users.noreply.github.com> Date: Fri, 5 Sep 2025 16:58:54 +0100 Subject: [PATCH 4/4] modify snapshot --- ...0-r_h_g_actions_runs_686036126_cancel.json | 49 ----------------- ...g_actions_runs_686036126_forceCancel.json} | 8 +-- .../9-r_h_g_actions_runs_686036126_rerun.json | 52 ------------------- 3 files changed, 4 insertions(+), 105 deletions(-) delete mode 100644 src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/mappings/10-r_h_g_actions_runs_686036126_cancel.json rename src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/mappings/{7-r_h_g_actions_runs_686036126_cancel.json => 7-r_h_g_actions_runs_686036126_forceCancel.json} (92%) delete mode 100644 src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/mappings/9-r_h_g_actions_runs_686036126_rerun.json diff --git a/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/mappings/10-r_h_g_actions_runs_686036126_cancel.json b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/mappings/10-r_h_g_actions_runs_686036126_cancel.json deleted file mode 100644 index 8c3a21d50b..0000000000 --- a/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/mappings/10-r_h_g_actions_runs_686036126_cancel.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "id": "1b7916c4-c4be-42e2-8b8a-ed47c299f63c", - "name": "repos_hub4j-test-org_ghworkflowruntest_actions_runs_686036126_cancel", - "request": { - "url": "/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/686036126/cancel", - "method": "POST", - "headers": { - "Accept": { - "equalTo": "application/vnd.github+json" - } - }, - "bodyPatterns": [ - { - "equalToJson": "{}", - "ignoreArrayOrder": true, - "ignoreExtraElements": false - } - ] - }, - "response": { - "status": 202, - "body": "{}", - "headers": { - "Server": "GitHub.com", - "Date": "Thu, 25 Mar 2021 09:37:57 GMT", - "Content-Type": "application/json; charset=utf-8", - "X-OAuth-Scopes": "repo, user, workflow", - "X-Accepted-OAuth-Scopes": "", - "X-GitHub-Media-Type": "unknown, github.v3", - "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4939", - "X-RateLimit-Reset": "1616667526", - "X-RateLimit-Used": "61", - "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", - "X-Frame-Options": "deny", - "X-Content-Type-Options": "nosniff", - "X-XSS-Protection": "0", - "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", - "Content-Security-Policy": "default-src 'none'", - "Vary": "Accept-Encoding, Accept, X-Requested-With", - "X-GitHub-Request-Id": "CD00:609B:198DEF3:1A21D5B:605C59F5" - } - }, - "uuid": "1b7916c4-c4be-42e2-8b8a-ed47c299f63c", - "persistent": true, - "scenarioName": "scenario-1-repos-hub4j-test-org-GHWorkflowRunTest-actions-runs-686036126-cancel", - "requiredScenarioState": "scenario-1-repos-hub4j-test-org-GHWorkflowRunTest-actions-runs-686036126-cancel-2", - "insertionIndex": 10 -} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/mappings/7-r_h_g_actions_runs_686036126_cancel.json b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/mappings/7-r_h_g_actions_runs_686036126_forceCancel.json similarity index 92% rename from src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/mappings/7-r_h_g_actions_runs_686036126_cancel.json rename to src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/mappings/7-r_h_g_actions_runs_686036126_forceCancel.json index 711d74ca82..b350a66d66 100644 --- a/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/mappings/7-r_h_g_actions_runs_686036126_cancel.json +++ b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/mappings/7-r_h_g_actions_runs_686036126_forceCancel.json @@ -1,8 +1,8 @@ { "id": "b62513a1-6dbb-4a4d-95b6-053e7661385e", - "name": "repos_hub4j-test-org_ghworkflowruntest_actions_runs_686036126_cancel", + "name": "repos_hub4j-test-org_ghworkflowruntest_actions_runs_686036126_forceCcancel", "request": { - "url": "/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/686036126/cancel", + "url": "/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/686036126/force-cancel", "method": "POST", "headers": { "Accept": { @@ -43,8 +43,8 @@ }, "uuid": "b62513a1-6dbb-4a4d-95b6-053e7661385e", "persistent": true, - "scenarioName": "scenario-1-repos-hub4j-test-org-GHWorkflowRunTest-actions-runs-686036126-cancel", + "scenarioName": "scenario-1-repos-hub4j-test-org-GHWorkflowRunTest-actions-runs-686036126-forceCcancel", "requiredScenarioState": "Started", - "newScenarioState": "scenario-1-repos-hub4j-test-org-GHWorkflowRunTest-actions-runs-686036126-cancel-2", + "newScenarioState": "scenario-1-repos-hub4j-test-org-GHWorkflowRunTest-actions-runs-686036126-forceCcancel-2", "insertionIndex": 7 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/mappings/9-r_h_g_actions_runs_686036126_rerun.json b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/mappings/9-r_h_g_actions_runs_686036126_rerun.json deleted file mode 100644 index 9b90d74b6e..0000000000 --- a/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testForceCancel/mappings/9-r_h_g_actions_runs_686036126_rerun.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "id": "c69bdcde-04b7-4850-a1b3-e03b597480e2", - "name": "repos_hub4j-test-org_ghworkflowruntest_actions_runs_686036126_rerun", - "request": { - "url": "/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/686036126/rerun", - "method": "POST", - "headers": { - "Accept": { - "equalTo": "application/vnd.github+json" - } - }, - "bodyPatterns": [ - { - "equalToJson": "{}", - "ignoreArrayOrder": true, - "ignoreExtraElements": false - } - ] - }, - "response": { - "status": 201, - "body": "{}", - "headers": { - "Server": "GitHub.com", - "Date": "Thu, 25 Mar 2021 09:37:46 GMT", - "Content-Type": "application/json; charset=utf-8", - "Cache-Control": "private, max-age=60, s-maxage=60", - "Vary": [ - "Accept, Authorization, Cookie, X-GitHub-OTP", - "Accept-Encoding, Accept, X-Requested-With" - ], - "ETag": "\"493830ad9e93c004b4464957d1d912393169741035d7d79e956ee988eeae74c3\"", - "X-OAuth-Scopes": "repo, user, workflow", - "X-Accepted-OAuth-Scopes": "", - "X-GitHub-Media-Type": "unknown, github.v3", - "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4943", - "X-RateLimit-Reset": "1616667526", - "X-RateLimit-Used": "57", - "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", - "X-Frame-Options": "deny", - "X-Content-Type-Options": "nosniff", - "X-XSS-Protection": "0", - "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", - "Content-Security-Policy": "default-src 'none'", - "X-GitHub-Request-Id": "CD00:609B:198D21A:1A21056:605C59EA" - } - }, - "uuid": "c69bdcde-04b7-4850-a1b3-e03b597480e2", - "persistent": true, - "insertionIndex": 9 -} \ No newline at end of file