From 5bdff2ce9f6b1f79cbf8c04dfe72b1df3e2a733f Mon Sep 17 00:00:00 2001 From: Yusuf Erdem Date: Thu, 28 Apr 2022 12:07:43 +0300 Subject: [PATCH 01/15] Add labels property to the GHWorkflowJob.java --- .../java/org/kohsuke/github/GHWorkflowJob.java | 17 ++++++++++++++++- .../org/kohsuke/github/GHWorkflowRunTest.java | 6 ++++++ ...flowruntest_actions_jobs__2270858630-10.json | 5 ++++- ...wruntest_actions_runs_719643947_jobs-11.json | 10 ++++++++-- ...owruntest_actions_runs_719643947_jobs-7.json | 10 ++++++++-- 5 files changed, 42 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/kohsuke/github/GHWorkflowJob.java b/src/main/java/org/kohsuke/github/GHWorkflowJob.java index 9e701d7f32..7bd8059145 100644 --- a/src/main/java/org/kohsuke/github/GHWorkflowJob.java +++ b/src/main/java/org/kohsuke/github/GHWorkflowJob.java @@ -9,7 +9,11 @@ import java.io.IOException; import java.net.URL; -import java.util.*; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Date; +import java.util.List; +import java.util.Objects; import static java.util.Objects.requireNonNull; @@ -41,6 +45,8 @@ public class GHWorkflowJob extends GHObject { private List steps = new ArrayList<>(); + private List labels = new ArrayList<>(); + /** * The name of the job. * @@ -131,6 +137,15 @@ public List getSteps() { return Collections.unmodifiableList(steps); } + /** + * Gets the labels of the job. + * + * @return the labels + */ + public List getLabels() { + return Collections.unmodifiableList(labels); + } + /** * Repository to which the job belongs. * diff --git a/src/test/java/org/kohsuke/github/GHWorkflowRunTest.java b/src/test/java/org/kohsuke/github/GHWorkflowRunTest.java index d7b5442716..1e6422c558 100644 --- a/src/test/java/org/kohsuke/github/GHWorkflowRunTest.java +++ b/src/test/java/org/kohsuke/github/GHWorkflowRunTest.java @@ -39,6 +39,7 @@ public class GHWorkflowRunTest extends AbstractGitHubWireMockTest { private static final String MULTI_JOBS_WORKFLOW_PATH = "multi-jobs-workflow.yml"; private static final String MULTI_JOBS_WORKFLOW_NAME = "Multi jobs workflow"; private static final String RUN_A_ONE_LINE_SCRIPT_STEP_NAME = "Run a one-line script"; + private static final String UBUNTU_LABEL = "ubuntu-latest"; private GHRepository repo; @@ -487,6 +488,11 @@ private static void checkJobProperties(long workflowRunId, GHWorkflowJob job, St fail("Unable to find " + RUN_A_ONE_LINE_SCRIPT_STEP_NAME + " step"); } + Optional labelOptional = job.getLabels().stream().filter(s -> s.equals(UBUNTU_LABEL)).findFirst(); + if (!labelOptional.isPresent()) { + fail("Unable to find " + UBUNTU_LABEL + " label"); + } + checkStepProperties(step.get(), RUN_A_ONE_LINE_SCRIPT_STEP_NAME, 2); } diff --git a/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testJobs/__files/repos_hub4j-test-org_ghworkflowruntest_actions_jobs__2270858630-10.json b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testJobs/__files/repos_hub4j-test-org_ghworkflowruntest_actions_jobs__2270858630-10.json index 915a5db94b..fec9df9de2 100644 --- a/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testJobs/__files/repos_hub4j-test-org_ghworkflowruntest_actions_jobs__2270858630-10.json +++ b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testJobs/__files/repos_hub4j-test-org_ghworkflowruntest_actions_jobs__2270858630-10.json @@ -37,5 +37,8 @@ "completed_at": "2021-04-05T17:42:59.000+02:00" } ], - "check_run_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/check-runs/2270858630" + "check_run_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/check-runs/2270858630", + "labels": [ + "ubuntu-latest" + ] } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testJobs/__files/repos_hub4j-test-org_ghworkflowruntest_actions_runs_719643947_jobs-11.json b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testJobs/__files/repos_hub4j-test-org_ghworkflowruntest_actions_runs_719643947_jobs-11.json index 9c46949c90..6de394a0ed 100644 --- a/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testJobs/__files/repos_hub4j-test-org_ghworkflowruntest_actions_runs_719643947_jobs-11.json +++ b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testJobs/__files/repos_hub4j-test-org_ghworkflowruntest_actions_runs_719643947_jobs-11.json @@ -40,7 +40,10 @@ "completed_at": "2021-04-05T17:42:57.000+02:00" } ], - "check_run_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/check-runs/2270858576" + "check_run_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/check-runs/2270858576", + "labels": [ + "ubuntu-latest" + ] }, { "id": 2270858630, @@ -81,7 +84,10 @@ "completed_at": "2021-04-05T17:42:59.000+02:00" } ], - "check_run_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/check-runs/2270858630" + "check_run_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/check-runs/2270858630", + "labels": [ + "ubuntu-latest" + ] } ] } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testJobs/__files/repos_hub4j-test-org_ghworkflowruntest_actions_runs_719643947_jobs-7.json b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testJobs/__files/repos_hub4j-test-org_ghworkflowruntest_actions_runs_719643947_jobs-7.json index 9c46949c90..6de394a0ed 100644 --- a/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testJobs/__files/repos_hub4j-test-org_ghworkflowruntest_actions_runs_719643947_jobs-7.json +++ b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testJobs/__files/repos_hub4j-test-org_ghworkflowruntest_actions_runs_719643947_jobs-7.json @@ -40,7 +40,10 @@ "completed_at": "2021-04-05T17:42:57.000+02:00" } ], - "check_run_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/check-runs/2270858576" + "check_run_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/check-runs/2270858576", + "labels": [ + "ubuntu-latest" + ] }, { "id": 2270858630, @@ -81,7 +84,10 @@ "completed_at": "2021-04-05T17:42:59.000+02:00" } ], - "check_run_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/check-runs/2270858630" + "check_run_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/check-runs/2270858630", + "labels": [ + "ubuntu-latest" + ] } ] } \ No newline at end of file From aa447e5c62db842f2d8a9c6dde593d9eea86c7f7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 1 May 2022 02:00:24 +0000 Subject: [PATCH 02/15] Chore(deps): Bump codecov/codecov-action from 3.0.0 to 3.1.0 Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 3.0.0 to 3.1.0. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/master/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/v3.0.0...v3.1.0) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/maven-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/maven-build.yml b/.github/workflows/maven-build.yml index f2306ca6df..38ae3e2c7a 100644 --- a/.github/workflows/maven-build.yml +++ b/.github/workflows/maven-build.yml @@ -74,7 +74,7 @@ jobs: - name: Maven Install with Code Coverage run: mvn -B clean install -D enable-ci -Djapicmp.skip --file pom.xml - name: Codecov Report - uses: codecov/codecov-action@v3.0.0 + uses: codecov/codecov-action@v3.1.0 test: name: test (${{ matrix.os }}, Java ${{ matrix.java }}) runs-on: ${{ matrix.os }}-latest From 0239aa5c4e4d5fa8fc5bc983d6f2263c103016db Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 1 May 2022 02:00:27 +0000 Subject: [PATCH 03/15] Chore(deps): Bump github/codeql-action from 1 to 2 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 1 to 2. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/v1...v2) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql-analysis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 31f4fd47c0..038bc93fad 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -46,7 +46,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v1 + uses: github/codeql-action/init@v2 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -57,7 +57,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@v1 + uses: github/codeql-action/autobuild@v2 # ℹī¸ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -71,4 +71,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + uses: github/codeql-action/analyze@v2 From 352e69e6fc2d6c82f5c099091d079e05485b9f36 Mon Sep 17 00:00:00 2001 From: Yusuf Erdem Date: Mon, 30 May 2022 21:48:05 +0300 Subject: [PATCH 04/15] Add missing properties to the GHWorkflowJob.java --- .../org/kohsuke/github/GHWorkflowJob.java | 41 +++++++++++++++++++ .../org/kohsuke/github/GHWorkflowRunTest.java | 4 ++ ...owruntest_actions_jobs__2270858630-10.json | 6 ++- ...untest_actions_runs_719643947_jobs-11.json | 12 +++++- ...runtest_actions_runs_719643947_jobs-7.json | 12 +++++- 5 files changed, 70 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/kohsuke/github/GHWorkflowJob.java b/src/main/java/org/kohsuke/github/GHWorkflowJob.java index 7bd8059145..462eeec396 100644 --- a/src/main/java/org/kohsuke/github/GHWorkflowJob.java +++ b/src/main/java/org/kohsuke/github/GHWorkflowJob.java @@ -43,6 +43,11 @@ public class GHWorkflowJob extends GHObject { private String htmlUrl; private String checkRunUrl; + private int runnerId; + private String runnerName; + private int runnerGroupId; + private String runnerGroupName; + private List steps = new ArrayList<>(); private List labels = new ArrayList<>(); @@ -146,6 +151,42 @@ public List getLabels() { return Collections.unmodifiableList(labels); } + /** + * the runner id. + * + * @return runnerId + */ + public int getRunnerId() { + return runnerId; + } + + /** + * the runner name. + * + * @return runnerName + */ + public String getRunnerName() { + return runnerName; + } + + /** + * the runner group id. + * + * @return runnerGroupId + */ + public int getRunnerGroupId() { + return runnerGroupId; + } + + /** + * the runner group name. + * + * @return runnerGroupName + */ + public String getRunnerGroupName() { + return runnerGroupName; + } + /** * Repository to which the job belongs. * diff --git a/src/test/java/org/kohsuke/github/GHWorkflowRunTest.java b/src/test/java/org/kohsuke/github/GHWorkflowRunTest.java index 1e6422c558..402635c548 100644 --- a/src/test/java/org/kohsuke/github/GHWorkflowRunTest.java +++ b/src/test/java/org/kohsuke/github/GHWorkflowRunTest.java @@ -478,6 +478,10 @@ private static void checkJobProperties(long workflowRunId, GHWorkflowJob job, St assertThat(job.getUrl().getPath(), containsString("/actions/jobs/")); assertThat(job.getHtmlUrl().getPath(), containsString("/runs/" + job.getId())); assertThat(job.getCheckRunUrl().getPath(), containsString("/check-runs/")); + assertThat(job.getRunnerId(), is(1)); + assertThat(job.getRunnerName(), containsString("my runner")); + assertThat(job.getRunnerGroupId(), is(2)); + assertThat(job.getRunnerGroupName(), containsString("my runner group")); // we only test the step we have control over, the others are added by GitHub Optional step = job.getSteps() diff --git a/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testJobs/__files/repos_hub4j-test-org_ghworkflowruntest_actions_jobs__2270858630-10.json b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testJobs/__files/repos_hub4j-test-org_ghworkflowruntest_actions_jobs__2270858630-10.json index fec9df9de2..6e131628ee 100644 --- a/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testJobs/__files/repos_hub4j-test-org_ghworkflowruntest_actions_jobs__2270858630-10.json +++ b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testJobs/__files/repos_hub4j-test-org_ghworkflowruntest_actions_jobs__2270858630-10.json @@ -40,5 +40,9 @@ "check_run_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/check-runs/2270858630", "labels": [ "ubuntu-latest" - ] + ], + "runner_id": 1, + "runner_name": "my runner", + "runner_group_id": 2, + "runner_group_name": "my runner group" } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testJobs/__files/repos_hub4j-test-org_ghworkflowruntest_actions_runs_719643947_jobs-11.json b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testJobs/__files/repos_hub4j-test-org_ghworkflowruntest_actions_runs_719643947_jobs-11.json index 6de394a0ed..d0c286aa1c 100644 --- a/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testJobs/__files/repos_hub4j-test-org_ghworkflowruntest_actions_runs_719643947_jobs-11.json +++ b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testJobs/__files/repos_hub4j-test-org_ghworkflowruntest_actions_runs_719643947_jobs-11.json @@ -43,7 +43,11 @@ "check_run_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/check-runs/2270858576", "labels": [ "ubuntu-latest" - ] + ], + "runner_id": 1, + "runner_name": "my runner", + "runner_group_id": 2, + "runner_group_name": "my runner group" }, { "id": 2270858630, @@ -87,7 +91,11 @@ "check_run_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/check-runs/2270858630", "labels": [ "ubuntu-latest" - ] + ], + "runner_id": 1, + "runner_name": "my runner", + "runner_group_id": 2, + "runner_group_name": "my runner group" } ] } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testJobs/__files/repos_hub4j-test-org_ghworkflowruntest_actions_runs_719643947_jobs-7.json b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testJobs/__files/repos_hub4j-test-org_ghworkflowruntest_actions_runs_719643947_jobs-7.json index 6de394a0ed..d0c286aa1c 100644 --- a/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testJobs/__files/repos_hub4j-test-org_ghworkflowruntest_actions_runs_719643947_jobs-7.json +++ b/src/test/resources/org/kohsuke/github/GHWorkflowRunTest/wiremock/testJobs/__files/repos_hub4j-test-org_ghworkflowruntest_actions_runs_719643947_jobs-7.json @@ -43,7 +43,11 @@ "check_run_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/check-runs/2270858576", "labels": [ "ubuntu-latest" - ] + ], + "runner_id": 1, + "runner_name": "my runner", + "runner_group_id": 2, + "runner_group_name": "my runner group" }, { "id": 2270858630, @@ -87,7 +91,11 @@ "check_run_url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/check-runs/2270858630", "labels": [ "ubuntu-latest" - ] + ], + "runner_id": 1, + "runner_name": "my runner", + "runner_group_id": 2, + "runner_group_name": "my runner group" } ] } \ No newline at end of file From 7218664d009181407caf3dab60c48001721fadf9 Mon Sep 17 00:00:00 2001 From: Guillaume Smet Date: Tue, 31 May 2022 19:26:37 +0200 Subject: [PATCH 05/15] Add star event payload --- .../org/kohsuke/github/GHEventPayload.java | 21 +++ .../kohsuke/github/GHEventPayloadTest.java | 11 ++ .../github/GHEventPayloadTest/starred.json | 126 ++++++++++++++++++ 3 files changed, 158 insertions(+) create mode 100644 src/test/resources/org/kohsuke/github/GHEventPayloadTest/starred.json diff --git a/src/main/java/org/kohsuke/github/GHEventPayload.java b/src/main/java/org/kohsuke/github/GHEventPayload.java index 899717017c..0f1728e107 100644 --- a/src/main/java/org/kohsuke/github/GHEventPayload.java +++ b/src/main/java/org/kohsuke/github/GHEventPayload.java @@ -1572,4 +1572,25 @@ public GHLabel getLabel() { return label; } } + + /** + * A star was created or deleted on a repository. + * + * @see star + * event + */ + public static class Star extends GHEventPayload { + + private String starredAt; + + /** + * Gets the date when the star is added. Is null when the star is deleted. + * + * @return the date when the star is added + */ + public Date getStarredAt() { + return GitHubClient.parseDate(starredAt); + } + } } diff --git a/src/test/java/org/kohsuke/github/GHEventPayloadTest.java b/src/test/java/org/kohsuke/github/GHEventPayloadTest.java index 63524db98a..93616b0084 100644 --- a/src/test/java/org/kohsuke/github/GHEventPayloadTest.java +++ b/src/test/java/org/kohsuke/github/GHEventPayloadTest.java @@ -1097,4 +1097,15 @@ public void discussion_labeled() throws Exception { assertThat(label.isDefault(), is(false)); assertThat(label.getDescription(), is(nullValue())); } + + @Test + public void starred() throws Exception { + final GHEventPayload.Star starPayload = GitHub.offline() + .parseEventPayload(payload.asReader(), GHEventPayload.Star.class); + + assertThat(starPayload.getAction(), is("created")); + assertThat(starPayload.getRepository().getFullName(), is("gsmet/quarkus-bot-java-playground")); + assertThat(starPayload.getSender().getLogin(), is("gsmet")); + assertThat(starPayload.getStarredAt().getTime(), is(1654017876000L)); + } } diff --git a/src/test/resources/org/kohsuke/github/GHEventPayloadTest/starred.json b/src/test/resources/org/kohsuke/github/GHEventPayloadTest/starred.json new file mode 100644 index 0000000000..14da1ff3cf --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHEventPayloadTest/starred.json @@ -0,0 +1,126 @@ +{ + "action": "created", + "starred_at": "2022-05-31T17:24:36Z", + "repository": { + "id": 313384129, + "node_id": "MDEwOlJlcG9zaXRvcnkzMTMzODQxMjk=", + "name": "quarkus-bot-java-playground", + "full_name": "gsmet/quarkus-bot-java-playground", + "private": false, + "owner": { + "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 + }, + "html_url": "https://github.com/gsmet/quarkus-bot-java-playground", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground", + "forks_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/forks", + "keys_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/teams", + "hooks_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/hooks", + "issue_events_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/issues/events{/number}", + "events_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/events", + "assignees_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/assignees{/user}", + "branches_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/branches{/branch}", + "tags_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/tags", + "blobs_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/statuses/{sha}", + "languages_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/languages", + "stargazers_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/stargazers", + "contributors_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/contributors", + "subscribers_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/subscribers", + "subscription_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/subscription", + "commits_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/contents/{+path}", + "compare_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/merges", + "archive_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/downloads", + "issues_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/issues{/number}", + "pulls_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/pulls{/number}", + "milestones_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/milestones{/number}", + "notifications_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/labels{/name}", + "releases_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/releases{/id}", + "deployments_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/deployments", + "created_at": "2020-11-16T17:55:53Z", + "updated_at": "2022-05-31T17:24:36Z", + "pushed_at": "2022-05-30T10:55:11Z", + "git_url": "git://github.com/gsmet/quarkus-bot-java-playground.git", + "ssh_url": "git@github.com:gsmet/quarkus-bot-java-playground.git", + "clone_url": "https://github.com/gsmet/quarkus-bot-java-playground.git", + "svn_url": "https://github.com/gsmet/quarkus-bot-java-playground", + "homepage": null, + "size": 89, + "stargazers_count": 1, + "watchers_count": 1, + "language": "Java", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "forks_count": 2, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 36, + "license": null, + "allow_forking": true, + "is_template": false, + "topics": [], + "visibility": "public", + "forks": 2, + "open_issues": 36, + "watchers": 1, + "default_branch": "main" + }, + "sender": { + "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 + }, + "installation": { + "id": 13005535, + "node_id": "MDIzOkludGVncmF0aW9uSW5zdGFsbGF0aW9uMTMwMDU1MzU=" + } +} \ No newline at end of file From 083d2e8b6c6c28b4d773d76708293dd8765f4ea7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Jun 2022 02:01:14 +0000 Subject: [PATCH 06/15] Chore(deps): Bump spotless-maven-plugin from 2.22.1 to 2.22.5 Bumps [spotless-maven-plugin](https://github.com/diffplug/spotless) from 2.22.1 to 2.22.5. - [Release notes](https://github.com/diffplug/spotless/releases) - [Changelog](https://github.com/diffplug/spotless/blob/main/CHANGES.md) - [Commits](https://github.com/diffplug/spotless/compare/lib/2.22.1...maven/2.22.5) --- updated-dependencies: - dependency-name: com.diffplug.spotless:spotless-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5491b7dcd3..1f5cbde013 100644 --- a/pom.xml +++ b/pom.xml @@ -333,7 +333,7 @@ com.diffplug.spotless spotless-maven-plugin - 2.22.1 + 2.22.5 spotless-check From e7add93d02cd2e50ae355073c1bf0264e466cd22 Mon Sep 17 00:00:00 2001 From: Guillaume Smet Date: Mon, 30 May 2022 13:18:08 +0200 Subject: [PATCH 07/15] Add support for workflow_job event payload Fixes #1331 --- .../org/kohsuke/github/GHEventPayload.java | 37 ++++ .../org/kohsuke/github/GHWorkflowJob.java | 10 + .../kohsuke/github/GHEventPayloadTest.java | 48 ++++- .../GHEventPayloadTest/workflow_job.json | 190 ++++++++++++++++++ 4 files changed, 283 insertions(+), 2 deletions(-) create mode 100644 src/test/resources/org/kohsuke/github/GHEventPayloadTest/workflow_job.json diff --git a/src/main/java/org/kohsuke/github/GHEventPayload.java b/src/main/java/org/kohsuke/github/GHEventPayload.java index 0f1728e107..e7af6e93d1 100644 --- a/src/main/java/org/kohsuke/github/GHEventPayload.java +++ b/src/main/java/org/kohsuke/github/GHEventPayload.java @@ -1506,6 +1506,43 @@ void lateBind() { } } + /** + * A workflow job has been queued, is in progress, or has been completed. + * + * @see + * workflow job event + * @see Actions Workflow Jobs + */ + public static class WorkflowJob extends GHEventPayload { + + private GHWorkflowJob workflowJob; + + /** + * Gets the workflow job. + * + * @return the workflow job + */ + @SuppressFBWarnings(value = { "EI_EXPOSE_REP" }, justification = "Expected") + public GHWorkflowJob getWorkflowJob() { + return workflowJob; + } + + @Override + void lateBind() { + if (workflowJob == null) { + throw new IllegalStateException( + "Expected workflow_job payload, but got something else. Maybe we've got another type of event?"); + } + super.lateBind(); + GHRepository repository = getRepository(); + if (repository == null) { + throw new IllegalStateException("Repository must not be null"); + } + workflowJob.wrapUp(repository); + } + } + /** * A label was created, edited or deleted. * diff --git a/src/main/java/org/kohsuke/github/GHWorkflowJob.java b/src/main/java/org/kohsuke/github/GHWorkflowJob.java index 9e701d7f32..767075550c 100644 --- a/src/main/java/org/kohsuke/github/GHWorkflowJob.java +++ b/src/main/java/org/kohsuke/github/GHWorkflowJob.java @@ -35,6 +35,7 @@ public class GHWorkflowJob extends GHObject { private String conclusion; private long runId; + private int runAttempt; private String htmlUrl; private String checkRunUrl; @@ -108,6 +109,15 @@ public long getRunId() { return runId; } + /** + * Attempt number of the associated workflow run, 1 for first attempt and higher if the workflow was re-run. + * + * @return attempt number + */ + public int getRunAttempt() { + return runAttempt; + } + @Override public URL getHtmlUrl() { return GitHubClient.parseURL(htmlUrl); diff --git a/src/test/java/org/kohsuke/github/GHEventPayloadTest.java b/src/test/java/org/kohsuke/github/GHEventPayloadTest.java index 93616b0084..0c07d1efe9 100644 --- a/src/test/java/org/kohsuke/github/GHEventPayloadTest.java +++ b/src/test/java/org/kohsuke/github/GHEventPayloadTest.java @@ -11,7 +11,18 @@ import java.util.List; import java.util.TimeZone; -import static org.hamcrest.Matchers.*; +import static org.hamcrest.Matchers.aMapWithSize; +import static org.hamcrest.Matchers.contains; +import static org.hamcrest.Matchers.endsWith; +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.hasProperty; +import static org.hamcrest.Matchers.hasToString; +import static org.hamcrest.Matchers.is; +import static org.hamcrest.Matchers.lessThanOrEqualTo; +import static org.hamcrest.Matchers.notNullValue; +import static org.hamcrest.Matchers.nullValue; +import static org.hamcrest.Matchers.sameInstance; +import static org.hamcrest.Matchers.startsWith; import static org.junit.Assert.assertThrows; public class GHEventPayloadTest extends AbstractGitHubWireMockTest { @@ -876,7 +887,6 @@ public void workflow_run_pull_request() throws Exception { GHPullRequest pullRequest = pullRequests.get(0); assertThat(pullRequest.getId(), is(599098265L)); assertThat(pullRequest.getRepository(), sameInstance(workflowRunPayload.getRepository())); - } @Test @@ -892,6 +902,40 @@ public void workflow_run_other_repository() throws Exception { assertThat(workflowRunPayload.getWorkflow().getRepository(), sameInstance(workflowRunPayload.getRepository())); } + @Test + public void workflow_job() throws Exception { + final GHEventPayload.WorkflowJob workflowJobPayload = GitHub.offline() + .parseEventPayload(payload.asReader(), GHEventPayload.WorkflowJob.class); + + assertThat(workflowJobPayload.getAction(), is("completed")); + assertThat(workflowJobPayload.getRepository().getFullName(), is("gsmet/quarkus-bot-java-playground")); + assertThat(workflowJobPayload.getSender().getLogin(), is("gsmet")); + + GHWorkflowJob workflowJob = workflowJobPayload.getWorkflowJob(); + assertThat(workflowJob.getId(), is(6653410527L)); + assertThat(workflowJob.getRunId(), is(2408553341L)); + assertThat(workflowJob.getRunAttempt(), is(1)); + assertThat(workflowJob.getUrl().toString(), + is("https://api.github.com/repos/gsmet/quarkus-bot-java-playground/actions/jobs/6653410527")); + assertThat(workflowJob.getHtmlUrl().toString(), + is("https://github.com/gsmet/quarkus-bot-java-playground/runs/6653410527?check_suite_focus=true")); + assertThat(workflowJob.getNodeId(), is("CR_kwDOEq3cwc8AAAABjJL83w")); + assertThat(workflowJob.getHeadSha(), is("5dd2dadfbdc2a722c08a8ad42ae4e26e3e731042")); + assertThat(workflowJob.getStatus(), is(GHWorkflowRun.Status.COMPLETED)); + assertThat(workflowJob.getConclusion(), is(GHWorkflowRun.Conclusion.FAILURE)); + assertThat(workflowJob.getStartedAt().getTime(), is(1653908125000L)); + assertThat(workflowJob.getCompletedAt().getTime(), is(1653908157000L)); + assertThat(workflowJob.getName(), is("JVM Tests - JDK JDK16")); + assertThat(workflowJob.getSteps(), + contains(hasProperty("name", is("Set up job")), + hasProperty("name", is("Run actions/checkout@v2")), + hasProperty("name", is("Build with Maven")), + hasProperty("name", is("Post Run actions/checkout@v2")), + hasProperty("name", is("Complete job")))); + assertThat(workflowJob.getCheckRunUrl().toString(), + is("https://api.github.com/repos/gsmet/quarkus-bot-java-playground/check-runs/6653410527")); + } + @Test public void label_created() throws Exception { final GHEventPayload.Label labelPayload = GitHub.offline() diff --git a/src/test/resources/org/kohsuke/github/GHEventPayloadTest/workflow_job.json b/src/test/resources/org/kohsuke/github/GHEventPayloadTest/workflow_job.json new file mode 100644 index 0000000000..b511765106 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHEventPayloadTest/workflow_job.json @@ -0,0 +1,190 @@ +{ + "action": "completed", + "workflow_job": { + "id": 6653410527, + "run_id": 2408553341, + "run_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/actions/runs/2408553341", + "run_attempt": 1, + "node_id": "CR_kwDOEq3cwc8AAAABjJL83w", + "head_sha": "5dd2dadfbdc2a722c08a8ad42ae4e26e3e731042", + "url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/actions/jobs/6653410527", + "html_url": "https://github.com/gsmet/quarkus-bot-java-playground/runs/6653410527?check_suite_focus=true", + "status": "completed", + "conclusion": "failure", + "started_at": "2022-05-30T10:55:25Z", + "completed_at": "2022-05-30T10:55:57Z", + "name": "JVM Tests - JDK JDK16", + "steps": [ + { + "name": "Set up job", + "status": "completed", + "conclusion": "success", + "number": 1, + "started_at": "2022-05-30T10:55:25.000Z", + "completed_at": "2022-05-30T10:55:27.000Z" + }, + { + "name": "Run actions/checkout@v2", + "status": "completed", + "conclusion": "success", + "number": 2, + "started_at": "2022-05-30T10:55:27.000Z", + "completed_at": "2022-05-30T10:55:27.000Z" + }, + { + "name": "Build with Maven", + "status": "completed", + "conclusion": "failure", + "number": 4, + "started_at": "2022-05-30T10:55:35.000Z", + "completed_at": "2022-05-30T10:55:55.000Z" + }, + { + "name": "Post Run actions/checkout@v2", + "status": "completed", + "conclusion": "success", + "number": 10, + "started_at": "2022-05-30T10:55:55.000Z", + "completed_at": "2022-05-30T10:55:56.000Z" + }, + { + "name": "Complete job", + "status": "completed", + "conclusion": "success", + "number": 11, + "started_at": "2022-05-30T10:55:56.000Z", + "completed_at": "2022-05-30T10:55:56.000Z" + } + ], + "check_run_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/check-runs/6653410527", + "labels": [ + "ubuntu-latest" + ], + "runner_id": 10, + "runner_name": "GitHub Actions 10", + "runner_group_id": 2, + "runner_group_name": "GitHub Actions" + }, + "repository": { + "id": 313384129, + "node_id": "MDEwOlJlcG9zaXRvcnkzMTMzODQxMjk=", + "name": "quarkus-bot-java-playground", + "full_name": "gsmet/quarkus-bot-java-playground", + "private": false, + "owner": { + "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 + }, + "html_url": "https://github.com/gsmet/quarkus-bot-java-playground", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground", + "forks_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/forks", + "keys_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/teams", + "hooks_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/hooks", + "issue_events_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/issues/events{/number}", + "events_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/events", + "assignees_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/assignees{/user}", + "branches_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/branches{/branch}", + "tags_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/tags", + "blobs_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/statuses/{sha}", + "languages_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/languages", + "stargazers_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/stargazers", + "contributors_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/contributors", + "subscribers_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/subscribers", + "subscription_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/subscription", + "commits_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/contents/{+path}", + "compare_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/merges", + "archive_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/downloads", + "issues_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/issues{/number}", + "pulls_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/pulls{/number}", + "milestones_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/milestones{/number}", + "notifications_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/labels{/name}", + "releases_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/releases{/id}", + "deployments_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/deployments", + "created_at": "2020-11-16T17:55:53Z", + "updated_at": "2021-12-22T17:20:52Z", + "pushed_at": "2022-05-30T10:55:11Z", + "git_url": "git://github.com/gsmet/quarkus-bot-java-playground.git", + "ssh_url": "git@github.com:gsmet/quarkus-bot-java-playground.git", + "clone_url": "https://github.com/gsmet/quarkus-bot-java-playground.git", + "svn_url": "https://github.com/gsmet/quarkus-bot-java-playground", + "homepage": null, + "size": 88, + "stargazers_count": 0, + "watchers_count": 0, + "language": "Java", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "forks_count": 2, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 36, + "license": null, + "allow_forking": true, + "is_template": false, + "topics": [], + "visibility": "public", + "forks": 2, + "open_issues": 36, + "watchers": 0, + "default_branch": "main" + }, + "sender": { + "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 + }, + "installation": { + "id": 13005535, + "node_id": "MDIzOkludGVncmF0aW9uSW5zdGFsbGF0aW9uMTMwMDU1MzU=" + } +} \ No newline at end of file From 54fb167b4db2f1e9a57cf12201971e948d757ac2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Kj=C3=A4ll?= Date: Wed, 15 Jun 2022 12:01:48 +0200 Subject: [PATCH 08/15] Expose the boolean 'disabled' in the repository api --- .../java/org/kohsuke/github/GHRepository.java | 11 +- .../org/kohsuke/github/GHRepositoryTest.java | 14 + .../__files/orgs_hub4j-test-org-2.json | 42 +++ .../repos_hub4j-test-org_github-api-3.json | 330 ++++++++++++++++++ .../mappings/orgs_hub4j-test-org-2.json | 48 +++ .../repos_hub4j-test-org_github-api-3.json | 51 +++ .../__files/orgs_hub4j-test-org-2.json | 42 +++ .../repos_hub4j-test-org_github-api-3.json | 330 ++++++++++++++++++ .../mappings/orgs_hub4j-test-org-2.json | 48 +++ .../repos_hub4j-test-org_github-api-3.json | 51 +++ 10 files changed, 966 insertions(+), 1 deletion(-) create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/isDisabled/__files/orgs_hub4j-test-org-2.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/isDisabled/__files/repos_hub4j-test-org_github-api-3.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/isDisabled/mappings/orgs_hub4j-test-org-2.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/isDisabled/mappings/repos_hub4j-test-org_github-api-3.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/isDisabledTrue/__files/orgs_hub4j-test-org-2.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/isDisabledTrue/__files/repos_hub4j-test-org_github-api-3.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/isDisabledTrue/mappings/orgs_hub4j-test-org-2.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/isDisabledTrue/mappings/repos_hub4j-test-org_github-api-3.json diff --git a/src/main/java/org/kohsuke/github/GHRepository.java b/src/main/java/org/kohsuke/github/GHRepository.java index 5e8f192df0..2d934c8d08 100644 --- a/src/main/java/org/kohsuke/github/GHRepository.java +++ b/src/main/java/org/kohsuke/github/GHRepository.java @@ -94,7 +94,7 @@ public class GHRepository extends GHObject { private GHUser owner; // not fully populated. beware. - private boolean has_issues, has_wiki, fork, has_downloads, has_pages, archived, has_projects; + private boolean has_issues, has_wiki, fork, has_downloads, has_pages, archived, disabled, has_projects; private boolean allow_squash_merge; @@ -660,6 +660,15 @@ public boolean isArchived() { return archived; } + /** + * Is disabled boolean. + * + * @return the boolean + */ + public boolean isDisabled() { + return disabled; + } + /** * Is allow squash merge boolean. * diff --git a/src/test/java/org/kohsuke/github/GHRepositoryTest.java b/src/test/java/org/kohsuke/github/GHRepositoryTest.java index 2a1d69b718..8b52a60d81 100644 --- a/src/test/java/org/kohsuke/github/GHRepositoryTest.java +++ b/src/test/java/org/kohsuke/github/GHRepositoryTest.java @@ -93,6 +93,20 @@ public void archive() throws Exception { assertThat(getRepository().isArchived(), is(true)); } + @Test + public void isDisabled() throws Exception { + GHRepository r = getRepository(); + + assertThat(r.isDisabled(), is(false)); + } + + @Test + public void isDisabledTrue() throws Exception { + GHRepository r = getRepository(); + + assertThat(r.isDisabled(), is(true)); + } + @Test public void getBranch_URLEncoded() throws Exception { GHRepository repo = getRepository(); diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/isDisabled/__files/orgs_hub4j-test-org-2.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/isDisabled/__files/orgs_hub4j-test-org-2.json new file mode 100644 index 0000000000..f176fc4ff5 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/isDisabled/__files/orgs_hub4j-test-org-2.json @@ -0,0 +1,42 @@ +{ + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "url": "https://api.github.com/orgs/hub4j-test-org", + "repos_url": "https://api.github.com/orgs/hub4j-test-org/repos", + "events_url": "https://api.github.com/orgs/hub4j-test-org/events", + "hooks_url": "https://api.github.com/orgs/hub4j-test-org/hooks", + "issues_url": "https://api.github.com/orgs/hub4j-test-org/issues", + "members_url": "https://api.github.com/orgs/hub4j-test-org/members{/member}", + "public_members_url": "https://api.github.com/orgs/hub4j-test-org/public_members{/member}", + "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "description": null, + "is_verified": false, + "has_organization_projects": true, + "has_repository_projects": true, + "public_repos": 9, + "public_gists": 0, + "followers": 0, + "following": 0, + "html_url": "https://github.com/hub4j-test-org", + "created_at": "2014-05-10T19:39:11Z", + "updated_at": "2015-04-20T00:42:30Z", + "type": "Organization", + "total_private_repos": 0, + "owned_private_repos": 0, + "private_gists": 0, + "disk_usage": 132, + "collaborators": 0, + "billing_email": "kk@kohsuke.org", + "default_repository_permission": "none", + "members_can_create_repositories": false, + "two_factor_requirement_enabled": false, + "members_allowed_repository_creation_type": "none", + "plan": { + "name": "free", + "space": 976562499, + "private_repos": 0, + "filled_seats": 3, + "seats": 0 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/isDisabled/__files/repos_hub4j-test-org_github-api-3.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/isDisabled/__files/repos_hub4j-test-org_github-api-3.json new file mode 100644 index 0000000000..d34f6ef7a1 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/isDisabled/__files/repos_hub4j-test-org_github-api-3.json @@ -0,0 +1,330 @@ +{ + "id": 206888201, + "node_id": "MDEwOlJlcG9zaXRvcnkyMDY4ODgyMDE=", + "name": "github-api", + "full_name": "hub4j-test-org/github-api", + "private": false, + "owner": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://avatars3.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/github-api", + "description": "Tricky", + "fork": true, + "url": "https://api.github.com/repos/hub4j-test-org/github-api", + "forks_url": "https://api.github.com/repos/hub4j-test-org/github-api/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/github-api/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/github-api/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/github-api/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/github-api/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/github-api/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/github-api/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/github-api/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/github-api/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/github-api/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/github-api/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/github-api/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/github-api/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/github-api/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/github-api/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/github-api/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/github-api/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/github-api/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/github-api/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/github-api/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/github-api/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/github-api/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/github-api/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/github-api/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/github-api/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/github-api/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/github-api/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/github-api/deployments", + "created_at": "2019-09-06T23:26:04Z", + "updated_at": "2019-09-25T23:32:35Z", + "pushed_at": "2019-09-21T14:29:14Z", + "git_url": "git://github.com/hub4j-test-org/github-api.git", + "ssh_url": "git@github.com:hub4j-test-org/github-api.git", + "clone_url": "https://github.com/hub4j-test-org/github-api.git", + "svn_url": "https://github.com/hub4j-test-org/github-api", + "homepage": "http://github-api.kohsuke.org/", + "size": 11387, + "stargazers_count": 0, + "watchers_count": 0, + "language": "Java", + "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": 0, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "main", + "permissions": { + "admin": true, + "push": true, + "pull": true + }, + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "organization": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://avatars3.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 + }, + "parent": { + "id": 617210, + "node_id": "MDEwOlJlcG9zaXRvcnk2MTcyMTA=", + "name": "github-api", + "full_name": "hub4j/github-api", + "private": false, + "owner": { + "login": "hub4j", + "id": 54909825, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU0OTA5ODI1", + "avatar_url": "https://avatars3.githubusercontent.com/u/54909825?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/hub4j", + "html_url": "https://github.com/hub4j", + "followers_url": "https://api.github.com/users/hub4j/followers", + "following_url": "https://api.github.com/users/hub4j/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j/orgs", + "repos_url": "https://api.github.com/users/hub4j/repos", + "events_url": "https://api.github.com/users/hub4j/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/hub4j/github-api", + "description": "Java API for GitHub", + "fork": false, + "url": "https://api.github.com/repos/hub4j/github-api", + "forks_url": "https://api.github.com/repos/hub4j/github-api/forks", + "keys_url": "https://api.github.com/repos/hub4j/github-api/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j/github-api/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j/github-api/teams", + "hooks_url": "https://api.github.com/repos/hub4j/github-api/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j/github-api/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j/github-api/events", + "assignees_url": "https://api.github.com/repos/hub4j/github-api/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j/github-api/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j/github-api/tags", + "blobs_url": "https://api.github.com/repos/hub4j/github-api/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j/github-api/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j/github-api/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j/github-api/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j/github-api/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j/github-api/languages", + "stargazers_url": "https://api.github.com/repos/hub4j/github-api/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j/github-api/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j/github-api/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j/github-api/subscription", + "commits_url": "https://api.github.com/repos/hub4j/github-api/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j/github-api/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j/github-api/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j/github-api/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j/github-api/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j/github-api/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j/github-api/merges", + "archive_url": "https://api.github.com/repos/hub4j/github-api/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j/github-api/downloads", + "issues_url": "https://api.github.com/repos/hub4j/github-api/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j/github-api/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j/github-api/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j/github-api/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j/github-api/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j/github-api/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j/github-api/deployments", + "created_at": "2010-04-19T04:13:03Z", + "updated_at": "2019-09-25T22:47:32Z", + "pushed_at": "2019-09-25T22:56:18Z", + "git_url": "git://github.com/hub4j/github-api.git", + "ssh_url": "git@github.com:hub4j/github-api.git", + "clone_url": "https://github.com/hub4j/github-api.git", + "svn_url": "https://github.com/hub4j/github-api", + "homepage": "http://github-api.kohsuke.org/", + "size": 11678, + "stargazers_count": 553, + "watchers_count": 553, + "language": "Java", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 427, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 96, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "forks": 427, + "open_issues": 96, + "watchers": 553, + "default_branch": "main" + }, + "source": { + "id": 617210, + "node_id": "MDEwOlJlcG9zaXRvcnk2MTcyMTA=", + "name": "github-api", + "full_name": "hub4j/github-api", + "private": false, + "owner": { + "login": "hub4j", + "id": 54909825, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU0OTA5ODI1", + "avatar_url": "https://avatars3.githubusercontent.com/u/54909825?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/hub4j", + "html_url": "https://github.com/hub4j", + "followers_url": "https://api.github.com/users/hub4j/followers", + "following_url": "https://api.github.com/users/hub4j/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j/orgs", + "repos_url": "https://api.github.com/users/hub4j/repos", + "events_url": "https://api.github.com/users/hub4j/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/hub4j/github-api", + "description": "Java API for GitHub", + "fork": false, + "url": "https://api.github.com/repos/hub4j/github-api", + "forks_url": "https://api.github.com/repos/hub4j/github-api/forks", + "keys_url": "https://api.github.com/repos/hub4j/github-api/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j/github-api/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j/github-api/teams", + "hooks_url": "https://api.github.com/repos/hub4j/github-api/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j/github-api/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j/github-api/events", + "assignees_url": "https://api.github.com/repos/hub4j/github-api/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j/github-api/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j/github-api/tags", + "blobs_url": "https://api.github.com/repos/hub4j/github-api/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j/github-api/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j/github-api/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j/github-api/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j/github-api/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j/github-api/languages", + "stargazers_url": "https://api.github.com/repos/hub4j/github-api/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j/github-api/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j/github-api/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j/github-api/subscription", + "commits_url": "https://api.github.com/repos/hub4j/github-api/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j/github-api/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j/github-api/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j/github-api/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j/github-api/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j/github-api/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j/github-api/merges", + "archive_url": "https://api.github.com/repos/hub4j/github-api/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j/github-api/downloads", + "issues_url": "https://api.github.com/repos/hub4j/github-api/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j/github-api/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j/github-api/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j/github-api/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j/github-api/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j/github-api/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j/github-api/deployments", + "created_at": "2010-04-19T04:13:03Z", + "updated_at": "2019-09-25T22:47:32Z", + "pushed_at": "2019-09-25T22:56:18Z", + "git_url": "git://github.com/hub4j/github-api.git", + "ssh_url": "git@github.com:hub4j/github-api.git", + "clone_url": "https://github.com/hub4j/github-api.git", + "svn_url": "https://github.com/hub4j/github-api", + "homepage": "http://github-api.kohsuke.org/", + "size": 11678, + "stargazers_count": 553, + "watchers_count": 553, + "language": "Java", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 427, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 96, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "forks": 427, + "open_issues": 96, + "watchers": 553, + "default_branch": "main" + }, + "network_count": 427, + "subscribers_count": 0 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/isDisabled/mappings/orgs_hub4j-test-org-2.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/isDisabled/mappings/orgs_hub4j-test-org-2.json new file mode 100644 index 0000000000..e3ce24572d --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/isDisabled/mappings/orgs_hub4j-test-org-2.json @@ -0,0 +1,48 @@ +{ + "id": "cb173af2-c793-444a-acdf-c3850e7afdbe", + "name": "orgs_hub4j-test-org", + "request": { + "url": "/orgs/hub4j-test-org", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "orgs_hub4j-test-org-2.json", + "headers": { + "Date": "Wed, 25 Sep 2019 23:35:58 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4989", + "X-RateLimit-Reset": "1569457884", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"b7989d48e6539c9c76038995b902421b\"", + "Last-Modified": "Mon, 20 Apr 2015 00:42:30 GMT", + "X-OAuth-Scopes": "gist, notifications, read:org, read:public_key, read:repo_hook, repo", + "X-Accepted-OAuth-Scopes": "admin:org, read:org, repo, user, write:org", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "F855:59E1:1397ED7:171400E:5D8BF9DE" + } + }, + "uuid": "cb173af2-c793-444a-acdf-c3850e7afdbe", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/isDisabled/mappings/repos_hub4j-test-org_github-api-3.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/isDisabled/mappings/repos_hub4j-test-org_github-api-3.json new file mode 100644 index 0000000000..e70151202f --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/isDisabled/mappings/repos_hub4j-test-org_github-api-3.json @@ -0,0 +1,51 @@ +{ + "id": "0a4d7a1a-f99c-47ca-840a-3e920c18bd1f", + "name": "repos_hub4j-test-org_github-api", + "request": { + "url": "/repos/hub4j-test-org/github-api", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_github-api-3.json", + "headers": { + "Date": "Wed, 25 Sep 2019 23:35:58 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4988", + "X-RateLimit-Reset": "1569457884", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"0678d1c39ea574f68cc0fb330b067cb7\"", + "Last-Modified": "Wed, 25 Sep 2019 23:32:35 GMT", + "X-OAuth-Scopes": "gist, notifications, read:org, read:public_key, read:repo_hook, repo", + "X-Accepted-OAuth-Scopes": "repo", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "F855:59E1:1397EEB:1714029:5D8BF9DE" + } + }, + "uuid": "0a4d7a1a-f99c-47ca-840a-3e920c18bd1f", + "persistent": true, + "scenarioName": "scenario-1-repos-hub4j-test-org-github-api", + "requiredScenarioState": "Started", + "newScenarioState": "scenario-1-repos-hub4j-test-org-github-api-2", + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/isDisabledTrue/__files/orgs_hub4j-test-org-2.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/isDisabledTrue/__files/orgs_hub4j-test-org-2.json new file mode 100644 index 0000000000..f176fc4ff5 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/isDisabledTrue/__files/orgs_hub4j-test-org-2.json @@ -0,0 +1,42 @@ +{ + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "url": "https://api.github.com/orgs/hub4j-test-org", + "repos_url": "https://api.github.com/orgs/hub4j-test-org/repos", + "events_url": "https://api.github.com/orgs/hub4j-test-org/events", + "hooks_url": "https://api.github.com/orgs/hub4j-test-org/hooks", + "issues_url": "https://api.github.com/orgs/hub4j-test-org/issues", + "members_url": "https://api.github.com/orgs/hub4j-test-org/members{/member}", + "public_members_url": "https://api.github.com/orgs/hub4j-test-org/public_members{/member}", + "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "description": null, + "is_verified": false, + "has_organization_projects": true, + "has_repository_projects": true, + "public_repos": 9, + "public_gists": 0, + "followers": 0, + "following": 0, + "html_url": "https://github.com/hub4j-test-org", + "created_at": "2014-05-10T19:39:11Z", + "updated_at": "2015-04-20T00:42:30Z", + "type": "Organization", + "total_private_repos": 0, + "owned_private_repos": 0, + "private_gists": 0, + "disk_usage": 132, + "collaborators": 0, + "billing_email": "kk@kohsuke.org", + "default_repository_permission": "none", + "members_can_create_repositories": false, + "two_factor_requirement_enabled": false, + "members_allowed_repository_creation_type": "none", + "plan": { + "name": "free", + "space": 976562499, + "private_repos": 0, + "filled_seats": 3, + "seats": 0 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/isDisabledTrue/__files/repos_hub4j-test-org_github-api-3.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/isDisabledTrue/__files/repos_hub4j-test-org_github-api-3.json new file mode 100644 index 0000000000..4438825c47 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/isDisabledTrue/__files/repos_hub4j-test-org_github-api-3.json @@ -0,0 +1,330 @@ +{ + "id": 206888201, + "node_id": "MDEwOlJlcG9zaXRvcnkyMDY4ODgyMDE=", + "name": "github-api", + "full_name": "hub4j-test-org/github-api", + "private": false, + "owner": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://avatars3.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/github-api", + "description": "Tricky", + "fork": true, + "url": "https://api.github.com/repos/hub4j-test-org/github-api", + "forks_url": "https://api.github.com/repos/hub4j-test-org/github-api/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/github-api/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/github-api/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/github-api/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/github-api/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/github-api/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/github-api/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/github-api/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/github-api/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/github-api/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/github-api/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/github-api/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/github-api/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/github-api/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/github-api/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/github-api/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/github-api/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/github-api/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/github-api/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/github-api/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/github-api/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/github-api/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/github-api/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/github-api/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/github-api/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/github-api/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/github-api/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/github-api/deployments", + "created_at": "2019-09-06T23:26:04Z", + "updated_at": "2019-09-25T23:32:35Z", + "pushed_at": "2019-09-21T14:29:14Z", + "git_url": "git://github.com/hub4j-test-org/github-api.git", + "ssh_url": "git@github.com:hub4j-test-org/github-api.git", + "clone_url": "https://github.com/hub4j-test-org/github-api.git", + "svn_url": "https://github.com/hub4j-test-org/github-api", + "homepage": "http://github-api.kohsuke.org/", + "size": 11387, + "stargazers_count": 0, + "watchers_count": 0, + "language": "Java", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": true, + "open_issues_count": 0, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "main", + "permissions": { + "admin": true, + "push": true, + "pull": true + }, + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "organization": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://avatars3.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 + }, + "parent": { + "id": 617210, + "node_id": "MDEwOlJlcG9zaXRvcnk2MTcyMTA=", + "name": "github-api", + "full_name": "hub4j/github-api", + "private": false, + "owner": { + "login": "hub4j", + "id": 54909825, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU0OTA5ODI1", + "avatar_url": "https://avatars3.githubusercontent.com/u/54909825?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/hub4j", + "html_url": "https://github.com/hub4j", + "followers_url": "https://api.github.com/users/hub4j/followers", + "following_url": "https://api.github.com/users/hub4j/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j/orgs", + "repos_url": "https://api.github.com/users/hub4j/repos", + "events_url": "https://api.github.com/users/hub4j/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/hub4j/github-api", + "description": "Java API for GitHub", + "fork": false, + "url": "https://api.github.com/repos/hub4j/github-api", + "forks_url": "https://api.github.com/repos/hub4j/github-api/forks", + "keys_url": "https://api.github.com/repos/hub4j/github-api/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j/github-api/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j/github-api/teams", + "hooks_url": "https://api.github.com/repos/hub4j/github-api/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j/github-api/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j/github-api/events", + "assignees_url": "https://api.github.com/repos/hub4j/github-api/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j/github-api/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j/github-api/tags", + "blobs_url": "https://api.github.com/repos/hub4j/github-api/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j/github-api/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j/github-api/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j/github-api/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j/github-api/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j/github-api/languages", + "stargazers_url": "https://api.github.com/repos/hub4j/github-api/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j/github-api/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j/github-api/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j/github-api/subscription", + "commits_url": "https://api.github.com/repos/hub4j/github-api/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j/github-api/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j/github-api/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j/github-api/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j/github-api/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j/github-api/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j/github-api/merges", + "archive_url": "https://api.github.com/repos/hub4j/github-api/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j/github-api/downloads", + "issues_url": "https://api.github.com/repos/hub4j/github-api/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j/github-api/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j/github-api/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j/github-api/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j/github-api/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j/github-api/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j/github-api/deployments", + "created_at": "2010-04-19T04:13:03Z", + "updated_at": "2019-09-25T22:47:32Z", + "pushed_at": "2019-09-25T22:56:18Z", + "git_url": "git://github.com/hub4j/github-api.git", + "ssh_url": "git@github.com:hub4j/github-api.git", + "clone_url": "https://github.com/hub4j/github-api.git", + "svn_url": "https://github.com/hub4j/github-api", + "homepage": "http://github-api.kohsuke.org/", + "size": 11678, + "stargazers_count": 553, + "watchers_count": 553, + "language": "Java", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 427, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 96, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "forks": 427, + "open_issues": 96, + "watchers": 553, + "default_branch": "main" + }, + "source": { + "id": 617210, + "node_id": "MDEwOlJlcG9zaXRvcnk2MTcyMTA=", + "name": "github-api", + "full_name": "hub4j/github-api", + "private": false, + "owner": { + "login": "hub4j", + "id": 54909825, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU0OTA5ODI1", + "avatar_url": "https://avatars3.githubusercontent.com/u/54909825?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/hub4j", + "html_url": "https://github.com/hub4j", + "followers_url": "https://api.github.com/users/hub4j/followers", + "following_url": "https://api.github.com/users/hub4j/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j/orgs", + "repos_url": "https://api.github.com/users/hub4j/repos", + "events_url": "https://api.github.com/users/hub4j/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/hub4j/github-api", + "description": "Java API for GitHub", + "fork": false, + "url": "https://api.github.com/repos/hub4j/github-api", + "forks_url": "https://api.github.com/repos/hub4j/github-api/forks", + "keys_url": "https://api.github.com/repos/hub4j/github-api/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j/github-api/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j/github-api/teams", + "hooks_url": "https://api.github.com/repos/hub4j/github-api/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j/github-api/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j/github-api/events", + "assignees_url": "https://api.github.com/repos/hub4j/github-api/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j/github-api/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j/github-api/tags", + "blobs_url": "https://api.github.com/repos/hub4j/github-api/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j/github-api/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j/github-api/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j/github-api/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j/github-api/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j/github-api/languages", + "stargazers_url": "https://api.github.com/repos/hub4j/github-api/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j/github-api/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j/github-api/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j/github-api/subscription", + "commits_url": "https://api.github.com/repos/hub4j/github-api/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j/github-api/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j/github-api/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j/github-api/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j/github-api/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j/github-api/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j/github-api/merges", + "archive_url": "https://api.github.com/repos/hub4j/github-api/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j/github-api/downloads", + "issues_url": "https://api.github.com/repos/hub4j/github-api/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j/github-api/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j/github-api/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j/github-api/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j/github-api/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j/github-api/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j/github-api/deployments", + "created_at": "2010-04-19T04:13:03Z", + "updated_at": "2019-09-25T22:47:32Z", + "pushed_at": "2019-09-25T22:56:18Z", + "git_url": "git://github.com/hub4j/github-api.git", + "ssh_url": "git@github.com:hub4j/github-api.git", + "clone_url": "https://github.com/hub4j/github-api.git", + "svn_url": "https://github.com/hub4j/github-api", + "homepage": "http://github-api.kohsuke.org/", + "size": 11678, + "stargazers_count": 553, + "watchers_count": 553, + "language": "Java", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 427, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 96, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "forks": 427, + "open_issues": 96, + "watchers": 553, + "default_branch": "main" + }, + "network_count": 427, + "subscribers_count": 0 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/isDisabledTrue/mappings/orgs_hub4j-test-org-2.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/isDisabledTrue/mappings/orgs_hub4j-test-org-2.json new file mode 100644 index 0000000000..e3ce24572d --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/isDisabledTrue/mappings/orgs_hub4j-test-org-2.json @@ -0,0 +1,48 @@ +{ + "id": "cb173af2-c793-444a-acdf-c3850e7afdbe", + "name": "orgs_hub4j-test-org", + "request": { + "url": "/orgs/hub4j-test-org", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "orgs_hub4j-test-org-2.json", + "headers": { + "Date": "Wed, 25 Sep 2019 23:35:58 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4989", + "X-RateLimit-Reset": "1569457884", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"b7989d48e6539c9c76038995b902421b\"", + "Last-Modified": "Mon, 20 Apr 2015 00:42:30 GMT", + "X-OAuth-Scopes": "gist, notifications, read:org, read:public_key, read:repo_hook, repo", + "X-Accepted-OAuth-Scopes": "admin:org, read:org, repo, user, write:org", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "F855:59E1:1397ED7:171400E:5D8BF9DE" + } + }, + "uuid": "cb173af2-c793-444a-acdf-c3850e7afdbe", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/isDisabledTrue/mappings/repos_hub4j-test-org_github-api-3.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/isDisabledTrue/mappings/repos_hub4j-test-org_github-api-3.json new file mode 100644 index 0000000000..e70151202f --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/isDisabledTrue/mappings/repos_hub4j-test-org_github-api-3.json @@ -0,0 +1,51 @@ +{ + "id": "0a4d7a1a-f99c-47ca-840a-3e920c18bd1f", + "name": "repos_hub4j-test-org_github-api", + "request": { + "url": "/repos/hub4j-test-org/github-api", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_github-api-3.json", + "headers": { + "Date": "Wed, 25 Sep 2019 23:35:58 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4988", + "X-RateLimit-Reset": "1569457884", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"0678d1c39ea574f68cc0fb330b067cb7\"", + "Last-Modified": "Wed, 25 Sep 2019 23:32:35 GMT", + "X-OAuth-Scopes": "gist, notifications, read:org, read:public_key, read:repo_hook, repo", + "X-Accepted-OAuth-Scopes": "repo", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "F855:59E1:1397EEB:1714029:5D8BF9DE" + } + }, + "uuid": "0a4d7a1a-f99c-47ca-840a-3e920c18bd1f", + "persistent": true, + "scenarioName": "scenario-1-repos-hub4j-test-org-github-api", + "requiredScenarioState": "Started", + "newScenarioState": "scenario-1-repos-hub4j-test-org-github-api-2", + "insertionIndex": 3 +} \ No newline at end of file From 05e0b295b4f4c2b9ad5da47e0e2209c508051365 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Jun 2022 20:30:33 +0000 Subject: [PATCH 09/15] Chore(deps): Bump jackson-databind from 2.13.2.2 to 2.13.3 Bumps [jackson-databind](https://github.com/FasterXML/jackson) from 2.13.2.2 to 2.13.3. - [Release notes](https://github.com/FasterXML/jackson/releases) - [Commits](https://github.com/FasterXML/jackson/commits) --- updated-dependencies: - dependency-name: com.fasterxml.jackson.core:jackson-databind dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1f5cbde013..7251642a50 100644 --- a/pom.xml +++ b/pom.xml @@ -468,7 +468,7 @@ com.fasterxml.jackson.core jackson-databind - 2.13.2.2 + 2.13.3 commons-io From da0650f631ed276d524dd6fa90af385fd5371ebf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Jun 2022 20:31:05 +0000 Subject: [PATCH 10/15] Chore(deps): Bump jjwt.suite.version from 0.11.2 to 0.11.5 Bumps `jjwt.suite.version` from 0.11.2 to 0.11.5. Updates `jjwt-api` from 0.11.2 to 0.11.5 - [Release notes](https://github.com/jwtk/jjwt/releases) - [Changelog](https://github.com/jwtk/jjwt/blob/master/CHANGELOG.md) - [Commits](https://github.com/jwtk/jjwt/compare/0.11.2...0.11.5) Updates `jjwt-impl` from 0.11.2 to 0.11.5 - [Release notes](https://github.com/jwtk/jjwt/releases) - [Changelog](https://github.com/jwtk/jjwt/blob/master/CHANGELOG.md) - [Commits](https://github.com/jwtk/jjwt/compare/0.11.2...0.11.5) Updates `jjwt-jackson` from 0.11.2 to 0.11.5 --- updated-dependencies: - dependency-name: io.jsonwebtoken:jjwt-api dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.jsonwebtoken:jjwt-impl dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.jsonwebtoken:jjwt-jackson dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1f5cbde013..77ccc3f95d 100644 --- a/pom.xml +++ b/pom.xml @@ -44,7 +44,7 @@ 0.50 false - 0.11.2 + 0.11.5 From 014fdace38f694cfa842a295a5c0de8e2617da6a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Jun 2022 20:31:15 +0000 Subject: [PATCH 11/15] Chore(deps-dev): Bump mockito-core from 4.5.1 to 4.6.1 Bumps [mockito-core](https://github.com/mockito/mockito) from 4.5.1 to 4.6.1. - [Release notes](https://github.com/mockito/mockito/releases) - [Commits](https://github.com/mockito/mockito/compare/v4.5.1...v4.6.1) --- updated-dependencies: - dependency-name: org.mockito:mockito-core dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1f5cbde013..e509d126ae 100644 --- a/pom.xml +++ b/pom.xml @@ -567,7 +567,7 @@ org.mockito mockito-core - 4.5.1 + 4.6.1 test From d29bf98d5a458af3ba9b5e9be660f76eec2b22fb Mon Sep 17 00:00:00 2001 From: Liam Newman Date: Mon, 20 Jun 2022 14:02:39 -0700 Subject: [PATCH 12/15] Update maven-build.yml --- .github/workflows/maven-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/maven-build.yml b/.github/workflows/maven-build.yml index 38ae3e2c7a..76391020dc 100644 --- a/.github/workflows/maven-build.yml +++ b/.github/workflows/maven-build.yml @@ -82,7 +82,7 @@ jobs: fail-fast: false matrix: os: [ ubuntu, windows ] - java: [ 11.0.3, 11, 17 ] + java: [ 11, 17 ] steps: - uses: actions/checkout@v3 - name: Set up JDK From ad62d8cc9b3f098bbf2cda72dc3efdde59455b10 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Jun 2022 21:03:17 +0000 Subject: [PATCH 13/15] Chore(deps): Bump maven-project-info-reports-plugin from 3.2.2 to 3.3.0 Bumps [maven-project-info-reports-plugin](https://github.com/apache/maven-project-info-reports-plugin) from 3.2.2 to 3.3.0. - [Release notes](https://github.com/apache/maven-project-info-reports-plugin/releases) - [Commits](https://github.com/apache/maven-project-info-reports-plugin/compare/maven-project-info-reports-plugin-3.2.2...maven-project-info-reports-plugin-3.3.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-project-info-reports-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index aebb072e70..5606197a5d 100644 --- a/pom.xml +++ b/pom.xml @@ -278,7 +278,7 @@ org.apache.maven.plugins maven-project-info-reports-plugin - 3.2.2 + 3.3.0 org.apache.bcel From 4f2d4ef12fd85ab816483ff59b1c6e6d633fa472 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Jun 2022 21:03:29 +0000 Subject: [PATCH 14/15] Chore(deps): Bump maven-scm-provider-gitexe from 1.12.2 to 1.13.0 Bumps maven-scm-provider-gitexe from 1.12.2 to 1.13.0. --- updated-dependencies: - dependency-name: org.apache.maven.scm:maven-scm-provider-gitexe dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index aebb072e70..7bca02193f 100644 --- a/pom.xml +++ b/pom.xml @@ -55,7 +55,7 @@ org.apache.maven.scm maven-scm-provider-gitexe - 1.12.2 + 1.13.0 org.apache.maven.scm From 6106164f599d3d10630b0319d8dfad1fd85e2cf1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Jun 2022 23:35:17 +0000 Subject: [PATCH 15/15] Chore(deps): Bump maven-scm-manager-plexus from 1.12.2 to 1.13.0 Bumps maven-scm-manager-plexus from 1.12.2 to 1.13.0. --- updated-dependencies: - dependency-name: org.apache.maven.scm:maven-scm-manager-plexus dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index aebb072e70..1ca0fcb6c7 100644 --- a/pom.xml +++ b/pom.xml @@ -55,12 +55,12 @@ org.apache.maven.scm maven-scm-provider-gitexe - 1.12.2 + 1.13.0 org.apache.maven.scm maven-scm-manager-plexus - 1.12.2 + 1.13.0