From 51ab8a1200a023f2e11cd1faeb2678d0be4bb3ad Mon Sep 17 00:00:00 2001 From: Liam Newman Date: Thu, 19 Dec 2019 16:07:01 -0800 Subject: [PATCH 01/51] updateContentSquashMerge (#325) squash merge --- updateContentSquashMerge | 1 + 1 file changed, 1 insertion(+) create mode 100644 updateContentSquashMerge diff --git a/updateContentSquashMerge b/updateContentSquashMerge new file mode 100644 index 0000000000..58683e978f --- /dev/null +++ b/updateContentSquashMerge @@ -0,0 +1 @@ +updateContentSquashMergeupdateContentSquashMerge \ No newline at end of file From 8051615eff597f4e49f4f47625e6fc2b49f26bfc Mon Sep 17 00:00:00 2001 From: Liam Newman Date: Thu, 19 Dec 2019 16:07:48 -0800 Subject: [PATCH 02/51] squashMerge (#333) squash merge --- squashMerge | 1 + 1 file changed, 1 insertion(+) create mode 100644 squashMerge diff --git a/squashMerge b/squashMerge new file mode 100644 index 0000000000..58a8e2e48d --- /dev/null +++ b/squashMerge @@ -0,0 +1 @@ +squashMerge \ No newline at end of file From 5e91ca8ca0061b9cc71a14969a7ec969c11683ae Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 29 Sep 2022 00:23:33 +0000 Subject: [PATCH 03/51] Chore(deps-dev): Bump slf4j-simple from 1.7.36 to 2.0.3 Bumps [slf4j-simple](https://github.com/qos-ch/slf4j) from 1.7.36 to 2.0.3. - [Release notes](https://github.com/qos-ch/slf4j/releases) - [Commits](https://github.com/qos-ch/slf4j/compare/v_1.7.36...v_2.0.3) --- updated-dependencies: - dependency-name: org.slf4j:slf4j-simple dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9682964cbb..9023497dbe 100644 --- a/pom.xml +++ b/pom.xml @@ -591,7 +591,7 @@ org.slf4j slf4j-simple - 1.7.36 + 2.0.3 test From e3ae8ecfad670ffd76b6bccded885582b49cde62 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 1 Oct 2022 02:00:23 +0000 Subject: [PATCH 04/51] Chore(deps): Bump spotbugs.version from 4.7.1 to 4.7.2 Bumps `spotbugs.version` from 4.7.1 to 4.7.2. Updates `spotbugs` from 4.7.1 to 4.7.2 - [Release notes](https://github.com/spotbugs/spotbugs/releases) - [Changelog](https://github.com/spotbugs/spotbugs/blob/master/CHANGELOG.md) - [Commits](https://github.com/spotbugs/spotbugs/compare/4.7.1...4.7.2) Updates `spotbugs-annotations` from 4.7.1 to 4.7.2 - [Release notes](https://github.com/spotbugs/spotbugs/releases) - [Changelog](https://github.com/spotbugs/spotbugs/blob/master/CHANGELOG.md) - [Commits](https://github.com/spotbugs/spotbugs/compare/4.7.1...4.7.2) --- updated-dependencies: - dependency-name: com.github.spotbugs:spotbugs dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: com.github.spotbugs:spotbugs-annotations 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 9682964cbb..2529453ccb 100644 --- a/pom.xml +++ b/pom.xml @@ -34,7 +34,7 @@ UTF-8 4.7.1.1 - 4.7.1 + 4.7.2 true 2.2 4.9.2 From fbbe3ac2ac49e3d9f2e3df7fbce1370dab87f085 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 1 Oct 2022 02:00:28 +0000 Subject: [PATCH 05/51] Chore(deps): Bump codecov/codecov-action from 3.1.0 to 3.1.1 Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 3.1.0 to 3.1.1. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/v3.1.0...v3.1.1) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-patch ... 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 cd59239a8a..4f8a2115e9 100644 --- a/.github/workflows/maven-build.yml +++ b/.github/workflows/maven-build.yml @@ -76,7 +76,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.1.0 + uses: codecov/codecov-action@v3.1.1 test: name: test (${{ matrix.os }}, Java ${{ matrix.java }}) runs-on: ${{ matrix.os }}-latest From bc2e4ff4df5d3c42ba76b6651e5e1cbeb26e9789 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 1 Oct 2022 02:00:35 +0000 Subject: [PATCH 06/51] Chore(deps-dev): Bump mockito-core from 4.7.0 to 4.8.0 Bumps [mockito-core](https://github.com/mockito/mockito) from 4.7.0 to 4.8.0. - [Release notes](https://github.com/mockito/mockito/releases) - [Commits](https://github.com/mockito/mockito/compare/v4.7.0...v4.8.0) --- 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 9682964cbb..c9f8b27577 100644 --- a/pom.xml +++ b/pom.xml @@ -567,7 +567,7 @@ org.mockito mockito-core - 4.7.0 + 4.8.0 test From c6ea61c96b6868163dac75947588a27736b65f82 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 19 Oct 2022 06:24:21 +0000 Subject: [PATCH 07/51] Chore(deps): Bump jackson-databind from 2.13.3 to 2.13.4.1 Bumps [jackson-databind](https://github.com/FasterXML/jackson) from 2.13.3 to 2.13.4.1. - [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 ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9682964cbb..32ce4530c4 100644 --- a/pom.xml +++ b/pom.xml @@ -468,7 +468,7 @@ com.fasterxml.jackson.core jackson-databind - 2.13.3 + 2.13.4.1 commons-io From db987b714171c90914a6e8c13a8cbbed05e5e35e Mon Sep 17 00:00:00 2001 From: Liam Newman Date: Fri, 21 Oct 2022 11:08:07 -0700 Subject: [PATCH 08/51] Update dependabot.yml --- .github/dependabot.yml | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 1bc6f8e604..74615e5f12 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,12 +1,14 @@ version: 2 updates: - - package-ecosystem: "maven" - directory: "/" - schedule: - interval: "monthly" - time: "02:00" - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "monthly" - time: "02:00" +- package-ecosystem: "maven" + directory: "/" + rebase-strategy: "disabled" + schedule: + interval: "monthly" + time: "02:00" +- package-ecosystem: "github-actions" + directory: "/" + rebase-strategy: "disabled" + schedule: + interval: "monthly" + time: "02:00" From 3c45959db48a056588afa15574d0063d6bca2e40 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 21 Oct 2022 18:08:37 +0000 Subject: [PATCH 09/51] Chore(deps): Bump spotless-maven-plugin from 2.25.0 to 2.27.2 Bumps [spotless-maven-plugin](https://github.com/diffplug/spotless) from 2.25.0 to 2.27.2. - [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.25.0...maven/2.27.2) --- updated-dependencies: - dependency-name: com.diffplug.spotless:spotless-maven-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 9682964cbb..7143713752 100644 --- a/pom.xml +++ b/pom.xml @@ -333,7 +333,7 @@ com.diffplug.spotless spotless-maven-plugin - 2.25.0 + 2.27.2 spotless-check From a292db9233b95a3fd0dac29d8cdf315b585f96e5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Nov 2022 02:00:33 +0000 Subject: [PATCH 10/51] Chore(deps-dev): Bump org.eclipse.jgit Bumps org.eclipse.jgit from 6.1.0.202203080745-r to 6.3.0.2022009070944-r. --- updated-dependencies: - dependency-name: org.eclipse.jgit:org.eclipse.jgit 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 47aef6adfc..c839ec9d40 100644 --- a/pom.xml +++ b/pom.xml @@ -511,7 +511,7 @@ org.eclipse.jgit org.eclipse.jgit - 6.1.0.202203080745-r + 6.3.0.2022009070944-r test From 6799c6b134349459858c7ee935526b961a1f7a77 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Nov 2022 02:00:37 +0000 Subject: [PATCH 11/51] Chore(deps): Bump jackson-databind from 2.13.3 to 2.13.4.2 Bumps [jackson-databind](https://github.com/FasterXML/jackson) from 2.13.3 to 2.13.4.2. - [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 47aef6adfc..7b0e58d836 100644 --- a/pom.xml +++ b/pom.xml @@ -468,7 +468,7 @@ com.fasterxml.jackson.core jackson-databind - 2.13.4.1 + 2.13.4.2 commons-io From e47c0534405c23e0fca30aabf0eb54b19fe21e44 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Nov 2022 02:00:40 +0000 Subject: [PATCH 12/51] Chore(deps): Bump maven-jar-plugin from 3.2.2 to 3.3.0 Bumps [maven-jar-plugin](https://github.com/apache/maven-jar-plugin) from 3.2.2 to 3.3.0. - [Release notes](https://github.com/apache/maven-jar-plugin/releases) - [Commits](https://github.com/apache/maven-jar-plugin/compare/maven-jar-plugin-3.2.2...maven-jar-plugin-3.3.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-jar-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 47aef6adfc..c648e899df 100644 --- a/pom.xml +++ b/pom.xml @@ -817,7 +817,7 @@ org.apache.maven.plugins maven-jar-plugin - 3.2.2 + 3.3.0 From c74edbbeeb5d2dc046465a535e0f45c65dafa32f Mon Sep 17 00:00:00 2001 From: Diegunix Date: Tue, 8 Nov 2022 20:27:45 +0100 Subject: [PATCH 13/51] Add outside_collaborators list --- .../org/kohsuke/github/GHOrganization.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/main/java/org/kohsuke/github/GHOrganization.java b/src/main/java/org/kohsuke/github/GHOrganization.java index 9b0b901d33..5b45e63143 100644 --- a/src/main/java/org/kohsuke/github/GHOrganization.java +++ b/src/main/java/org/kohsuke/github/GHOrganization.java @@ -315,6 +315,17 @@ public PagedIterable listPublicMembers() throws IOException { return listMembers("public_members"); } + /** + * All the outside collaborators of this organization. + * + * @return the paged iterable + * @throws IOException + * the io exception + */ + public PagedIterable listOutsideCollaborators() throws IOException { + return listMembers("outside_collaborators"); + } + private PagedIterable listMembers(String suffix) throws IOException { return listMembers(suffix, null, null); } @@ -332,6 +343,19 @@ public PagedIterable listMembersWithFilter(String filter) throws IOExcep return listMembers("members", filter, null); } + /** + * List outside collaborators with filter paged iterable. + * + * @param filter + * the filter + * @return the paged iterable + * @throws IOException + * the io exception + */ + public PagedIterable listOutsideCollaboratorsWithFilter(String filter) throws IOException { + return listMembers("outside_collaborators", filter, null); + } + /** * List members with specified role paged iterable. * From 6d423f67b77afb638fe96c23d7aead092e5ae9a2 Mon Sep 17 00:00:00 2001 From: Diegunix Date: Wed, 9 Nov 2022 12:38:32 +0100 Subject: [PATCH 14/51] Add test --- .../kohsuke/github/GHOrganizationTest.java | 30 +++ .../__files/orgs_hub4j-test-org-2.json | 41 +++ .../orgs_hub4j-test-org_members-3.json | 242 ++++++++++++++++++ .../__files/user-1.json | 45 ++++ .../mappings/orgs_hub4j-test-org-2.json | 48 ++++ .../orgs_hub4j-test-org_members-3.json | 47 ++++ .../mappings/user-1.json | 48 ++++ 7 files changed, 501 insertions(+) create mode 100644 src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaboratorsWithFilter/__files/orgs_hub4j-test-org-2.json create mode 100644 src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaboratorsWithFilter/__files/orgs_hub4j-test-org_members-3.json create mode 100644 src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaboratorsWithFilter/__files/user-1.json create mode 100644 src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaboratorsWithFilter/mappings/orgs_hub4j-test-org-2.json create mode 100644 src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaboratorsWithFilter/mappings/orgs_hub4j-test-org_members-3.json create mode 100644 src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaboratorsWithFilter/mappings/user-1.json diff --git a/src/test/java/org/kohsuke/github/GHOrganizationTest.java b/src/test/java/org/kohsuke/github/GHOrganizationTest.java index 9ec59b301a..23e8dedfa7 100644 --- a/src/test/java/org/kohsuke/github/GHOrganizationTest.java +++ b/src/test/java/org/kohsuke/github/GHOrganizationTest.java @@ -240,6 +240,36 @@ public void testListMembersWithRole() throws IOException { "Sage-Pierce", "timja")); } + + /** + * Test list outside collaborators with filter. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ + @Test + public void testListOutsideCollaboratorsWithFilter() throws IOException { + GHOrganization org = gitHub.getOrganization(GITHUB_API_TEST_ORG); + + List admins = org.listOutsideCollaboratorsWithFilter("all").toList(); + + assertThat(admins, notNullValue()); + // In case more are added in the future + assertThat(admins.size(), greaterThanOrEqualTo(12)); + assertThat(admins.stream().map(GHUser::getLogin).collect(Collectors.toList()), + hasItems("alexanderrtaylor", + "asthinasthi", + "bitwiseman", + "farmdawgnation", + "halkeye", + "jberglund-BSFT", + "kohsuke", + "kohsuke2", + "martinvanzijl", + "PauloMigAlmeida", + "Sage-Pierce", + "timja")); + } /** * Test create team with repo access. diff --git a/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaboratorsWithFilter/__files/orgs_hub4j-test-org-2.json b/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaboratorsWithFilter/__files/orgs_hub4j-test-org-2.json new file mode 100644 index 0000000000..731f707098 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaboratorsWithFilter/__files/orgs_hub4j-test-org-2.json @@ -0,0 +1,41 @@ +{ + "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": 11, + "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": 147, + "collaborators": 0, + "billing_email": "kk@kohsuke.org", + "default_repository_permission": "none", + "members_can_create_repositories": false, + "two_factor_requirement_enabled": false, + "plan": { + "name": "free", + "space": 976562499, + "private_repos": 0, + "filled_seats": 12, + "seats": 0 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaboratorsWithFilter/__files/orgs_hub4j-test-org_members-3.json b/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaboratorsWithFilter/__files/orgs_hub4j-test-org_members-3.json new file mode 100644 index 0000000000..c8fc2f66f7 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaboratorsWithFilter/__files/orgs_hub4j-test-org_members-3.json @@ -0,0 +1,242 @@ +[ + { + "login": "alexanderrtaylor", + "id": 852179, + "node_id": "MDQ6VXNlcjg1MjE3OQ==", + "avatar_url": "https://avatars0.githubusercontent.com/u/852179?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/alexanderrtaylor", + "html_url": "https://github.com/alexanderrtaylor", + "followers_url": "https://api.github.com/users/alexanderrtaylor/followers", + "following_url": "https://api.github.com/users/alexanderrtaylor/following{/other_user}", + "gists_url": "https://api.github.com/users/alexanderrtaylor/gists{/gist_id}", + "starred_url": "https://api.github.com/users/alexanderrtaylor/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/alexanderrtaylor/subscriptions", + "organizations_url": "https://api.github.com/users/alexanderrtaylor/orgs", + "repos_url": "https://api.github.com/users/alexanderrtaylor/repos", + "events_url": "https://api.github.com/users/alexanderrtaylor/events{/privacy}", + "received_events_url": "https://api.github.com/users/alexanderrtaylor/received_events", + "type": "User", + "site_admin": false + }, + { + "login": "asthinasthi", + "id": 4577101, + "node_id": "MDQ6VXNlcjQ1NzcxMDE=", + "avatar_url": "https://avatars1.githubusercontent.com/u/4577101?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/asthinasthi", + "html_url": "https://github.com/asthinasthi", + "followers_url": "https://api.github.com/users/asthinasthi/followers", + "following_url": "https://api.github.com/users/asthinasthi/following{/other_user}", + "gists_url": "https://api.github.com/users/asthinasthi/gists{/gist_id}", + "starred_url": "https://api.github.com/users/asthinasthi/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/asthinasthi/subscriptions", + "organizations_url": "https://api.github.com/users/asthinasthi/orgs", + "repos_url": "https://api.github.com/users/asthinasthi/repos", + "events_url": "https://api.github.com/users/asthinasthi/events{/privacy}", + "received_events_url": "https://api.github.com/users/asthinasthi/received_events", + "type": "User", + "site_admin": false + }, + { + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false + }, + { + "login": "farmdawgnation", + "id": 620189, + "node_id": "MDQ6VXNlcjYyMDE4OQ==", + "avatar_url": "https://avatars2.githubusercontent.com/u/620189?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/farmdawgnation", + "html_url": "https://github.com/farmdawgnation", + "followers_url": "https://api.github.com/users/farmdawgnation/followers", + "following_url": "https://api.github.com/users/farmdawgnation/following{/other_user}", + "gists_url": "https://api.github.com/users/farmdawgnation/gists{/gist_id}", + "starred_url": "https://api.github.com/users/farmdawgnation/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/farmdawgnation/subscriptions", + "organizations_url": "https://api.github.com/users/farmdawgnation/orgs", + "repos_url": "https://api.github.com/users/farmdawgnation/repos", + "events_url": "https://api.github.com/users/farmdawgnation/events{/privacy}", + "received_events_url": "https://api.github.com/users/farmdawgnation/received_events", + "type": "User", + "site_admin": false + }, + { + "login": "halkeye", + "id": 110087, + "node_id": "MDQ6VXNlcjExMDA4Nw==", + "avatar_url": "https://avatars3.githubusercontent.com/u/110087?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/halkeye", + "html_url": "https://github.com/halkeye", + "followers_url": "https://api.github.com/users/halkeye/followers", + "following_url": "https://api.github.com/users/halkeye/following{/other_user}", + "gists_url": "https://api.github.com/users/halkeye/gists{/gist_id}", + "starred_url": "https://api.github.com/users/halkeye/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/halkeye/subscriptions", + "organizations_url": "https://api.github.com/users/halkeye/orgs", + "repos_url": "https://api.github.com/users/halkeye/repos", + "events_url": "https://api.github.com/users/halkeye/events{/privacy}", + "received_events_url": "https://api.github.com/users/halkeye/received_events", + "type": "User", + "site_admin": false + }, + { + "login": "jberglund-BSFT", + "id": 19560713, + "node_id": "MDQ6VXNlcjE5NTYwNzEz", + "avatar_url": "https://avatars3.githubusercontent.com/u/19560713?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/jberglund-BSFT", + "html_url": "https://github.com/jberglund-BSFT", + "followers_url": "https://api.github.com/users/jberglund-BSFT/followers", + "following_url": "https://api.github.com/users/jberglund-BSFT/following{/other_user}", + "gists_url": "https://api.github.com/users/jberglund-BSFT/gists{/gist_id}", + "starred_url": "https://api.github.com/users/jberglund-BSFT/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/jberglund-BSFT/subscriptions", + "organizations_url": "https://api.github.com/users/jberglund-BSFT/orgs", + "repos_url": "https://api.github.com/users/jberglund-BSFT/repos", + "events_url": "https://api.github.com/users/jberglund-BSFT/events{/privacy}", + "received_events_url": "https://api.github.com/users/jberglund-BSFT/received_events", + "type": "User", + "site_admin": false + }, + { + "login": "kohsuke", + "id": 50003, + "node_id": "MDQ6VXNlcjUwMDAz", + "avatar_url": "https://avatars1.githubusercontent.com/u/50003?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/kohsuke", + "html_url": "https://github.com/kohsuke", + "followers_url": "https://api.github.com/users/kohsuke/followers", + "following_url": "https://api.github.com/users/kohsuke/following{/other_user}", + "gists_url": "https://api.github.com/users/kohsuke/gists{/gist_id}", + "starred_url": "https://api.github.com/users/kohsuke/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/kohsuke/subscriptions", + "organizations_url": "https://api.github.com/users/kohsuke/orgs", + "repos_url": "https://api.github.com/users/kohsuke/repos", + "events_url": "https://api.github.com/users/kohsuke/events{/privacy}", + "received_events_url": "https://api.github.com/users/kohsuke/received_events", + "type": "User", + "site_admin": false + }, + { + "login": "kohsuke2", + "id": 1329242, + "node_id": "MDQ6VXNlcjEzMjkyNDI=", + "avatar_url": "https://avatars2.githubusercontent.com/u/1329242?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/kohsuke2", + "html_url": "https://github.com/kohsuke2", + "followers_url": "https://api.github.com/users/kohsuke2/followers", + "following_url": "https://api.github.com/users/kohsuke2/following{/other_user}", + "gists_url": "https://api.github.com/users/kohsuke2/gists{/gist_id}", + "starred_url": "https://api.github.com/users/kohsuke2/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/kohsuke2/subscriptions", + "organizations_url": "https://api.github.com/users/kohsuke2/orgs", + "repos_url": "https://api.github.com/users/kohsuke2/repos", + "events_url": "https://api.github.com/users/kohsuke2/events{/privacy}", + "received_events_url": "https://api.github.com/users/kohsuke2/received_events", + "type": "User", + "site_admin": false + }, + { + "login": "martinvanzijl", + "id": 24422213, + "node_id": "MDQ6VXNlcjI0NDIyMjEz", + "avatar_url": "https://avatars0.githubusercontent.com/u/24422213?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/martinvanzijl", + "html_url": "https://github.com/martinvanzijl", + "followers_url": "https://api.github.com/users/martinvanzijl/followers", + "following_url": "https://api.github.com/users/martinvanzijl/following{/other_user}", + "gists_url": "https://api.github.com/users/martinvanzijl/gists{/gist_id}", + "starred_url": "https://api.github.com/users/martinvanzijl/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/martinvanzijl/subscriptions", + "organizations_url": "https://api.github.com/users/martinvanzijl/orgs", + "repos_url": "https://api.github.com/users/martinvanzijl/repos", + "events_url": "https://api.github.com/users/martinvanzijl/events{/privacy}", + "received_events_url": "https://api.github.com/users/martinvanzijl/received_events", + "type": "User", + "site_admin": false + }, + { + "login": "PauloMigAlmeida", + "id": 1011868, + "node_id": "MDQ6VXNlcjEwMTE4Njg=", + "avatar_url": "https://avatars1.githubusercontent.com/u/1011868?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/PauloMigAlmeida", + "html_url": "https://github.com/PauloMigAlmeida", + "followers_url": "https://api.github.com/users/PauloMigAlmeida/followers", + "following_url": "https://api.github.com/users/PauloMigAlmeida/following{/other_user}", + "gists_url": "https://api.github.com/users/PauloMigAlmeida/gists{/gist_id}", + "starred_url": "https://api.github.com/users/PauloMigAlmeida/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/PauloMigAlmeida/subscriptions", + "organizations_url": "https://api.github.com/users/PauloMigAlmeida/orgs", + "repos_url": "https://api.github.com/users/PauloMigAlmeida/repos", + "events_url": "https://api.github.com/users/PauloMigAlmeida/events{/privacy}", + "received_events_url": "https://api.github.com/users/PauloMigAlmeida/received_events", + "type": "User", + "site_admin": false + }, + { + "login": "Sage-Pierce", + "id": 5396306, + "node_id": "MDQ6VXNlcjUzOTYzMDY=", + "avatar_url": "https://avatars3.githubusercontent.com/u/5396306?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Sage-Pierce", + "html_url": "https://github.com/Sage-Pierce", + "followers_url": "https://api.github.com/users/Sage-Pierce/followers", + "following_url": "https://api.github.com/users/Sage-Pierce/following{/other_user}", + "gists_url": "https://api.github.com/users/Sage-Pierce/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Sage-Pierce/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Sage-Pierce/subscriptions", + "organizations_url": "https://api.github.com/users/Sage-Pierce/orgs", + "repos_url": "https://api.github.com/users/Sage-Pierce/repos", + "events_url": "https://api.github.com/users/Sage-Pierce/events{/privacy}", + "received_events_url": "https://api.github.com/users/Sage-Pierce/received_events", + "type": "User", + "site_admin": false + }, + { + "login": "timja", + "id": 21194782, + "node_id": "MDQ6VXNlcjIxMTk0Nzgy", + "avatar_url": "https://avatars3.githubusercontent.com/u/21194782?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/timja", + "html_url": "https://github.com/timja", + "followers_url": "https://api.github.com/users/timja/followers", + "following_url": "https://api.github.com/users/timja/following{/other_user}", + "gists_url": "https://api.github.com/users/timja/gists{/gist_id}", + "starred_url": "https://api.github.com/users/timja/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/timja/subscriptions", + "organizations_url": "https://api.github.com/users/timja/orgs", + "repos_url": "https://api.github.com/users/timja/repos", + "events_url": "https://api.github.com/users/timja/events{/privacy}", + "received_events_url": "https://api.github.com/users/timja/received_events", + "type": "User", + "site_admin": false + } +] \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaboratorsWithFilter/__files/user-1.json b/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaboratorsWithFilter/__files/user-1.json new file mode 100644 index 0000000000..750413948a --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaboratorsWithFilter/__files/user-1.json @@ -0,0 +1,45 @@ +{ + "login": "Sage-Pierce", + "id": 5396306, + "node_id": "MDQ6VXNlcjUzOTYzMDY=", + "avatar_url": "https://avatars3.githubusercontent.com/u/5396306?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Sage-Pierce", + "html_url": "https://github.com/Sage-Pierce", + "followers_url": "https://api.github.com/users/Sage-Pierce/followers", + "following_url": "https://api.github.com/users/Sage-Pierce/following{/other_user}", + "gists_url": "https://api.github.com/users/Sage-Pierce/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Sage-Pierce/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Sage-Pierce/subscriptions", + "organizations_url": "https://api.github.com/users/Sage-Pierce/orgs", + "repos_url": "https://api.github.com/users/Sage-Pierce/repos", + "events_url": "https://api.github.com/users/Sage-Pierce/events{/privacy}", + "received_events_url": "https://api.github.com/users/Sage-Pierce/received_events", + "type": "User", + "site_admin": false, + "name": "Sage Pierce", + "company": "@Vrbo @ExpediaGroup", + "blog": "", + "location": null, + "email": "sapierce@vrbo.com", + "hireable": true, + "bio": "Software engineer with a Masters of Science in Electrical and Computer Engineering out of The University of Texas at Austin.", + "public_repos": 9, + "public_gists": 0, + "followers": 4, + "following": 0, + "created_at": "2013-09-06T02:22:48Z", + "updated_at": "2020-02-18T13:29:56Z", + "private_gists": 0, + "total_private_repos": 0, + "owned_private_repos": 0, + "disk_usage": 1816, + "collaborators": 0, + "two_factor_authentication": true, + "plan": { + "name": "free", + "space": 976562499, + "collaborators": 0, + "private_repos": 10000 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaboratorsWithFilter/mappings/orgs_hub4j-test-org-2.json b/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaboratorsWithFilter/mappings/orgs_hub4j-test-org-2.json new file mode 100644 index 0000000000..a28834ada9 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaboratorsWithFilter/mappings/orgs_hub4j-test-org-2.json @@ -0,0 +1,48 @@ +{ + "id": "3ed48345-73c2-4d8e-9c65-f4a140356d59", + "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": { + "Server": "GitHub.com", + "Date": "Tue, 25 Feb 2020 14:41:05 GMT", + "Content-Type": "application/json; charset=utf-8", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4984", + "X-RateLimit-Reset": "1582644474", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"712644daa44df3089a27d6ef60979929\"", + "Last-Modified": "Mon, 20 Apr 2015 00:42:30 GMT", + "X-OAuth-Scopes": "delete_repo, repo, user", + "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": "EB37:2979:3EAF7E:786110:5E5531FF" + } + }, + "uuid": "3ed48345-73c2-4d8e-9c65-f4a140356d59", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaboratorsWithFilter/mappings/orgs_hub4j-test-org_members-3.json b/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaboratorsWithFilter/mappings/orgs_hub4j-test-org_members-3.json new file mode 100644 index 0000000000..b3b40db81b --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaboratorsWithFilter/mappings/orgs_hub4j-test-org_members-3.json @@ -0,0 +1,47 @@ +{ + "id": "ef9f50f7-160c-4410-a82e-68d3e14fb250", + "name": "orgs_hub4j-test-org_members", + "request": { + "url": "/orgs/hub4j-test-org/outside_collaborators?filter=all", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "orgs_hub4j-test-org_members-3.json", + "headers": { + "Server": "GitHub.com", + "Date": "Tue, 25 Feb 2020 14:41:06 GMT", + "Content-Type": "application/json; charset=utf-8", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4983", + "X-RateLimit-Reset": "1582644475", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"631de12e6bc586863218257765331a70\"", + "X-OAuth-Scopes": "delete_repo, repo, user", + "X-Accepted-OAuth-Scopes": "", + "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": "EB37:2979:3EAF8C:78624D:5E553201" + } + }, + "uuid": "ef9f50f7-160c-4410-a82e-68d3e14fb250", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaboratorsWithFilter/mappings/user-1.json b/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaboratorsWithFilter/mappings/user-1.json new file mode 100644 index 0000000000..c259d1b9d7 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaboratorsWithFilter/mappings/user-1.json @@ -0,0 +1,48 @@ +{ + "id": "9e0ec7a6-d16f-4198-b2e6-ed290e9d780d", + "name": "user", + "request": { + "url": "/user", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "user-1.json", + "headers": { + "Server": "GitHub.com", + "Date": "Tue, 25 Feb 2020 14:41:03 GMT", + "Content-Type": "application/json; charset=utf-8", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4988", + "X-RateLimit-Reset": "1582644474", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"9adfa44fe91fb698b5fd807d9471afc3\"", + "Last-Modified": "Tue, 18 Feb 2020 13:29:56 GMT", + "X-OAuth-Scopes": "delete_repo, repo, user", + "X-Accepted-OAuth-Scopes": "", + "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": "EB37:2979:3EAEEA:7860F9:5E5531FF" + } + }, + "uuid": "9e0ec7a6-d16f-4198-b2e6-ed290e9d780d", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file From a2fdd2766130927f827de68be8f9ef5550c32517 Mon Sep 17 00:00:00 2001 From: Diegunix Date: Fri, 11 Nov 2022 18:14:12 +0100 Subject: [PATCH 15/51] Run spotless --- src/test/java/org/kohsuke/github/GHOrganizationTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/org/kohsuke/github/GHOrganizationTest.java b/src/test/java/org/kohsuke/github/GHOrganizationTest.java index 23e8dedfa7..1b11538d36 100644 --- a/src/test/java/org/kohsuke/github/GHOrganizationTest.java +++ b/src/test/java/org/kohsuke/github/GHOrganizationTest.java @@ -240,7 +240,7 @@ public void testListMembersWithRole() throws IOException { "Sage-Pierce", "timja")); } - + /** * Test list outside collaborators with filter. * From d22b637963d46e70d737838a6b14a8725f3352af Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 12 Nov 2022 00:27:39 +0000 Subject: [PATCH 16/51] Chore(deps): Bump bcel from 6.5.0 to 6.6.1 Bumps [bcel](https://github.com/apache/commons-bcel) from 6.5.0 to 6.6.1. - [Release notes](https://github.com/apache/commons-bcel/releases) - [Changelog](https://github.com/apache/commons-bcel/blob/master/RELEASE-NOTES.txt) - [Commits](https://github.com/apache/commons-bcel/compare/rel/commons-bcel-6.5.0...rel/commons-bcel-6.6.1) --- updated-dependencies: - dependency-name: org.apache.bcel:bcel 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 9b138109d5..725274345c 100644 --- a/pom.xml +++ b/pom.xml @@ -283,7 +283,7 @@ org.apache.bcel bcel - 6.5.0 + 6.6.1 From e1dfe3349e9b51d5abbc73a732c39efb82ea1fea Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 12 Nov 2022 01:21:31 +0000 Subject: [PATCH 17/51] Chore(deps-dev): Bump wiremock-jre8-standalone from 2.32.0 to 2.35.0 Bumps [wiremock-jre8-standalone](https://github.com/wiremock/wiremock) from 2.32.0 to 2.35.0. - [Release notes](https://github.com/wiremock/wiremock/releases) - [Commits](https://github.com/wiremock/wiremock/compare/2.32.0...2.35.0) --- updated-dependencies: - dependency-name: com.github.tomakehurst:wiremock-jre8-standalone 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 b03f57c49c..a14724aa1c 100644 --- a/pom.xml +++ b/pom.xml @@ -579,7 +579,7 @@ com.github.tomakehurst wiremock-jre8-standalone - 2.32.0 + 2.35.0 test From e95cb46a31b4d59cbbaf0fefab8c027180dc8b6a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 12 Nov 2022 01:22:03 +0000 Subject: [PATCH 18/51] Chore(deps): Bump spotbugs.version from 4.7.2 to 4.7.3 Bumps `spotbugs.version` from 4.7.2 to 4.7.3. Updates `spotbugs` from 4.7.2 to 4.7.3 - [Release notes](https://github.com/spotbugs/spotbugs/releases) - [Changelog](https://github.com/spotbugs/spotbugs/blob/master/CHANGELOG.md) - [Commits](https://github.com/spotbugs/spotbugs/compare/4.7.2...4.7.3) Updates `spotbugs-annotations` from 4.7.2 to 4.7.3 - [Release notes](https://github.com/spotbugs/spotbugs/releases) - [Changelog](https://github.com/spotbugs/spotbugs/blob/master/CHANGELOG.md) - [Commits](https://github.com/spotbugs/spotbugs/compare/4.7.2...4.7.3) --- updated-dependencies: - dependency-name: com.github.spotbugs:spotbugs dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: com.github.spotbugs:spotbugs-annotations 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 b03f57c49c..48e42c229f 100644 --- a/pom.xml +++ b/pom.xml @@ -34,7 +34,7 @@ UTF-8 4.7.1.1 - 4.7.2 + 4.7.3 true 2.2 4.9.2 From e6d33049a658f1ea1650c8b19ef51d86ea394fd8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 12 Nov 2022 01:22:17 +0000 Subject: [PATCH 19/51] Chore(deps): Bump jackson-databind from 2.13.4.2 to 2.14.0 Bumps [jackson-databind](https://github.com/FasterXML/jackson) from 2.13.4.2 to 2.14.0. - [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-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 b03f57c49c..f8b95f1f64 100644 --- a/pom.xml +++ b/pom.xml @@ -468,7 +468,7 @@ com.fasterxml.jackson.core jackson-databind - 2.13.4.2 + 2.14.0 commons-io From 753d98f1cc68c4cda75f1d29801ddf424cb888d9 Mon Sep 17 00:00:00 2001 From: Diegunix Date: Sat, 12 Nov 2022 08:36:28 +0100 Subject: [PATCH 20/51] Add more test --- .../kohsuke/github/GHOrganizationTest.java | 29 +++ .../__files/orgs_hub4j-test-org-2.json | 41 +++ .../orgs_hub4j-test-org_members-3.json | 242 ++++++++++++++++++ .../__files/user-1.json | 45 ++++ .../mappings/orgs_hub4j-test-org-2.json | 48 ++++ .../orgs_hub4j-test-org_members-3.json | 47 ++++ .../mappings/user-1.json | 48 ++++ 7 files changed, 500 insertions(+) create mode 100644 src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaborators/__files/orgs_hub4j-test-org-2.json create mode 100644 src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaborators/__files/orgs_hub4j-test-org_members-3.json create mode 100644 src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaborators/__files/user-1.json create mode 100644 src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaborators/mappings/orgs_hub4j-test-org-2.json create mode 100644 src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaborators/mappings/orgs_hub4j-test-org_members-3.json create mode 100644 src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaborators/mappings/user-1.json diff --git a/src/test/java/org/kohsuke/github/GHOrganizationTest.java b/src/test/java/org/kohsuke/github/GHOrganizationTest.java index 1b11538d36..6edd1e172e 100644 --- a/src/test/java/org/kohsuke/github/GHOrganizationTest.java +++ b/src/test/java/org/kohsuke/github/GHOrganizationTest.java @@ -241,6 +241,35 @@ public void testListMembersWithRole() throws IOException { "timja")); } + /** + * Test list outside collaborators. + * + * @throws IOException + * Signals that an I/O exception has occurred. + */ + @Test + public void testListOutsideCollaborators() throws IOException { + GHOrganization org = gitHub.getOrganization(GITHUB_API_TEST_ORG); + + List admins = org.listOutsideCollaborators().toList(); + + assertThat(admins, notNullValue()); + // In case more are added in the future + assertThat(admins.size(), greaterThanOrEqualTo(12)); + assertThat(admins.stream().map(GHUser::getLogin).collect(Collectors.toList()), + hasItems("alexanderrtaylor", + "asthinasthi", + "bitwiseman", + "farmdawgnation", + "halkeye", + "jberglund-BSFT", + "kohsuke", + "kohsuke2", + "martinvanzijl", + "PauloMigAlmeida", + "Sage-Pierce", + "timja")); + } /** * Test list outside collaborators with filter. * diff --git a/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaborators/__files/orgs_hub4j-test-org-2.json b/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaborators/__files/orgs_hub4j-test-org-2.json new file mode 100644 index 0000000000..731f707098 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaborators/__files/orgs_hub4j-test-org-2.json @@ -0,0 +1,41 @@ +{ + "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": 11, + "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": 147, + "collaborators": 0, + "billing_email": "kk@kohsuke.org", + "default_repository_permission": "none", + "members_can_create_repositories": false, + "two_factor_requirement_enabled": false, + "plan": { + "name": "free", + "space": 976562499, + "private_repos": 0, + "filled_seats": 12, + "seats": 0 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaborators/__files/orgs_hub4j-test-org_members-3.json b/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaborators/__files/orgs_hub4j-test-org_members-3.json new file mode 100644 index 0000000000..c8fc2f66f7 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaborators/__files/orgs_hub4j-test-org_members-3.json @@ -0,0 +1,242 @@ +[ + { + "login": "alexanderrtaylor", + "id": 852179, + "node_id": "MDQ6VXNlcjg1MjE3OQ==", + "avatar_url": "https://avatars0.githubusercontent.com/u/852179?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/alexanderrtaylor", + "html_url": "https://github.com/alexanderrtaylor", + "followers_url": "https://api.github.com/users/alexanderrtaylor/followers", + "following_url": "https://api.github.com/users/alexanderrtaylor/following{/other_user}", + "gists_url": "https://api.github.com/users/alexanderrtaylor/gists{/gist_id}", + "starred_url": "https://api.github.com/users/alexanderrtaylor/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/alexanderrtaylor/subscriptions", + "organizations_url": "https://api.github.com/users/alexanderrtaylor/orgs", + "repos_url": "https://api.github.com/users/alexanderrtaylor/repos", + "events_url": "https://api.github.com/users/alexanderrtaylor/events{/privacy}", + "received_events_url": "https://api.github.com/users/alexanderrtaylor/received_events", + "type": "User", + "site_admin": false + }, + { + "login": "asthinasthi", + "id": 4577101, + "node_id": "MDQ6VXNlcjQ1NzcxMDE=", + "avatar_url": "https://avatars1.githubusercontent.com/u/4577101?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/asthinasthi", + "html_url": "https://github.com/asthinasthi", + "followers_url": "https://api.github.com/users/asthinasthi/followers", + "following_url": "https://api.github.com/users/asthinasthi/following{/other_user}", + "gists_url": "https://api.github.com/users/asthinasthi/gists{/gist_id}", + "starred_url": "https://api.github.com/users/asthinasthi/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/asthinasthi/subscriptions", + "organizations_url": "https://api.github.com/users/asthinasthi/orgs", + "repos_url": "https://api.github.com/users/asthinasthi/repos", + "events_url": "https://api.github.com/users/asthinasthi/events{/privacy}", + "received_events_url": "https://api.github.com/users/asthinasthi/received_events", + "type": "User", + "site_admin": false + }, + { + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false + }, + { + "login": "farmdawgnation", + "id": 620189, + "node_id": "MDQ6VXNlcjYyMDE4OQ==", + "avatar_url": "https://avatars2.githubusercontent.com/u/620189?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/farmdawgnation", + "html_url": "https://github.com/farmdawgnation", + "followers_url": "https://api.github.com/users/farmdawgnation/followers", + "following_url": "https://api.github.com/users/farmdawgnation/following{/other_user}", + "gists_url": "https://api.github.com/users/farmdawgnation/gists{/gist_id}", + "starred_url": "https://api.github.com/users/farmdawgnation/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/farmdawgnation/subscriptions", + "organizations_url": "https://api.github.com/users/farmdawgnation/orgs", + "repos_url": "https://api.github.com/users/farmdawgnation/repos", + "events_url": "https://api.github.com/users/farmdawgnation/events{/privacy}", + "received_events_url": "https://api.github.com/users/farmdawgnation/received_events", + "type": "User", + "site_admin": false + }, + { + "login": "halkeye", + "id": 110087, + "node_id": "MDQ6VXNlcjExMDA4Nw==", + "avatar_url": "https://avatars3.githubusercontent.com/u/110087?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/halkeye", + "html_url": "https://github.com/halkeye", + "followers_url": "https://api.github.com/users/halkeye/followers", + "following_url": "https://api.github.com/users/halkeye/following{/other_user}", + "gists_url": "https://api.github.com/users/halkeye/gists{/gist_id}", + "starred_url": "https://api.github.com/users/halkeye/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/halkeye/subscriptions", + "organizations_url": "https://api.github.com/users/halkeye/orgs", + "repos_url": "https://api.github.com/users/halkeye/repos", + "events_url": "https://api.github.com/users/halkeye/events{/privacy}", + "received_events_url": "https://api.github.com/users/halkeye/received_events", + "type": "User", + "site_admin": false + }, + { + "login": "jberglund-BSFT", + "id": 19560713, + "node_id": "MDQ6VXNlcjE5NTYwNzEz", + "avatar_url": "https://avatars3.githubusercontent.com/u/19560713?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/jberglund-BSFT", + "html_url": "https://github.com/jberglund-BSFT", + "followers_url": "https://api.github.com/users/jberglund-BSFT/followers", + "following_url": "https://api.github.com/users/jberglund-BSFT/following{/other_user}", + "gists_url": "https://api.github.com/users/jberglund-BSFT/gists{/gist_id}", + "starred_url": "https://api.github.com/users/jberglund-BSFT/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/jberglund-BSFT/subscriptions", + "organizations_url": "https://api.github.com/users/jberglund-BSFT/orgs", + "repos_url": "https://api.github.com/users/jberglund-BSFT/repos", + "events_url": "https://api.github.com/users/jberglund-BSFT/events{/privacy}", + "received_events_url": "https://api.github.com/users/jberglund-BSFT/received_events", + "type": "User", + "site_admin": false + }, + { + "login": "kohsuke", + "id": 50003, + "node_id": "MDQ6VXNlcjUwMDAz", + "avatar_url": "https://avatars1.githubusercontent.com/u/50003?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/kohsuke", + "html_url": "https://github.com/kohsuke", + "followers_url": "https://api.github.com/users/kohsuke/followers", + "following_url": "https://api.github.com/users/kohsuke/following{/other_user}", + "gists_url": "https://api.github.com/users/kohsuke/gists{/gist_id}", + "starred_url": "https://api.github.com/users/kohsuke/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/kohsuke/subscriptions", + "organizations_url": "https://api.github.com/users/kohsuke/orgs", + "repos_url": "https://api.github.com/users/kohsuke/repos", + "events_url": "https://api.github.com/users/kohsuke/events{/privacy}", + "received_events_url": "https://api.github.com/users/kohsuke/received_events", + "type": "User", + "site_admin": false + }, + { + "login": "kohsuke2", + "id": 1329242, + "node_id": "MDQ6VXNlcjEzMjkyNDI=", + "avatar_url": "https://avatars2.githubusercontent.com/u/1329242?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/kohsuke2", + "html_url": "https://github.com/kohsuke2", + "followers_url": "https://api.github.com/users/kohsuke2/followers", + "following_url": "https://api.github.com/users/kohsuke2/following{/other_user}", + "gists_url": "https://api.github.com/users/kohsuke2/gists{/gist_id}", + "starred_url": "https://api.github.com/users/kohsuke2/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/kohsuke2/subscriptions", + "organizations_url": "https://api.github.com/users/kohsuke2/orgs", + "repos_url": "https://api.github.com/users/kohsuke2/repos", + "events_url": "https://api.github.com/users/kohsuke2/events{/privacy}", + "received_events_url": "https://api.github.com/users/kohsuke2/received_events", + "type": "User", + "site_admin": false + }, + { + "login": "martinvanzijl", + "id": 24422213, + "node_id": "MDQ6VXNlcjI0NDIyMjEz", + "avatar_url": "https://avatars0.githubusercontent.com/u/24422213?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/martinvanzijl", + "html_url": "https://github.com/martinvanzijl", + "followers_url": "https://api.github.com/users/martinvanzijl/followers", + "following_url": "https://api.github.com/users/martinvanzijl/following{/other_user}", + "gists_url": "https://api.github.com/users/martinvanzijl/gists{/gist_id}", + "starred_url": "https://api.github.com/users/martinvanzijl/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/martinvanzijl/subscriptions", + "organizations_url": "https://api.github.com/users/martinvanzijl/orgs", + "repos_url": "https://api.github.com/users/martinvanzijl/repos", + "events_url": "https://api.github.com/users/martinvanzijl/events{/privacy}", + "received_events_url": "https://api.github.com/users/martinvanzijl/received_events", + "type": "User", + "site_admin": false + }, + { + "login": "PauloMigAlmeida", + "id": 1011868, + "node_id": "MDQ6VXNlcjEwMTE4Njg=", + "avatar_url": "https://avatars1.githubusercontent.com/u/1011868?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/PauloMigAlmeida", + "html_url": "https://github.com/PauloMigAlmeida", + "followers_url": "https://api.github.com/users/PauloMigAlmeida/followers", + "following_url": "https://api.github.com/users/PauloMigAlmeida/following{/other_user}", + "gists_url": "https://api.github.com/users/PauloMigAlmeida/gists{/gist_id}", + "starred_url": "https://api.github.com/users/PauloMigAlmeida/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/PauloMigAlmeida/subscriptions", + "organizations_url": "https://api.github.com/users/PauloMigAlmeida/orgs", + "repos_url": "https://api.github.com/users/PauloMigAlmeida/repos", + "events_url": "https://api.github.com/users/PauloMigAlmeida/events{/privacy}", + "received_events_url": "https://api.github.com/users/PauloMigAlmeida/received_events", + "type": "User", + "site_admin": false + }, + { + "login": "Sage-Pierce", + "id": 5396306, + "node_id": "MDQ6VXNlcjUzOTYzMDY=", + "avatar_url": "https://avatars3.githubusercontent.com/u/5396306?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Sage-Pierce", + "html_url": "https://github.com/Sage-Pierce", + "followers_url": "https://api.github.com/users/Sage-Pierce/followers", + "following_url": "https://api.github.com/users/Sage-Pierce/following{/other_user}", + "gists_url": "https://api.github.com/users/Sage-Pierce/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Sage-Pierce/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Sage-Pierce/subscriptions", + "organizations_url": "https://api.github.com/users/Sage-Pierce/orgs", + "repos_url": "https://api.github.com/users/Sage-Pierce/repos", + "events_url": "https://api.github.com/users/Sage-Pierce/events{/privacy}", + "received_events_url": "https://api.github.com/users/Sage-Pierce/received_events", + "type": "User", + "site_admin": false + }, + { + "login": "timja", + "id": 21194782, + "node_id": "MDQ6VXNlcjIxMTk0Nzgy", + "avatar_url": "https://avatars3.githubusercontent.com/u/21194782?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/timja", + "html_url": "https://github.com/timja", + "followers_url": "https://api.github.com/users/timja/followers", + "following_url": "https://api.github.com/users/timja/following{/other_user}", + "gists_url": "https://api.github.com/users/timja/gists{/gist_id}", + "starred_url": "https://api.github.com/users/timja/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/timja/subscriptions", + "organizations_url": "https://api.github.com/users/timja/orgs", + "repos_url": "https://api.github.com/users/timja/repos", + "events_url": "https://api.github.com/users/timja/events{/privacy}", + "received_events_url": "https://api.github.com/users/timja/received_events", + "type": "User", + "site_admin": false + } +] \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaborators/__files/user-1.json b/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaborators/__files/user-1.json new file mode 100644 index 0000000000..750413948a --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaborators/__files/user-1.json @@ -0,0 +1,45 @@ +{ + "login": "Sage-Pierce", + "id": 5396306, + "node_id": "MDQ6VXNlcjUzOTYzMDY=", + "avatar_url": "https://avatars3.githubusercontent.com/u/5396306?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Sage-Pierce", + "html_url": "https://github.com/Sage-Pierce", + "followers_url": "https://api.github.com/users/Sage-Pierce/followers", + "following_url": "https://api.github.com/users/Sage-Pierce/following{/other_user}", + "gists_url": "https://api.github.com/users/Sage-Pierce/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Sage-Pierce/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Sage-Pierce/subscriptions", + "organizations_url": "https://api.github.com/users/Sage-Pierce/orgs", + "repos_url": "https://api.github.com/users/Sage-Pierce/repos", + "events_url": "https://api.github.com/users/Sage-Pierce/events{/privacy}", + "received_events_url": "https://api.github.com/users/Sage-Pierce/received_events", + "type": "User", + "site_admin": false, + "name": "Sage Pierce", + "company": "@Vrbo @ExpediaGroup", + "blog": "", + "location": null, + "email": "sapierce@vrbo.com", + "hireable": true, + "bio": "Software engineer with a Masters of Science in Electrical and Computer Engineering out of The University of Texas at Austin.", + "public_repos": 9, + "public_gists": 0, + "followers": 4, + "following": 0, + "created_at": "2013-09-06T02:22:48Z", + "updated_at": "2020-02-18T13:29:56Z", + "private_gists": 0, + "total_private_repos": 0, + "owned_private_repos": 0, + "disk_usage": 1816, + "collaborators": 0, + "two_factor_authentication": true, + "plan": { + "name": "free", + "space": 976562499, + "collaborators": 0, + "private_repos": 10000 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaborators/mappings/orgs_hub4j-test-org-2.json b/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaborators/mappings/orgs_hub4j-test-org-2.json new file mode 100644 index 0000000000..a28834ada9 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaborators/mappings/orgs_hub4j-test-org-2.json @@ -0,0 +1,48 @@ +{ + "id": "3ed48345-73c2-4d8e-9c65-f4a140356d59", + "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": { + "Server": "GitHub.com", + "Date": "Tue, 25 Feb 2020 14:41:05 GMT", + "Content-Type": "application/json; charset=utf-8", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4984", + "X-RateLimit-Reset": "1582644474", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"712644daa44df3089a27d6ef60979929\"", + "Last-Modified": "Mon, 20 Apr 2015 00:42:30 GMT", + "X-OAuth-Scopes": "delete_repo, repo, user", + "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": "EB37:2979:3EAF7E:786110:5E5531FF" + } + }, + "uuid": "3ed48345-73c2-4d8e-9c65-f4a140356d59", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaborators/mappings/orgs_hub4j-test-org_members-3.json b/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaborators/mappings/orgs_hub4j-test-org_members-3.json new file mode 100644 index 0000000000..b34c01a2da --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaborators/mappings/orgs_hub4j-test-org_members-3.json @@ -0,0 +1,47 @@ +{ + "id": "ef9f50f7-160c-4410-a82e-68d3e14fb250", + "name": "orgs_hub4j-test-org_members", + "request": { + "url": "/orgs/hub4j-test-org/outside_collaborators", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "orgs_hub4j-test-org_members-3.json", + "headers": { + "Server": "GitHub.com", + "Date": "Tue, 25 Feb 2020 14:41:06 GMT", + "Content-Type": "application/json; charset=utf-8", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4983", + "X-RateLimit-Reset": "1582644475", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"631de12e6bc586863218257765331a70\"", + "X-OAuth-Scopes": "delete_repo, repo, user", + "X-Accepted-OAuth-Scopes": "", + "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": "EB37:2979:3EAF8C:78624D:5E553201" + } + }, + "uuid": "ef9f50f7-160c-4410-a82e-68d3e14fb250", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaborators/mappings/user-1.json b/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaborators/mappings/user-1.json new file mode 100644 index 0000000000..c259d1b9d7 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHOrganizationTest/wiremock/testListOutsideCollaborators/mappings/user-1.json @@ -0,0 +1,48 @@ +{ + "id": "9e0ec7a6-d16f-4198-b2e6-ed290e9d780d", + "name": "user", + "request": { + "url": "/user", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "user-1.json", + "headers": { + "Server": "GitHub.com", + "Date": "Tue, 25 Feb 2020 14:41:03 GMT", + "Content-Type": "application/json; charset=utf-8", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4988", + "X-RateLimit-Reset": "1582644474", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"9adfa44fe91fb698b5fd807d9471afc3\"", + "Last-Modified": "Tue, 18 Feb 2020 13:29:56 GMT", + "X-OAuth-Scopes": "delete_repo, repo, user", + "X-Accepted-OAuth-Scopes": "", + "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": "EB37:2979:3EAEEA:7860F9:5E5531FF" + } + }, + "uuid": "9e0ec7a6-d16f-4198-b2e6-ed290e9d780d", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file From 6a101c8cdd2dc6d05c7c6dfa04d37bdb7ed872c0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 Dec 2022 02:00:23 +0000 Subject: [PATCH 21/51] Chore(deps-dev): Bump gson from 2.9.1 to 2.10 Bumps [gson](https://github.com/google/gson) from 2.9.1 to 2.10. - [Release notes](https://github.com/google/gson/releases) - [Changelog](https://github.com/google/gson/blob/master/CHANGELOG.md) - [Commits](https://github.com/google/gson/compare/gson-parent-2.9.1...gson-parent-2.10) --- updated-dependencies: - dependency-name: com.google.code.gson:gson 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 325b34935e..0822cebc06 100644 --- a/pom.xml +++ b/pom.xml @@ -585,7 +585,7 @@ com.google.code.gson gson - 2.9.1 + 2.10 test From 99c81dafa23f6b1378e878a955d795f467efd739 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 Dec 2022 02:00:25 +0000 Subject: [PATCH 22/51] Chore(deps-dev): Bump org.eclipse.jgit Bumps org.eclipse.jgit from 6.3.0.2022009070944-r to 6.4.0.202211300538-r. --- updated-dependencies: - dependency-name: org.eclipse.jgit:org.eclipse.jgit 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 325b34935e..ac98773f5e 100644 --- a/pom.xml +++ b/pom.xml @@ -511,7 +511,7 @@ org.eclipse.jgit org.eclipse.jgit - 6.3.0.2022009070944-r + 6.4.0.202211300538-r test From de1c7ec179bdd928b6c41712b7ea50062e798d9b Mon Sep 17 00:00:00 2001 From: tt0suzy Date: Sun, 11 Dec 2022 00:45:23 -0600 Subject: [PATCH 23/51] fixed flaky test --- .../java/org/kohsuke/github/GHObjectTest.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/test/java/org/kohsuke/github/GHObjectTest.java b/src/test/java/org/kohsuke/github/GHObjectTest.java index 05a8c1ae4e..91f3b8a403 100644 --- a/src/test/java/org/kohsuke/github/GHObjectTest.java +++ b/src/test/java/org/kohsuke/github/GHObjectTest.java @@ -19,10 +19,17 @@ public class GHObjectTest extends org.kohsuke.github.AbstractGitHubWireMockTest @Test public void test_toString() throws Exception { GHOrganization org = gitHub.getOrganization(GITHUB_API_TEST_ORG); - assertThat(org.toString(), - containsString( - "login=hub4j-test-org,location=,blog=,email=,bio=,name=,company=,type=Organization,followers=0,following=0,hireable=false")); - + assertThat(org.toString(), containsString("login=hub4j-test-org")); + assertThat(org.toString(), containsString("location=")); + assertThat(org.toString(), containsString("blog=")); + assertThat(org.toString(), containsString("email=")); + assertThat(org.toString(), containsString("bio=")); + assertThat(org.toString(), containsString("name=")); + assertThat(org.toString(), containsString("company=")); + assertThat(org.toString(), containsString("type=Organization")); + assertThat(org.toString(), containsString("followers=0")); + assertThat(org.toString(), containsString("hireable=false")); + // getResponseHeaderFields is deprecated but we should not break it. assertThat(org.getResponseHeaderFields(), notNullValue()); assertThat(org.getResponseHeaderFields().get("Cache-Control").get(0), is("private, max-age=60, s-maxage=60")); From 1876a6991ac876d8d83d946b48b18d2b6aa552c8 Mon Sep 17 00:00:00 2001 From: Rahul Somasunderam Date: Thu, 22 Dec 2022 15:39:36 -0800 Subject: [PATCH 24/51] feat: Add head_commit to GHEventPayload.Push When that class represents a commit being pushed to a branch, the list of commits is available and useful to know what was pushed. When it represents a tag being pushed, the list of commits can be empty. The `head_commit` comes in handy to know more about the commit. This change exposes `head_commit` using the getter `getHeadCommit()`. The test data already has the data for this to work. The test case has been updated to test for this method. Refs: #1585 --- src/main/java/org/kohsuke/github/GHEventPayload.java | 11 +++++++++++ .../java/org/kohsuke/github/GHEventPayloadTest.java | 12 ++++++++++++ 2 files changed, 23 insertions(+) diff --git a/src/main/java/org/kohsuke/github/GHEventPayload.java b/src/main/java/org/kohsuke/github/GHEventPayload.java index 41ea636aac..b6549faadd 100644 --- a/src/main/java/org/kohsuke/github/GHEventPayload.java +++ b/src/main/java/org/kohsuke/github/GHEventPayload.java @@ -1043,6 +1043,7 @@ public static class Push extends GHEventPayload { private String ref; private int size; private List commits; + private PushCommit headCommit; private Pusher pusher; private String compare; @@ -1124,6 +1125,16 @@ public List getCommits() { return Collections.unmodifiableList(commits); } + /** + * The head commit of the push. + * + * @return the commit + */ + @SuppressFBWarnings(value = { "EI_EXPOSE_REP" }, justification = "Expected") + public PushCommit getHeadCommit() { + return headCommit; + } + /** * Gets pusher. * diff --git a/src/test/java/org/kohsuke/github/GHEventPayloadTest.java b/src/test/java/org/kohsuke/github/GHEventPayloadTest.java index c612a700c4..1b3be27bd4 100644 --- a/src/test/java/org/kohsuke/github/GHEventPayloadTest.java +++ b/src/test/java/org/kohsuke/github/GHEventPayloadTest.java @@ -624,6 +624,18 @@ public void push() throws Exception { assertThat(event.getCommits().get(0).getRemoved().size(), is(0)); assertThat(event.getCommits().get(0).getModified().size(), is(1)); assertThat(event.getCommits().get(0).getModified().get(0), is("README.md")); + + assertThat(event.getHeadCommit().getSha(), is("0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c")); + assertThat(event.getHeadCommit().getAuthor().getEmail(), is("baxterthehacker@users.noreply.github.com")); + assertThat(event.getHeadCommit().getAuthor().getUsername(), is("baxterthehacker")); + assertThat(event.getHeadCommit().getCommitter().getEmail(), is("baxterthehacker@users.noreply.github.com")); + assertThat(event.getHeadCommit().getCommitter().getUsername(), is("baxterthehacker")); + assertThat(event.getHeadCommit().getAdded().size(), is(0)); + assertThat(event.getHeadCommit().getRemoved().size(), is(0)); + assertThat(event.getHeadCommit().getModified().size(), is(1)); + assertThat(event.getHeadCommit().getModified().get(0), is("README.md")); + assertThat(event.getHeadCommit().getMessage(), is("Update README.md")); + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'"); formatter.setTimeZone(TimeZone.getTimeZone("UTC")); assertThat(formatter.format(event.getCommits().get(0).getTimestamp()), is("2015-05-05T23:40:15Z")); From d4f5c1f10911bc99901d7ece05639af0297c6191 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 1 Jan 2023 02:00:21 +0000 Subject: [PATCH 25/51] Chore(deps-dev): Bump mockito-core from 4.8.0 to 4.11.0 Bumps [mockito-core](https://github.com/mockito/mockito) from 4.8.0 to 4.11.0. - [Release notes](https://github.com/mockito/mockito/releases) - [Commits](https://github.com/mockito/mockito/compare/v4.8.0...v4.11.0) --- 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 c38182f72c..7d78539278 100644 --- a/pom.xml +++ b/pom.xml @@ -567,7 +567,7 @@ org.mockito mockito-core - 4.8.0 + 4.11.0 test From 6819e42de40175952397d8fe55ff57355f738408 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 1 Jan 2023 02:00:25 +0000 Subject: [PATCH 26/51] Chore(deps): Bump spotbugs-maven-plugin from 4.7.1.1 to 4.7.3.0 Bumps [spotbugs-maven-plugin](https://github.com/spotbugs/spotbugs-maven-plugin) from 4.7.1.1 to 4.7.3.0. - [Release notes](https://github.com/spotbugs/spotbugs-maven-plugin/releases) - [Commits](https://github.com/spotbugs/spotbugs-maven-plugin/compare/spotbugs-maven-plugin-4.7.1.1...spotbugs-maven-plugin-4.7.3.0) --- updated-dependencies: - dependency-name: com.github.spotbugs:spotbugs-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 c38182f72c..5e5fd9129a 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ UTF-8 - 4.7.1.1 + 4.7.3.0 4.7.3 true 2.2 From 087b8cb30e6d3f9ac06e927f56137f95ac054aa6 Mon Sep 17 00:00:00 2001 From: c3p0-maif <69896961+c3p0-maif@users.noreply.github.com> Date: Wed, 11 Jan 2023 12:53:15 +0100 Subject: [PATCH 27/51] Add logs in GitHubClient response. fix #1594 --- .../java/org/kohsuke/github/GitHubClient.java | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/kohsuke/github/GitHubClient.java b/src/main/java/org/kohsuke/github/GitHubClient.java index 73491d148d..1011a0a9bf 100644 --- a/src/main/java/org/kohsuke/github/GitHubClient.java +++ b/src/main/java/org/kohsuke/github/GitHubClient.java @@ -430,6 +430,7 @@ public GitHubResponse sendRequest(GitHubRequest request, @CheckForNull Bo logRequest(connectorRequest); rateLimitChecker.checkRateLimit(this, request.rateLimitTarget()); connectorResponse = connector.send(connectorRequest); + logResponse(connectorResponse); noteRateLimit(request.rateLimitTarget(), connectorResponse); detectKnownErrors(connectorResponse, request, handler != null); return createResponse(connectorResponse, handler); @@ -520,8 +521,23 @@ private GitHubConnectorRequest prepareConnectorRequest(GitHubRequest request) th private void logRequest(@Nonnull final GitHubConnectorRequest request) { LOGGER.log(FINE, - () -> "GitHub API request [" + (getLogin() == null ? "anonymous" : getLogin()) + "]: " - + request.method() + " " + request.url().toString()); + () -> String.format("(%s) GitHub API request [%s]: %s", + Integer.toHexString(request.hashCode()), + (getLogin() == null ? "anonymous" : getLogin()), + (request.method() + " " + request.url().toString()))); + } + + private void logResponse(@Nonnull final GitHubConnectorResponse response) { + LOGGER.log(FINE, () -> { + try { + return String.format("(%s) GitHub API response [%s]: %s", + Integer.toHexString(response.request().hashCode()), + (getLogin() == null ? "anonymous" : getLogin()), + (response.statusCode() + " " + GitHubResponse.getBodyAsString(response))); + } catch (IOException e) { + throw new RuntimeException(e); + } + }); } @Nonnull From 722d2737d62eeeb665d9406550d809d694aed276 Mon Sep 17 00:00:00 2001 From: THE-Spellchecker Date: Wed, 18 Jan 2023 01:08:29 -0500 Subject: [PATCH 28/51] Comment & String Fixes --- CONTRIBUTING.md | 2 +- src/main/java/org/kohsuke/github/GHCommit.java | 2 +- src/main/java/org/kohsuke/github/GHCompare.java | 2 +- .../java/org/kohsuke/github/GHFileNotFoundException.java | 2 +- src/main/java/org/kohsuke/github/GHIOException.java | 2 +- src/main/java/org/kohsuke/github/GHIssue.java | 2 +- src/main/java/org/kohsuke/github/GHMyself.java | 4 ++-- src/main/java/org/kohsuke/github/GHOrganization.java | 2 +- src/main/java/org/kohsuke/github/GHRateLimit.java | 4 ++-- src/main/java/org/kohsuke/github/GHRef.java | 2 +- src/main/java/org/kohsuke/github/GHRepository.java | 8 ++++---- src/main/java/org/kohsuke/github/GHTree.java | 2 +- src/main/java/org/kohsuke/github/GHVerification.java | 6 +++--- src/main/java/org/kohsuke/github/GitHubRequest.java | 4 ++-- .../github/example/dataobject/ReadOnlyObjects.java | 4 ++-- .../github/extras/authorization/JWTTokenProvider.java | 2 +- .../internal/GitHubConnectorHttpConnectorAdapter.java | 2 +- 17 files changed, 26 insertions(+), 26 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5192c47bb8..5b52f26a8b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -82,7 +82,7 @@ When modifying existing tests, you can change the stubbed WireMock data files by #### Manual editing of data (minor changes only) If you know what data will change, it is sometimes simplest to make any required changes to the data files manually. -This can be easier if the changes are minor or when you development environment is not setup to to take updated snapshots. +This can be easier if the changes are minor or when you development environment is not setup to take updated snapshots. #### Generating a new snapshot diff --git a/src/main/java/org/kohsuke/github/GHCommit.java b/src/main/java/org/kohsuke/github/GHCommit.java index abd8c73900..56fc0125a8 100644 --- a/src/main/java/org/kohsuke/github/GHCommit.java +++ b/src/main/java/org/kohsuke/github/GHCommit.java @@ -125,7 +125,7 @@ public static class Stats { /** * A file that was modified. */ - @SuppressFBWarnings(value = "UWF_UNWRITTEN_FIELD", justification = "It's being initilized by JSON deserialization") + @SuppressFBWarnings(value = "UWF_UNWRITTEN_FIELD", justification = "It's being initialized by JSON deserialization") public static class File { /** The status. */ diff --git a/src/main/java/org/kohsuke/github/GHCompare.java b/src/main/java/org/kohsuke/github/GHCompare.java index 00273fa224..c4dd7cb32e 100644 --- a/src/main/java/org/kohsuke/github/GHCompare.java +++ b/src/main/java/org/kohsuke/github/GHCompare.java @@ -224,7 +224,7 @@ GHCompare lateBind(GHRepository owner) { } /** - * Compare commits had a child commit element with additional details we want to capture. This extenstion of + * Compare commits had a child commit element with additional details we want to capture. This extension of * GHCommit provides that. */ @SuppressFBWarnings(value = { "UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD", "UWF_UNWRITTEN_FIELD" }, diff --git a/src/main/java/org/kohsuke/github/GHFileNotFoundException.java b/src/main/java/org/kohsuke/github/GHFileNotFoundException.java index 3420a2799b..4de844e0ae 100644 --- a/src/main/java/org/kohsuke/github/GHFileNotFoundException.java +++ b/src/main/java/org/kohsuke/github/GHFileNotFoundException.java @@ -10,7 +10,7 @@ // TODO: Auto-generated Javadoc /** - * Request/responce contains useful metadata. Custom exception allows store info for next diagnostics. + * Request/response contains useful metadata. Custom exception allows store info for next diagnostics. * * @author Kanstantsin Shautsou */ diff --git a/src/main/java/org/kohsuke/github/GHIOException.java b/src/main/java/org/kohsuke/github/GHIOException.java index e26e19fadd..2654e845ab 100644 --- a/src/main/java/org/kohsuke/github/GHIOException.java +++ b/src/main/java/org/kohsuke/github/GHIOException.java @@ -10,7 +10,7 @@ // TODO: Auto-generated Javadoc /** - * Request/responce contains useful metadata. Custom exception allows store info for next diagnostics. + * Request/response contains useful metadata. Custom exception allows store info for next diagnostics. * * @author Kanstantsin Shautsou */ diff --git a/src/main/java/org/kohsuke/github/GHIssue.java b/src/main/java/org/kohsuke/github/GHIssue.java index 741fd73c3d..9d6027f331 100644 --- a/src/main/java/org/kohsuke/github/GHIssue.java +++ b/src/main/java/org/kohsuke/github/GHIssue.java @@ -517,7 +517,7 @@ public List getComments() throws IOException { } /** - * Obtains all the comments associated with this issue, witout any filter. + * Obtains all the comments associated with this issue, without any filter. * * @return the paged iterable * @throws IOException diff --git a/src/main/java/org/kohsuke/github/GHMyself.java b/src/main/java/org/kohsuke/github/GHMyself.java index ea02e83a0d..ea3dd5f3d7 100644 --- a/src/main/java/org/kohsuke/github/GHMyself.java +++ b/src/main/java/org/kohsuke/github/GHMyself.java @@ -70,9 +70,9 @@ public List getEmails2() throws IOException { } /** - * Returns the read-only list of all the pulic keys of the current user. + * Returns the read-only list of all the public keys of the current user. *

- * NOTE: When using OAuth authenticaiton, the READ/WRITE User scope is required by the GitHub APIs, otherwise you + * NOTE: When using OAuth authentication, the READ/WRITE User scope is required by the GitHub APIs, otherwise you * will get a 404 NOT FOUND. * * @return Always non-null. diff --git a/src/main/java/org/kohsuke/github/GHOrganization.java b/src/main/java/org/kohsuke/github/GHOrganization.java index 5b45e63143..0d881aff61 100644 --- a/src/main/java/org/kohsuke/github/GHOrganization.java +++ b/src/main/java/org/kohsuke/github/GHOrganization.java @@ -655,7 +655,7 @@ public List getRepositoriesWithOpenPullRequests() throws IOExcepti } /** - * Gets all the open pull requests in this organizataion. + * Gets all the open pull requests in this organization. * * @return the pull requests * @throws IOException diff --git a/src/main/java/org/kohsuke/github/GHRateLimit.java b/src/main/java/org/kohsuke/github/GHRateLimit.java index 8b38e0ccd9..84c9345e77 100644 --- a/src/main/java/org/kohsuke/github/GHRateLimit.java +++ b/src/main/java/org/kohsuke/github/GHRateLimit.java @@ -347,7 +347,7 @@ Record getRecord(@Nonnull RateLimitTarget rateLimitTarget) { } /** - * A limit record used as a placeholder when the the actual limit is not known. + * A limit record used as a placeholder when the actual limit is not known. * * @since 1.100 */ @@ -528,7 +528,7 @@ && getRemaining() <= other.getRemaining())) { } else if (!(other instanceof UnknownLimitRecord)) { // If the above is not the case that means other has a later reset // or the same resent and fewer requests remaining. - // If the other record is not an unknown record, the the other is more recent + // If the other record is not an unknown record, the other is more recent return other; } else if (this.isExpired() && !other.isExpired()) { // The other is an unknown record. diff --git a/src/main/java/org/kohsuke/github/GHRef.java b/src/main/java/org/kohsuke/github/GHRef.java index 47de0cf9a7..429dcfbf0a 100644 --- a/src/main/java/org/kohsuke/github/GHRef.java +++ b/src/main/java/org/kohsuke/github/GHRef.java @@ -85,7 +85,7 @@ public void delete() throws IOException { } /** - * Retrive a ref of the given type for the current GitHub repository. + * Retrieve a ref of the given type for the current GitHub repository. * * @param repository * the repository to read from diff --git a/src/main/java/org/kohsuke/github/GHRepository.java b/src/main/java/org/kohsuke/github/GHRepository.java index fa5db64beb..cd7fd62515 100644 --- a/src/main/java/org/kohsuke/github/GHRepository.java +++ b/src/main/java/org/kohsuke/github/GHRepository.java @@ -1891,7 +1891,7 @@ public GHCompare getCompare(GHBranch id1, GHBranch id2) throws IOException { /** * Retrieves all refs for the github repository. * - * @return an array of GHRef elements coresponding with the refs in the remote repository. + * @return an array of GHRef elements corresponding with the refs in the remote repository. * @throws IOException * on failure communicating with GitHub */ @@ -1937,7 +1937,7 @@ public PagedIterable listRefs(String refType) throws IOException { } /** - * Retrive a ref of the given type for the current GitHub repository. + * Retrieve a ref of the given type for the current GitHub repository. * * @param refName * eg: heads/branch @@ -1964,7 +1964,7 @@ public GHTagObject getTagObject(String sha) throws IOException { } /** - * Retrive a tree of the given type for the current GitHub repository. + * Retrieve a tree of the given type for the current GitHub repository. * * @param sha * sha number or branch name ex: "main" @@ -2222,7 +2222,7 @@ public PagedIterable getCheckRuns(String ref) throws IOException { * @param description * Optional short description. * @param context - * Optinal commit status context. + * Optional commit status context. * @return the gh commit status * @throws IOException * the io exception diff --git a/src/main/java/org/kohsuke/github/GHTree.java b/src/main/java/org/kohsuke/github/GHTree.java index 33b084fac3..6a2be8a55e 100644 --- a/src/main/java/org/kohsuke/github/GHTree.java +++ b/src/main/java/org/kohsuke/github/GHTree.java @@ -61,7 +61,7 @@ public GHTreeEntry getEntry(String path) { /** * Returns true if the number of items in the tree array exceeded the GitHub maximum limit. * - * @return true true if the number of items in the tree array exceeded the GitHub maximum limit otherwise false. + * @return true if the number of items in the tree array exceeded the GitHub maximum limit otherwise false. */ public boolean isTruncated() { return truncated; diff --git a/src/main/java/org/kohsuke/github/GHVerification.java b/src/main/java/org/kohsuke/github/GHVerification.java index a38ad958d2..382d39a26e 100644 --- a/src/main/java/org/kohsuke/github/GHVerification.java +++ b/src/main/java/org/kohsuke/github/GHVerification.java @@ -9,9 +9,9 @@ * * @author Sourabh Sarvotham Parkala * @see tags signature - * verificatiion + * verification * @see commits signature - * verificatiion + * verification */ @SuppressFBWarnings(value = { "UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD", "UWF_UNWRITTEN_FIELD", "NP_UNWRITTEN_FIELD" }, justification = "JSON API") @@ -32,7 +32,7 @@ public boolean isVerified() { /** * Gets reason for verification value. * - * @return return reason of type {@link Reason}, such as "valid" or "unsigned". The possible values can be found in + * @return reason of type {@link Reason}, such as "valid" or "unsigned". The possible values can be found in * {@link Reason}} */ public Reason getReason() { diff --git a/src/main/java/org/kohsuke/github/GitHubRequest.java b/src/main/java/org/kohsuke/github/GitHubRequest.java index 14641125b1..058f4d3b47 100644 --- a/src/main/java/org/kohsuke/github/GitHubRequest.java +++ b/src/main/java/org/kohsuke/github/GitHubRequest.java @@ -228,7 +228,7 @@ public String urlPath() { } /** - * The content type to to be sent by this request. + * The content type to be sent by this request. * * @return the content type. */ @@ -262,7 +262,7 @@ public URL url() { /** * Whether arguments for this request should be included in the URL or in the body of the request. * - * @return true if the arguements should be sent in the body of the request. + * @return true if the arguments should be sent in the body of the request. */ @Override public boolean hasBody() { diff --git a/src/main/java/org/kohsuke/github/example/dataobject/ReadOnlyObjects.java b/src/main/java/org/kohsuke/github/example/dataobject/ReadOnlyObjects.java index cc1432085a..fb6a517fdf 100644 --- a/src/main/java/org/kohsuke/github/example/dataobject/ReadOnlyObjects.java +++ b/src/main/java/org/kohsuke/github/example/dataobject/ReadOnlyObjects.java @@ -94,7 +94,7 @@ public interface GHMetaExample { *

    *
  • Easy to create
  • *
  • Not much code
  • - *
  • Mininal annotations
  • + *
  • Minimal annotations
  • *
* Con: *
    @@ -373,7 +373,7 @@ void setImporter(List importer) { *
      *
    • Very Easy to create
    • *
    • Minimal code
    • - *
    • Mininal annotations
    • + *
    • Minimal annotations
    • *
    • Fields effectively final and lists unmodifiable
    • *
    * Con: diff --git a/src/main/java/org/kohsuke/github/extras/authorization/JWTTokenProvider.java b/src/main/java/org/kohsuke/github/extras/authorization/JWTTokenProvider.java index dc61cfd46c..11cda833b3 100644 --- a/src/main/java/org/kohsuke/github/extras/authorization/JWTTokenProvider.java +++ b/src/main/java/org/kohsuke/github/extras/authorization/JWTTokenProvider.java @@ -122,7 +122,7 @@ public String getEncodedAuthorization() throws IOException { *

    * Made internal for testing * - * @return false if the the token has been refreshed within the required window, otherwise true + * @return false if the token has been refreshed within the required window, otherwise true */ boolean isNotValid() { return Instant.now().isAfter(validUntil); diff --git a/src/main/java/org/kohsuke/github/internal/GitHubConnectorHttpConnectorAdapter.java b/src/main/java/org/kohsuke/github/internal/GitHubConnectorHttpConnectorAdapter.java index 01417e08dd..3dc0e9d7b0 100644 --- a/src/main/java/org/kohsuke/github/internal/GitHubConnectorHttpConnectorAdapter.java +++ b/src/main/java/org/kohsuke/github/internal/GitHubConnectorHttpConnectorAdapter.java @@ -83,7 +83,7 @@ public GitHubConnectorResponse send(GitHubConnectorRequest request) throws IOExc } // HttpUrlConnection is nuts. This call opens the connection and gets a response. - // Putting this on it's own line for ease of debugging if needed. + // Putting this on its own line for ease of debugging if needed. int statusCode = connection.getResponseCode(); Map> headers = connection.getHeaderFields(); From 61c1e43f175fe64dab1bb787033a10cb3f778836 Mon Sep 17 00:00:00 2001 From: James Harrison Date: Thu, 19 Jan 2023 23:43:48 +0000 Subject: [PATCH 29/51] Update link to GitHub conditional requests doc --- src/site/apt/index.apt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/site/apt/index.apt b/src/site/apt/index.apt index 2463ad1e16..4991e7caa4 100644 --- a/src/site/apt/index.apt +++ b/src/site/apt/index.apt @@ -142,7 +142,7 @@ Pluggable HTTP client through <<>>. In particular, this means you can use {{{https://square.github.io/okhttp/}OkHttp}}, so we can make use of it's HTTP response cache. Making a conditional request against the GitHub API and receiving a 304 response - {{{https://developer.github.com/v3/#conditional-requests}does not count against the rate limit}}. + {{{https://docs.github.com/en/rest/overview/resources-in-the-rest-api#conditional-requests}does not count against the rate limit}}. The following code shows an example of how to set up persistent cache on the disk: From 56027e5927bf8f27bf372bc4d8cb76823f38abdf Mon Sep 17 00:00:00 2001 From: Michael Grant Date: Mon, 23 Jan 2023 17:14:05 +0100 Subject: [PATCH 30/51] Issue 1597: Added CODEOWNERS file with a eliberate error to test response to repo.listCodeownersErrors(). --- .github/CODEOWNERS | 1 + 1 file changed, 1 insertion(+) create mode 100644 .github/CODEOWNERS diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000000..bd4518e6f0 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +@nonexistent-user # Deliberate error to test response to repo.listCodeownersErrors() \ No newline at end of file From b61209e0bdcdaa5c22dd7c1e6f922f853e517ffd Mon Sep 17 00:00:00 2001 From: Liam Newman Date: Wed, 25 Jan 2023 09:40:53 -0800 Subject: [PATCH 31/51] Fix formatting --- src/test/java/org/kohsuke/github/GHObjectTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/org/kohsuke/github/GHObjectTest.java b/src/test/java/org/kohsuke/github/GHObjectTest.java index 91f3b8a403..66388e55ee 100644 --- a/src/test/java/org/kohsuke/github/GHObjectTest.java +++ b/src/test/java/org/kohsuke/github/GHObjectTest.java @@ -29,7 +29,7 @@ public void test_toString() throws Exception { assertThat(org.toString(), containsString("type=Organization")); assertThat(org.toString(), containsString("followers=0")); assertThat(org.toString(), containsString("hireable=false")); - + // getResponseHeaderFields is deprecated but we should not break it. assertThat(org.getResponseHeaderFields(), notNullValue()); assertThat(org.getResponseHeaderFields().get("Cache-Control").get(0), is("private, max-age=60, s-maxage=60")); From b89f35f26789dc0f18d9c63a158487e43159e044 Mon Sep 17 00:00:00 2001 From: Liam Newman Date: Wed, 25 Jan 2023 09:41:52 -0800 Subject: [PATCH 32/51] Fix formatting --- src/main/java/org/kohsuke/github/GHCompare.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/kohsuke/github/GHCompare.java b/src/main/java/org/kohsuke/github/GHCompare.java index c4dd7cb32e..33678abfc6 100644 --- a/src/main/java/org/kohsuke/github/GHCompare.java +++ b/src/main/java/org/kohsuke/github/GHCompare.java @@ -224,8 +224,8 @@ GHCompare lateBind(GHRepository owner) { } /** - * Compare commits had a child commit element with additional details we want to capture. This extension of - * GHCommit provides that. + * Compare commits had a child commit element with additional details we want to capture. This extension of GHCommit + * provides that. */ @SuppressFBWarnings(value = { "UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD", "UWF_UNWRITTEN_FIELD" }, justification = "JSON API") From f19ad6d0e90890bef7f7417b25d5894c6ba8fac2 Mon Sep 17 00:00:00 2001 From: Liam Newman Date: Wed, 25 Jan 2023 10:15:56 -0800 Subject: [PATCH 33/51] Update WireMockRuleConfiguration.java --- .../github/junit/WireMockRuleConfiguration.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/test/java/org/kohsuke/github/junit/WireMockRuleConfiguration.java b/src/test/java/org/kohsuke/github/junit/WireMockRuleConfiguration.java index ee8f953130..1960061c04 100644 --- a/src/test/java/org/kohsuke/github/junit/WireMockRuleConfiguration.java +++ b/src/test/java/org/kohsuke/github/junit/WireMockRuleConfiguration.java @@ -411,4 +411,21 @@ public boolean getDisableStrictHttpHeaders() { return parent.getDisableStrictHttpHeaders(); } + /** + * Gets the data truncation settings. + * + * @return the data truncation settings + */ + public DataTruncationSettings getDataTruncationSettings() { + return parent.getDataTruncationSettings(); + } + + /** + * Gets the network address rules. + * + * @return the network address rules + */ + public NetworkAddressRules getProxyTargetRules() { + return parent.getProxyTargetRules(); + } } From 5b92c2091a71a755a6a5095c9fd6f3f54c3449b2 Mon Sep 17 00:00:00 2001 From: Liam Newman Date: Wed, 25 Jan 2023 10:21:26 -0800 Subject: [PATCH 34/51] Update WireMockRule.java --- .../java/org/kohsuke/github/junit/WireMockRule.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/test/java/org/kohsuke/github/junit/WireMockRule.java b/src/test/java/org/kohsuke/github/junit/WireMockRule.java index f65e4cf11a..ea99112bfe 100644 --- a/src/test/java/org/kohsuke/github/junit/WireMockRule.java +++ b/src/test/java/org/kohsuke/github/junit/WireMockRule.java @@ -613,6 +613,18 @@ public void resetScenarios() { wireMockServer.resetScenarios(); } + /** + * Set scenario state + * + * @param name + * the name + * @param state + * the state + */ + public void setScenarioState(String name, String state) { + wireMockServer.setScenarioState(name, state); + } + /** * Reset mappings. */ From 4f3131d4f9ad2e77ccdacf8628be2bc0730f3914 Mon Sep 17 00:00:00 2001 From: Liam Newman Date: Wed, 25 Jan 2023 10:26:10 -0800 Subject: [PATCH 35/51] Update WireMockRule.java --- .../kohsuke/github/junit/WireMockRule.java | 34 ++++++++++++------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/src/test/java/org/kohsuke/github/junit/WireMockRule.java b/src/test/java/org/kohsuke/github/junit/WireMockRule.java index ea99112bfe..6dabff16b2 100644 --- a/src/test/java/org/kohsuke/github/junit/WireMockRule.java +++ b/src/test/java/org/kohsuke/github/junit/WireMockRule.java @@ -613,18 +613,6 @@ public void resetScenarios() { wireMockServer.resetScenarios(); } - /** - * Set scenario state - * - * @param name - * the name - * @param state - * the state - */ - public void setScenarioState(String name, String state) { - wireMockServer.setScenarioState(name, state); - } - /** * Reset mappings. */ @@ -723,6 +711,28 @@ public GetScenariosResult getAllScenarios() { return wireMockServer.getAllScenarios(); } + /** + * Reset a scenario + * + * @param name + * the name + */ + public void resetScenario(String name) { + wireMockServer.resetScenario(name); + } + + /** + * Set scenario state + * + * @param name + * the name + * @param state + * the state + */ + public void setScenarioState(String name, String state) { + wireMockServer.setScenarioState(name, state); + } + /** * Find top near misses for. * From 9591e4d9e606c28af403f07e4bf63c28bcf62124 Mon Sep 17 00:00:00 2001 From: Liam Newman Date: Wed, 25 Jan 2023 10:32:05 -0800 Subject: [PATCH 36/51] Update WireMockRule.java --- .../java/org/kohsuke/github/junit/WireMockRule.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/test/java/org/kohsuke/github/junit/WireMockRule.java b/src/test/java/org/kohsuke/github/junit/WireMockRule.java index 6dabff16b2..b7e89a6cd4 100644 --- a/src/test/java/org/kohsuke/github/junit/WireMockRule.java +++ b/src/test/java/org/kohsuke/github/junit/WireMockRule.java @@ -527,6 +527,16 @@ public void editStubMapping(StubMapping stubMapping) { wireMockServer.editStubMapping(stubMapping); } + /** + * Removes the stub mapping. + * + * @param id + * the id + */ + public void removeStubMapping(UUID id) { + wireMockServer.removeStubMapping(id); + } + /** * List all stub mappings. * From 5369b156378ee7b38468357b615a37127807f72e Mon Sep 17 00:00:00 2001 From: Michael Grant Date: Fri, 27 Jan 2023 09:41:42 +0100 Subject: [PATCH 37/51] Bumped up version of `actions/setup-java` to v3 to avoid indirect use of deprecated GitHub action `set-output`, which will cease functioning altogether at the end of May. --- .github/workflows/maven.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 80d49123ce..af151ae320 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -10,7 +10,7 @@ jobs: steps: - uses: actions/checkout@v1 - name: Set up JDK 1.8 - uses: actions/setup-java@v1 + uses: actions/setup-java@v3 with: java-version: 1.8 - name: Maven Download all dependencies From 789fa22af917741cc7788bb5364bca8c1f40aed9 Mon Sep 17 00:00:00 2001 From: Michael Grant Date: Fri, 27 Jan 2023 09:52:35 +0100 Subject: [PATCH 38/51] Added missing arguments for v3 of `actions/setup-java`. --- .github/workflows/maven.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index af151ae320..8cee3b23da 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -12,7 +12,9 @@ jobs: - name: Set up JDK 1.8 uses: actions/setup-java@v3 with: - java-version: 1.8 + java-version: 8 + distribution: 'zulu' + cache: 'maven' - name: Maven Download all dependencies run: mvn -B org.apache.maven.plugins:maven-dependency-plugin:3.1.1:go-offline - name: Maven Build From ed9531edb8ee3c51439b45a072875e5f7d5ad5c8 Mon Sep 17 00:00:00 2001 From: Michael Grant Date: Fri, 27 Jan 2023 10:27:00 +0100 Subject: [PATCH 39/51] Redeleting maven.yml, which got accidentally added again whilst trying to solve a problem (the use of the deprecated `set-output`) seen in the logs from my previous run, but which I think was already solved through use of maven-build.yml. --- .github/workflows/maven.yml | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 .github/workflows/maven.yml diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml deleted file mode 100644 index 8cee3b23da..0000000000 --- a/.github/workflows/maven.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Java CI - -on: [push, pull_request] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v1 - - name: Set up JDK 1.8 - uses: actions/setup-java@v3 - with: - java-version: 8 - distribution: 'zulu' - cache: 'maven' - - name: Maven Download all dependencies - run: mvn -B org.apache.maven.plugins:maven-dependency-plugin:3.1.1:go-offline - - name: Maven Build - run: mvn -B package --file pom.xml -Dtest=GistTest,UserTest From 15e6f47c4642d2dc4372fc36bf1e4a04a924bbd7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Feb 2023 02:01:26 +0000 Subject: [PATCH 40/51] Chore(deps): Bump maven-project-info-reports-plugin from 3.4.1 to 3.4.2 Bumps [maven-project-info-reports-plugin](https://github.com/apache/maven-project-info-reports-plugin) from 3.4.1 to 3.4.2. - [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.4.1...maven-project-info-reports-plugin-3.4.2) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-project-info-reports-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 d4889d0b08..18cc810aba 100644 --- a/pom.xml +++ b/pom.xml @@ -278,7 +278,7 @@ org.apache.maven.plugins maven-project-info-reports-plugin - 3.4.1 + 3.4.2 org.apache.bcel From 9a084e8de80afa462ad2a96d16e5ee853bb2a954 Mon Sep 17 00:00:00 2001 From: Adrien Lecharpentier Date: Wed, 1 Feb 2023 15:04:09 +0100 Subject: [PATCH 41/51] Incorrect project version downgrade This was introduced in 30ff8e65b29e78c8f7fc8258ff7afd06b1ed08b6 and I believe it is a mistake --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d4889d0b08..3230acc6fb 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 org.kohsuke github-api - 1.312-SNAPSHOT + 1.314-SNAPSHOT GitHub API for Java https://github-api.kohsuke.org/ GitHub API for Java From 43e129a9050cbd550f0ac0a4fa06b304aefeb9e1 Mon Sep 17 00:00:00 2001 From: Adrien Lecharpentier Date: Wed, 1 Feb 2023 18:13:06 +0100 Subject: [PATCH 42/51] Validates filtering check runs with check_name --- .../org/kohsuke/github/GHRepositoryTest.java | 17 +++ .../__files/orgs_hub4j-1.json | 25 ++++ .../__files/repos_hub4j_github-api-2.json | 137 ++++++++++++++++++ ...9f3081417bfb6a1de30c55e4_check-runs-3.json | 105 ++++++++++++++ .../mappings/orgs_hub4j-1.json | 44 ++++++ .../mappings/repos_hub4j_github-api-2.json | 44 ++++++ ...9f3081417bfb6a1de30c55e4_check-runs-3.json | 46 ++++++ 7 files changed, 418 insertions(+) create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getCheckRunsWithParams/__files/orgs_hub4j-1.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getCheckRunsWithParams/__files/repos_hub4j_github-api-2.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getCheckRunsWithParams/__files/repos_hub4j_github-api_commits_54d60fbb53b4efa19f3081417bfb6a1de30c55e4_check-runs-3.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getCheckRunsWithParams/mappings/orgs_hub4j-1.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getCheckRunsWithParams/mappings/repos_hub4j_github-api-2.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getCheckRunsWithParams/mappings/repos_hub4j_github-api_commits_54d60fbb53b4efa19f3081417bfb6a1de30c55e4_check-runs-3.json diff --git a/src/test/java/org/kohsuke/github/GHRepositoryTest.java b/src/test/java/org/kohsuke/github/GHRepositoryTest.java index d85880250e..a5796d7a4c 100644 --- a/src/test/java/org/kohsuke/github/GHRepositoryTest.java +++ b/src/test/java/org/kohsuke/github/GHRepositoryTest.java @@ -1344,6 +1344,23 @@ public void getCheckRuns() throws Exception { } } + @Test + public void getCheckRunsWithParams() throws Exception { + final int expectedCount = 1; + // Use github-api repository as it has checks set up + PagedIterable checkRuns = gitHub.getOrganization("hub4j") + .getRepository("github-api") + .getCheckRuns("54d60fbb53b4efa19f3081417bfb6a1de30c55e4", Map.of("check_name", "build-only (Java 17)")); + + // Check if the checkruns are all succeeded and if we got all of them + int checkRunsCount = 0; + for (GHCheckRun checkRun : checkRuns) { + assertThat(checkRun.getConclusion(), equalTo(Conclusion.SUCCESS)); + checkRunsCount++; + } + assertThat(checkRunsCount, equalTo(expectedCount)); + } + /** * Gets the last commit status. * diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getCheckRunsWithParams/__files/orgs_hub4j-1.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getCheckRunsWithParams/__files/orgs_hub4j-1.json new file mode 100644 index 0000000000..7af7035707 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getCheckRunsWithParams/__files/orgs_hub4j-1.json @@ -0,0 +1,25 @@ +{ + "avatar_url": "https://avatars.githubusercontent.com/u/54909825?v=4", + "created_at": "2019-09-04T18:12:34Z", + "description": null, + "events_url": "https://api.github.com/orgs/hub4j/events", + "followers": 0, + "following": 0, + "has_organization_projects": true, + "has_repository_projects": true, + "hooks_url": "https://api.github.com/orgs/hub4j/hooks", + "html_url": "https://github.com/hub4j", + "id": 54909825, + "is_verified": false, + "issues_url": "https://api.github.com/orgs/hub4j/issues", + "login": "hub4j", + "members_url": "https://api.github.com/orgs/hub4j/members{/member}", + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU0OTA5ODI1", + "public_gists": 0, + "public_members_url": "https://api.github.com/orgs/hub4j/public_members{/member}", + "public_repos": 1, + "repos_url": "https://api.github.com/orgs/hub4j/repos", + "type": "Organization", + "updated_at": "2020-05-08T21:26:19Z", + "url": "https://api.github.com/orgs/hub4j" +} diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getCheckRunsWithParams/__files/repos_hub4j_github-api-2.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getCheckRunsWithParams/__files/repos_hub4j_github-api-2.json new file mode 100644 index 0000000000..eadccf842e --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getCheckRunsWithParams/__files/repos_hub4j_github-api-2.json @@ -0,0 +1,137 @@ +{ + "allow_forking": true, + "archive_url": "https://api.github.com/repos/hub4j/github-api/{archive_format}{/ref}", + "archived": false, + "assignees_url": "https://api.github.com/repos/hub4j/github-api/assignees{/user}", + "blobs_url": "https://api.github.com/repos/hub4j/github-api/git/blobs{/sha}", + "branches_url": "https://api.github.com/repos/hub4j/github-api/branches{/branch}", + "clone_url": "https://github.com/hub4j/github-api.git", + "collaborators_url": "https://api.github.com/repos/hub4j/github-api/collaborators{/collaborator}", + "comments_url": "https://api.github.com/repos/hub4j/github-api/comments{/number}", + "commits_url": "https://api.github.com/repos/hub4j/github-api/commits{/sha}", + "compare_url": "https://api.github.com/repos/hub4j/github-api/compare/{base}...{head}", + "contents_url": "https://api.github.com/repos/hub4j/github-api/contents/{+path}", + "contributors_url": "https://api.github.com/repos/hub4j/github-api/contributors", + "created_at": "2010-04-19T04:13:03Z", + "default_branch": "main", + "deployments_url": "https://api.github.com/repos/hub4j/github-api/deployments", + "description": "Java API for GitHub", + "disabled": false, + "downloads_url": "https://api.github.com/repos/hub4j/github-api/downloads", + "events_url": "https://api.github.com/repos/hub4j/github-api/events", + "fork": false, + "forks": 651, + "forks_count": 651, + "forks_url": "https://api.github.com/repos/hub4j/github-api/forks", + "full_name": "hub4j/github-api", + "git_commits_url": "https://api.github.com/repos/hub4j/github-api/git/commits{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j/github-api/git/refs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j/github-api/git/tags{/sha}", + "git_url": "git://github.com/hub4j/github-api.git", + "has_discussions": true, + "has_downloads": true, + "has_issues": true, + "has_pages": true, + "has_projects": true, + "has_wiki": true, + "homepage": "https://github-api.kohsuke.org/", + "hooks_url": "https://api.github.com/repos/hub4j/github-api/hooks", + "html_url": "https://github.com/hub4j/github-api", + "id": 617210, + "is_template": false, + "issue_comment_url": "https://api.github.com/repos/hub4j/github-api/issues/comments{/number}", + "issue_events_url": "https://api.github.com/repos/hub4j/github-api/issues/events{/number}", + "issues_url": "https://api.github.com/repos/hub4j/github-api/issues{/number}", + "keys_url": "https://api.github.com/repos/hub4j/github-api/keys{/key_id}", + "labels_url": "https://api.github.com/repos/hub4j/github-api/labels{/name}", + "language": "Java", + "languages_url": "https://api.github.com/repos/hub4j/github-api/languages", + "license": { + "key": "mit", + "name": "MIT License", + "node_id": "MDc6TGljZW5zZTEz", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit" + }, + "merges_url": "https://api.github.com/repos/hub4j/github-api/merges", + "milestones_url": "https://api.github.com/repos/hub4j/github-api/milestones{/number}", + "mirror_url": null, + "name": "github-api", + "network_count": 651, + "node_id": "MDEwOlJlcG9zaXRvcnk2MTcyMTA=", + "notifications_url": "https://api.github.com/repos/hub4j/github-api/notifications{?since,all,participating}", + "open_issues": 141, + "open_issues_count": 141, + "organization": { + "avatar_url": "https://avatars.githubusercontent.com/u/54909825?v=4", + "events_url": "https://api.github.com/users/hub4j/events{/privacy}", + "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}", + "gravatar_id": "", + "html_url": "https://github.com/hub4j", + "id": 54909825, + "login": "hub4j", + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU0OTA5ODI1", + "organizations_url": "https://api.github.com/users/hub4j/orgs", + "received_events_url": "https://api.github.com/users/hub4j/received_events", + "repos_url": "https://api.github.com/users/hub4j/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/hub4j/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j/subscriptions", + "type": "Organization", + "url": "https://api.github.com/users/hub4j" + }, + "owner": { + "avatar_url": "https://avatars.githubusercontent.com/u/54909825?v=4", + "events_url": "https://api.github.com/users/hub4j/events{/privacy}", + "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}", + "gravatar_id": "", + "html_url": "https://github.com/hub4j", + "id": 54909825, + "login": "hub4j", + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU0OTA5ODI1", + "organizations_url": "https://api.github.com/users/hub4j/orgs", + "received_events_url": "https://api.github.com/users/hub4j/received_events", + "repos_url": "https://api.github.com/users/hub4j/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/hub4j/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j/subscriptions", + "type": "Organization", + "url": "https://api.github.com/users/hub4j" + }, + "private": false, + "pulls_url": "https://api.github.com/repos/hub4j/github-api/pulls{/number}", + "pushed_at": "2023-02-01T14:18:09Z", + "releases_url": "https://api.github.com/repos/hub4j/github-api/releases{/id}", + "size": 40829, + "ssh_url": "git@github.com:hub4j/github-api.git", + "stargazers_count": 972, + "stargazers_url": "https://api.github.com/repos/hub4j/github-api/stargazers", + "statuses_url": "https://api.github.com/repos/hub4j/github-api/statuses/{sha}", + "subscribers_count": 48, + "subscribers_url": "https://api.github.com/repos/hub4j/github-api/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j/github-api/subscription", + "svn_url": "https://github.com/hub4j/github-api", + "tags_url": "https://api.github.com/repos/hub4j/github-api/tags", + "teams_url": "https://api.github.com/repos/hub4j/github-api/teams", + "temp_clone_token": null, + "topics": [ + "api", + "client-library", + "github", + "github-api", + "github-api-v3", + "java", + "java-api" + ], + "trees_url": "https://api.github.com/repos/hub4j/github-api/git/trees{/sha}", + "updated_at": "2023-01-30T18:28:31Z", + "url": "https://api.github.com/repos/hub4j/github-api", + "visibility": "public", + "watchers": 972, + "watchers_count": 972, + "web_commit_signoff_required": false +} diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getCheckRunsWithParams/__files/repos_hub4j_github-api_commits_54d60fbb53b4efa19f3081417bfb6a1de30c55e4_check-runs-3.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getCheckRunsWithParams/__files/repos_hub4j_github-api_commits_54d60fbb53b4efa19f3081417bfb6a1de30c55e4_check-runs-3.json new file mode 100644 index 0000000000..d65eef6cce --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getCheckRunsWithParams/__files/repos_hub4j_github-api_commits_54d60fbb53b4efa19f3081417bfb6a1de30c55e4_check-runs-3.json @@ -0,0 +1,105 @@ +{ + "total_count": 1, + "check_runs": [ + { + "id": 514982790, + "node_id": "MDg6Q2hlY2tSdW41MTQ5ODI3OTA=", + "head_sha": "78b9ff49d47daaa158eb373c4e2e040f739df8b9", + "external_id": "5b9ee24e-a4fa-5b0f-9fef-471905f84b41", + "url": "https://api.github.com/repos/hub4j/github-api/check-runs/514982790", + "html_url": "https://github.com/hub4j/github-api/runs/514982790", + "details_url": "https://github.com/hub4j/github-api/runs/514982790", + "status": "completed", + "conclusion": "success", + "started_at": "2020-03-17T21:37:30Z", + "completed_at": "2020-03-17T21:41:01Z", + "output": { + "title": null, + "summary": null, + "text": null, + "annotations_count": 0, + "annotations_url": "https://api.github.com/repos/hub4j/github-api/check-runs/514982790/annotations" + }, + "name": "build-only (Java 17)", + "check_suite": { + "id": 528275399 + }, + "app": { + "id": 15368, + "slug": "github-actions", + "node_id": "MDM6QXBwMTUzNjg=", + "owner": { + "login": "github", + "id": 9919, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjk5MTk=", + "avatar_url": "https://avatars1.githubusercontent.com/u/9919?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github", + "html_url": "https://github.com/github", + "followers_url": "https://api.github.com/users/github/followers", + "following_url": "https://api.github.com/users/github/following{/other_user}", + "gists_url": "https://api.github.com/users/github/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github/subscriptions", + "organizations_url": "https://api.github.com/users/github/orgs", + "repos_url": "https://api.github.com/users/github/repos", + "events_url": "https://api.github.com/users/github/events{/privacy}", + "received_events_url": "https://api.github.com/users/github/received_events", + "type": "Organization", + "site_admin": false + }, + "name": "GitHub Actions", + "description": "Automate your workflow from idea to production", + "external_url": "https://help.github.com/en/actions", + "html_url": "https://github.com/apps/github-actions", + "created_at": "2018-07-30T09:30:17Z", + "updated_at": "2019-12-10T19:04:12Z", + "permissions": { + "actions": "write", + "checks": "write", + "contents": "write", + "deployments": "write", + "issues": "write", + "metadata": "read", + "packages": "write", + "pages": "write", + "pull_requests": "write", + "repository_hooks": "write", + "repository_projects": "write", + "statuses": "write", + "vulnerability_alerts": "read" + }, + "events": [ + "check_run", + "check_suite", + "create", + "delete", + "deployment", + "deployment_status", + "fork", + "gollum", + "issues", + "issue_comment", + "label", + "milestone", + "page_build", + "project", + "project_card", + "project_column", + "public", + "pull_request", + "pull_request_review", + "pull_request_review_comment", + "push", + "registry_package", + "release", + "repository", + "repository_dispatch", + "status", + "watch" + ] + }, + "pull_requests": [] + } + ] +} diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getCheckRunsWithParams/mappings/orgs_hub4j-1.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getCheckRunsWithParams/mappings/orgs_hub4j-1.json new file mode 100644 index 0000000000..feb2a3c85d --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getCheckRunsWithParams/mappings/orgs_hub4j-1.json @@ -0,0 +1,44 @@ +{ + "id": "5d8b3f90-4fb5-4321-b979-b06127d19224", + "name": "orgs_hub4j", + "request": { + "url": "/orgs/hub4j", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "orgs_hub4j-1.json", + "headers": { + "Cache-Control": "public, max-age=60, s-maxage=60", + "Content-Security-Policy": "default-src 'none'", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 01 Feb 2023 14:50:02 GMT", + "ETag": "W/\"0f5afebb9a43d2439789b5ee913e4b91dd2ee711e15a942b5a85dc8d6ae18dc9\"", + "Last-Modified": "Fri, 08 May 2020 21:26:19 GMT", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Server": "GitHub.com", + "Status": "200 OK", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "Vary": [ + "Accept", + "Accept-Encoding, Accept, X-Requested-With" + ], + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "deny", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-GitHub-Request-Id": "CA71:D7EC:186E8A:18D72D:63DA7C19", + "X-RateLimit-Limit": "60", + "X-RateLimit-Remaining": "55", + "X-RateLimit-Reset": "1675263481", + "X-XSS-Protection": "0" + } + }, + "uuid": "5d8b3f90-4fb5-4321-b979-b06127d19224", + "persistent": true, + "insertionIndex": 1 +} diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getCheckRunsWithParams/mappings/repos_hub4j_github-api-2.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getCheckRunsWithParams/mappings/repos_hub4j_github-api-2.json new file mode 100644 index 0000000000..4389fe339e --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getCheckRunsWithParams/mappings/repos_hub4j_github-api-2.json @@ -0,0 +1,44 @@ +{ + "id": "71c75ce1-402c-4835-8841-f1707d28d88d", + "name": "repos_hub4j_github-api", + "request": { + "url": "/repos/hub4j/github-api", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j_github-api-2.json", + "headers": { + "Cache-Control": "public, max-age=60, s-maxage=60", + "Content-Security-Policy": "default-src 'none'", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 01 Feb 2023 15:27:59 GMT", + "ETag": "W/\"27c60bc0ab8216c908ac99475a2d77aa39d77e3cbdf04e98f52df98e20d7e7d2\"", + "Last-Modified": "Mon, 30 Jan 2023 18:28:31 GMT", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Server": "GitHub.com", + "Status": "200 OK", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "Vary": [ + "Accept", + "Accept-Encoding, Accept, X-Requested-With" + ], + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "deny", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-GitHub-Request-Id": "CDC0:D7EC:3FD768:40DB97:63DA84FF", + "X-RateLimit-Limit": "60", + "X-RateLimit-Remaining": "57", + "X-RateLimit-Reset": "1675267094", + "X-XSS-Protection": "0" + } + }, + "uuid": "71c75ce1-402c-4835-8841-f1707d28d88d", + "persistent": true, + "insertionIndex": 2 +} diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getCheckRunsWithParams/mappings/repos_hub4j_github-api_commits_54d60fbb53b4efa19f3081417bfb6a1de30c55e4_check-runs-3.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getCheckRunsWithParams/mappings/repos_hub4j_github-api_commits_54d60fbb53b4efa19f3081417bfb6a1de30c55e4_check-runs-3.json new file mode 100644 index 0000000000..0abd669562 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/getCheckRunsWithParams/mappings/repos_hub4j_github-api_commits_54d60fbb53b4efa19f3081417bfb6a1de30c55e4_check-runs-3.json @@ -0,0 +1,46 @@ +{ + "id": "6f217f80-e2fa-4a54-b6ab-b110055d776a", + "name": "repos_hub4j_github-api_commits_54d60fbb53b4efa19f3081417bfb6a1de30c55e4_check-runs", + "request": { + "url": "/repos/hub4j/github-api/commits/54d60fbb53b4efa19f3081417bfb6a1de30c55e4/check-runs?check_name=build-only+%28Java+17%29", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.antiope-preview+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j_github-api_commits_54d60fbb53b4efa19f3081417bfb6a1de30c55e4_check-runs-3.json", + "headers": { + "Cache-Control": "public, max-age=60, s-maxage=60", + "Content-Security-Policy": "default-src 'none'", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 01 Feb 2023 15:33:02 GMT", + "ETag": "W/\"76cd89479af94fc294b78ddf876c317b67b20fd89ba6543f5464caa19cf0aa75\"", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Server": "GitHub.com", + "Status": "200 OK", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "Vary": [ + "Accept", + "Accept-Encoding, Accept, X-Requested-With" + ], + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "deny", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-GitHub-Request-Id": "D57A:94E6:41F9B6:4310EC:63DA862D", + "X-RateLimit-Limit": "60", + "X-RateLimit-Remaining": "55", + "X-RateLimit-Reset": "1675267093", + "X-XSS-Protection": "0" + } + }, + "uuid": "6f217f80-e2fa-4a54-b6ab-b110055d776a", + "persistent": true, + "scenarioName": "scenario-1-repos-github-api-github-api-commits-54d60fbb53b4efa19f3081417bfb6a1de30c55e4-check-runs", + "requiredScenarioState": "Started", + "newScenarioState": "scenario-1-repos-github-api-github-api-commits-54d60fbb53b4efa19f3081417bfb6a1de30c55e4-check-runs-2", + "insertionIndex": 3 +} From bcf5b1e25a88d3c1b2dcc57ca9a41854eee005f6 Mon Sep 17 00:00:00 2001 From: Adrien Lecharpentier Date: Wed, 1 Feb 2023 18:15:57 +0100 Subject: [PATCH 43/51] Adds method to filter out check run --- src/main/java/org/kohsuke/github/GHRepository.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/org/kohsuke/github/GHRepository.java b/src/main/java/org/kohsuke/github/GHRepository.java index cd7fd62515..09ffe9981c 100644 --- a/src/main/java/org/kohsuke/github/GHRepository.java +++ b/src/main/java/org/kohsuke/github/GHRepository.java @@ -2210,6 +2210,16 @@ public PagedIterable getCheckRuns(String ref) throws IOException { return new GHCheckRunsIterable(this, request); } + @Preview(ANTIOPE) + public PagedIterable getCheckRuns(String ref, Map params) throws IOException { + GitHubRequest request = root().createRequest() + .withUrlPath(String.format("/repos/%s/%s/commits/%s/check-runs", getOwnerName(), name, ref)) + .with(params) + .withPreview(ANTIOPE) + .build(); + return new GHCheckRunsIterable(this, request); + } + /** * Creates a commit status. * From 6cb12e10e6e7e141a40dda557b8c07ac69a65053 Mon Sep 17 00:00:00 2001 From: Adrien Lecharpentier Date: Wed, 1 Feb 2023 18:37:32 +0100 Subject: [PATCH 44/51] Adds method javadoc --- src/main/java/org/kohsuke/github/GHRepository.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/org/kohsuke/github/GHRepository.java b/src/main/java/org/kohsuke/github/GHRepository.java index 09ffe9981c..1c246859c3 100644 --- a/src/main/java/org/kohsuke/github/GHRepository.java +++ b/src/main/java/org/kohsuke/github/GHRepository.java @@ -2210,6 +2210,16 @@ public PagedIterable getCheckRuns(String ref) throws IOException { return new GHCheckRunsIterable(this, request); } + /** + * Gets check runs for given ref which validate provided parameters + * + * @param ref the Git reference + * @param params a map of parameters to filter check runs + * @return check runs for the given ref + * @throws IOException the io exception + * @see List check runs + * for a specific ref + */ @Preview(ANTIOPE) public PagedIterable getCheckRuns(String ref, Map params) throws IOException { GitHubRequest request = root().createRequest() From 7d4097b77b28008ebd044ef874c09d43ffeed200 Mon Sep 17 00:00:00 2001 From: Adrien Lecharpentier Date: Wed, 1 Feb 2023 18:41:02 +0100 Subject: [PATCH 45/51] Fixes javadoc indentation --- src/main/java/org/kohsuke/github/GHRepository.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/kohsuke/github/GHRepository.java b/src/main/java/org/kohsuke/github/GHRepository.java index 1c246859c3..4e41822eb0 100644 --- a/src/main/java/org/kohsuke/github/GHRepository.java +++ b/src/main/java/org/kohsuke/github/GHRepository.java @@ -2213,10 +2213,13 @@ public PagedIterable getCheckRuns(String ref) throws IOException { /** * Gets check runs for given ref which validate provided parameters * - * @param ref the Git reference - * @param params a map of parameters to filter check runs + * @param ref + * the Git reference + * @param params + * a map of parameters to filter check runs * @return check runs for the given ref - * @throws IOException the io exception + * @throws IOException + * the io exception * @see List check runs * for a specific ref */ From 5d3bae79a2f26288789042e68b332b5bd58807b2 Mon Sep 17 00:00:00 2001 From: Adrien Lecharpentier Date: Wed, 1 Feb 2023 18:47:06 +0100 Subject: [PATCH 46/51] Removes Java 11 API in test --- src/test/java/org/kohsuke/github/GHRepositoryTest.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/test/java/org/kohsuke/github/GHRepositoryTest.java b/src/test/java/org/kohsuke/github/GHRepositoryTest.java index a5796d7a4c..73f5ea2ac3 100644 --- a/src/test/java/org/kohsuke/github/GHRepositoryTest.java +++ b/src/test/java/org/kohsuke/github/GHRepositoryTest.java @@ -1348,9 +1348,11 @@ public void getCheckRuns() throws Exception { public void getCheckRunsWithParams() throws Exception { final int expectedCount = 1; // Use github-api repository as it has checks set up + final Map params = new HashMap<>(1); + params.put("check_name", "build-only (Java 17)"); PagedIterable checkRuns = gitHub.getOrganization("hub4j") .getRepository("github-api") - .getCheckRuns("54d60fbb53b4efa19f3081417bfb6a1de30c55e4", Map.of("check_name", "build-only (Java 17)")); + .getCheckRuns("54d60fbb53b4efa19f3081417bfb6a1de30c55e4", params); // Check if the checkruns are all succeeded and if we got all of them int checkRunsCount = 0; From 98ba415e65eea2661b88bc59d82ce1431afbc0e8 Mon Sep 17 00:00:00 2001 From: Adrien Lecharpentier Date: Thu, 2 Feb 2023 10:22:16 +0100 Subject: [PATCH 47/51] Adds javadoc to unit-test --- src/test/java/org/kohsuke/github/GHRepositoryTest.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/java/org/kohsuke/github/GHRepositoryTest.java b/src/test/java/org/kohsuke/github/GHRepositoryTest.java index 73f5ea2ac3..4d923e3546 100644 --- a/src/test/java/org/kohsuke/github/GHRepositoryTest.java +++ b/src/test/java/org/kohsuke/github/GHRepositoryTest.java @@ -1344,6 +1344,12 @@ public void getCheckRuns() throws Exception { } } + /** + * Filter out the checks from a reference + * + * @throws Exception + * the exception + */ @Test public void getCheckRunsWithParams() throws Exception { final int expectedCount = 1; From 2b8fbfcbba87b5b13b7653a96ca5e353afbb1933 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 22 Feb 2023 08:19:49 +0000 Subject: [PATCH 48/51] Chore(deps-dev): Bump commons-fileupload from 1.4 to 1.5 Bumps commons-fileupload from 1.4 to 1.5. --- updated-dependencies: - dependency-name: commons-fileupload:commons-fileupload dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3230acc6fb..8e76adeff0 100644 --- a/pom.xml +++ b/pom.xml @@ -485,7 +485,7 @@ commons-fileupload commons-fileupload - 1.4 + 1.5 test From eb68bbb8a186ea08a132f111f85e603cfe881d10 Mon Sep 17 00:00:00 2001 From: Liam Newman Date: Sat, 25 Feb 2023 11:00:56 -0800 Subject: [PATCH 49/51] Delete CODEOWNERS --- .github/CODEOWNERS | 1 - 1 file changed, 1 deletion(-) delete mode 100644 .github/CODEOWNERS diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS deleted file mode 100644 index bd4518e6f0..0000000000 --- a/.github/CODEOWNERS +++ /dev/null @@ -1 +0,0 @@ -@nonexistent-user # Deliberate error to test response to repo.listCodeownersErrors() \ No newline at end of file From 204d521b403542164e7c494b611ceec464d6ec70 Mon Sep 17 00:00:00 2001 From: Liam Newman Date: Sat, 25 Feb 2023 11:03:12 -0800 Subject: [PATCH 50/51] Delete squashMerge --- squashMerge | 1 - 1 file changed, 1 deletion(-) delete mode 100644 squashMerge diff --git a/squashMerge b/squashMerge deleted file mode 100644 index 58a8e2e48d..0000000000 --- a/squashMerge +++ /dev/null @@ -1 +0,0 @@ -squashMerge \ No newline at end of file From dd1e68d87eddb59d1833f4af8cf2a17c6dd6d9d2 Mon Sep 17 00:00:00 2001 From: Liam Newman Date: Sat, 25 Feb 2023 11:03:55 -0800 Subject: [PATCH 51/51] Delete updateContentSquashMerge --- updateContentSquashMerge | 1 - 1 file changed, 1 deletion(-) delete mode 100644 updateContentSquashMerge diff --git a/updateContentSquashMerge b/updateContentSquashMerge deleted file mode 100644 index 58683e978f..0000000000 --- a/updateContentSquashMerge +++ /dev/null @@ -1 +0,0 @@ -updateContentSquashMergeupdateContentSquashMerge \ No newline at end of file