From 7a4383afed2a053d7e66c759f66ffa42d90e34ff Mon Sep 17 00:00:00 2001 From: Carroll Chiou Date: Tue, 19 Apr 2022 11:23:48 -0600 Subject: [PATCH 1/5] bump github-api to support new teams api --- pom.xml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 5f4fbbe90..9dbb0651f 100644 --- a/pom.xml +++ b/pom.xml @@ -39,7 +39,7 @@ org.jenkins-ci.plugins github-api - 1.122 + 1.303-400.v35c2d8258028 com.coravy.hudson.plugins.github @@ -118,7 +118,7 @@ io.jenkins.tools.bom bom-2.289.x - 1090.v0a_33df40457a_ + 1280.vd669827e38cd import pom @@ -127,6 +127,11 @@ commons-lang3 3.11 + + org.jenkins-ci.main + jenkins-test-harness + 1706.v5257fc59612a_ + From abc46741360301d3c6b55a1873584fb1fb2575ea Mon Sep 17 00:00:00 2001 From: James Nord Date: Fri, 6 May 2022 17:26:10 +0100 Subject: [PATCH 2/5] change URls to reflect noew location for team information. --- .../body-orgs-cloudbeers-teams-justice-league-AHFpl.json | 6 +++--- .../mapping-body-orgs-cloudbeers-teams-repo-gOYDg.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/test/resources/api/__files/body-orgs-cloudbeers-teams-justice-league-AHFpl.json b/src/test/resources/api/__files/body-orgs-cloudbeers-teams-justice-league-AHFpl.json index 1210d64ac..382599917 100644 --- a/src/test/resources/api/__files/body-orgs-cloudbeers-teams-justice-league-AHFpl.json +++ b/src/test/resources/api/__files/body-orgs-cloudbeers-teams-justice-league-AHFpl.json @@ -1,13 +1,13 @@ { "id": 1, "node_id": "MDQ6VGVhbTE=", - "url": "https://api.github.com/teams/1", + "url": "https://api.github.com/organizations/4181899/team/1/", "name": "Justice League", "slug": "justice-league", "description": "A great team.", "privacy": "closed", "permission": "admin", - "members_url": "https://api.github.com/teams/1/members{/member}", - "repositories_url": "https://api.github.com/teams/1/repos", + "members_url": "https://api.github.com/organizations/4181899/team/1/members{/member}", + "repositories_url": "https://api.github.com/organizations/4181899/teams/1/repos", "parent": null } \ No newline at end of file diff --git a/src/test/resources/api/mappings/mapping-body-orgs-cloudbeers-teams-repo-gOYDg.json b/src/test/resources/api/mappings/mapping-body-orgs-cloudbeers-teams-repo-gOYDg.json index fa6d8724b..197212504 100644 --- a/src/test/resources/api/mappings/mapping-body-orgs-cloudbeers-teams-repo-gOYDg.json +++ b/src/test/resources/api/mappings/mapping-body-orgs-cloudbeers-teams-repo-gOYDg.json @@ -1,6 +1,6 @@ { "request" : { - "url" : "/teams/1/repos?per_page=100", + "url" : "/organizations/4181899/team/1/repos?per_page=100", "method" : "GET" }, "response" : { From 566b27a00091ffc0458d51b668a8ab1dd61e79da Mon Sep 17 00:00:00 2001 From: James Nord Date: Fri, 6 May 2022 18:49:12 +0100 Subject: [PATCH 3/5] base API no longer includes the removed team_url --- src/test/resources/api/__files/body-(root)-XwEI7.json | 1 - 1 file changed, 1 deletion(-) diff --git a/src/test/resources/api/__files/body-(root)-XwEI7.json b/src/test/resources/api/__files/body-(root)-XwEI7.json index ede3be6a3..23a43dd77 100644 --- a/src/test/resources/api/__files/body-(root)-XwEI7.json +++ b/src/test/resources/api/__files/body-(root)-XwEI7.json @@ -24,7 +24,6 @@ "current_user_repositories_url": "https://api.github.com/user/repos{?type,page,per_page,sort}", "starred_url": "https://api.github.com/user/starred{/owner}{/repo}", "starred_gists_url": "https://api.github.com/gists/starred", - "team_url": "https://api.github.com/teams", "user_url": "https://api.github.com/users/{user}", "user_organizations_url": "https://api.github.com/user/orgs", "user_repositories_url": "https://api.github.com/users/{user}/repos{?type,page,per_page,sort}", From 0d690adaa430458205c0b45c11880cf2bca779f8 Mon Sep 17 00:00:00 2001 From: James Nord Date: Fri, 6 May 2022 18:58:56 +0100 Subject: [PATCH 4/5] Fix GitHubSCMFileSystemTest which was failing with GitHubConnnector did not automatically follow redirect. The wiremock stub data looked wrong and I could not see a reason that this was using a 301 redirect 1) it was not supplying a Location header -> so there was no location that the user agent should go - which is incorrect 2) the body has all the data 3) looking at the api for example https://api.github.com/repos/jenkinsci/jenkins/contents/?ref=b9fcd2ae02752e7a74e9ca4886e490e435a1ff03 did not show any redirect but a HTTP 200... --- .../resources/api/mappings/mapping-contents-fu-nMBRw.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/resources/api/mappings/mapping-contents-fu-nMBRw.json b/src/test/resources/api/mappings/mapping-contents-fu-nMBRw.json index c200d65d2..ccbc6119f 100644 --- a/src/test/resources/api/mappings/mapping-contents-fu-nMBRw.json +++ b/src/test/resources/api/mappings/mapping-contents-fu-nMBRw.json @@ -6,13 +6,13 @@ "method" : "GET" }, "response" : { - "status" : 301, + "status" : 200, "bodyFileName" : "body-contents-fu-nMBRw.json", "headers" : { "Date" : "Wed, 24 Apr 2019 07:12:07 GMT", "Content-Type" : "application/json; charset=utf-8", "Server" : "GitHub.com", - "Status" : "301 Moved Permanently", + "Status" : "200 OK", "X-RateLimit-Limit" : "60", "X-RateLimit-Remaining" : "59", "X-RateLimit-Reset" : "1556093527", @@ -29,4 +29,4 @@ "X-GitHub-Request-Id" : "C1B8:23BE:6A64B8:8175F2:5CC00C46" } } -} \ No newline at end of file +} From 03d36c31aec34cc94dbedac28cf8c7cccffdcc25 Mon Sep 17 00:00:00 2001 From: James Nord Date: Fri, 6 May 2022 19:14:23 +0100 Subject: [PATCH 5/5] move jtn override to a property --- pom.xml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 9dbb0651f..a785b4ef9 100644 --- a/pom.xml +++ b/pom.xml @@ -27,6 +27,8 @@ 8 2.323 true + + 1706.v5257fc59612a_ @@ -127,11 +129,6 @@ commons-lang3 3.11 - - org.jenkins-ci.main - jenkins-test-harness - 1706.v5257fc59612a_ -