Skip to content

Commit

Permalink
Remove owner validation in fork builder tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Alaurant committed Dec 13, 2024
1 parent aceb784 commit 8a8d235
Show file tree
Hide file tree
Showing 46 changed files with 233 additions and 604 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,10 @@ public void setUp() throws Exception {
}
}

private void verifyBasicForkProperties(GHRepository original,
GHRepository forked,
String expectedOwner,
String expectedName) throws IOException {
private void verifyBasicForkProperties(GHRepository original, GHRepository forked, String expectedName)
throws IOException {
assertThat(forked, notNullValue());
assertThat(forked.getName(), equalTo(expectedName));
assertThat(forked.getOwner().getLogin(), equalTo(expectedOwner));
assertThat(forked.isFork(), is(true));
assertThat(forked.getParent().getFullName(), equalTo(original.getFullName()));
}
Expand Down Expand Up @@ -71,7 +68,7 @@ public void testFork() throws Exception {
GHRepository forkedRepo = repo.fork();

Thread.sleep(30000);
verifyBasicForkProperties(repo, forkedRepo, gitHub.getMyself().getLogin(), repo.getName());
verifyBasicForkProperties(repo, forkedRepo, repo.getName());
verifyBranches(repo, forkedRepo, false);

forkedRepo.delete();
Expand All @@ -90,7 +87,7 @@ public void testForkToOrg() throws Exception {
GHRepository forkedRepo = repo.forkTo(targetOrg);

Thread.sleep(30000);
verifyBasicForkProperties(repo, forkedRepo, targetOrg.getLogin(), repo.getName());
verifyBasicForkProperties(repo, forkedRepo, repo.getName());
verifyBranches(repo, forkedRepo, false);

forkedRepo.delete();
Expand All @@ -107,7 +104,7 @@ public void testForkDefaultBranchOnly() throws Exception {
GHRepository forkedRepo = repo.createFork().defaultBranchOnly(true).create();

Thread.sleep(30000);
verifyBasicForkProperties(repo, forkedRepo, gitHub.getMyself().getLogin(), repo.getName());
verifyBasicForkProperties(repo, forkedRepo, repo.getName());
verifyBranches(repo, forkedRepo, true);

forkedRepo.delete();
Expand All @@ -126,7 +123,7 @@ public void testForkChangedName() throws Exception {

Thread.sleep(30000);
assertThat(forkedRepo.getName(), equalTo(newRepoName));
verifyBasicForkProperties(repo, forkedRepo, gitHub.getMyself().getLogin(), newRepoName);
verifyBasicForkProperties(repo, forkedRepo, newRepoName);
verifyBranches(repo, forkedRepo, false);

forkedRepo.delete();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": 902813637,
"node_id": "R_kgDONc_XxQ",
"id": 902850532,
"node_id": "R_kgDONdBn5A",
"name": "test-repo",
"full_name": "Alaurant/test-repo",
"private": false,
Expand Down Expand Up @@ -65,8 +65,8 @@
"labels_url": "https://api.github.com/repos/Alaurant/test-repo/labels{/name}",
"releases_url": "https://api.github.com/repos/Alaurant/test-repo/releases{/id}",
"deployments_url": "https://api.github.com/repos/Alaurant/test-repo/deployments",
"created_at": "2024-12-13T10:18:15Z",
"updated_at": "2024-12-13T10:18:15Z",
"created_at": "2024-12-13T11:56:06Z",
"updated_at": "2024-12-13T11:56:06Z",
"pushed_at": "2024-12-13T09:48:04Z",
"git_url": "git://github.com/Alaurant/test-repo.git",
"ssh_url": "git@github.com:Alaurant/test-repo.git",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": 902813637,
"node_id": "R_kgDONc_XxQ",
"id": 902850532,
"node_id": "R_kgDONdBn5A",
"name": "test-repo",
"full_name": "Alaurant/test-repo",
"private": false,
Expand Down Expand Up @@ -65,8 +65,8 @@
"labels_url": "https://api.github.com/repos/Alaurant/test-repo/labels{/name}",
"releases_url": "https://api.github.com/repos/Alaurant/test-repo/releases{/id}",
"deployments_url": "https://api.github.com/repos/Alaurant/test-repo/deployments",
"created_at": "2024-12-13T10:18:15Z",
"updated_at": "2024-12-13T10:18:15Z",
"created_at": "2024-12-13T11:56:06Z",
"updated_at": "2024-12-13T11:56:06Z",
"pushed_at": "2024-12-13T09:48:04Z",
"git_url": "git://github.com/Alaurant/test-repo.git",
"ssh_url": "git@github.com:Alaurant/test-repo.git",
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"id": "27ba4f4c-a668-42eb-8ec3-94887ac71aa7",
"id": "06589360-6c74-44c7-ac3c-14a96d4ae30b",
"name": "user",
"request": {
"url": "/user",
Expand All @@ -14,7 +14,7 @@
"status": 200,
"bodyFileName": "1-user.json",
"headers": {
"Date": "Fri, 13 Dec 2024 10:18:14 GMT",
"Date": "Fri, 13 Dec 2024 11:56:04 GMT",
"Content-Type": "application/json; charset=utf-8",
"Cache-Control": "private, max-age=60, s-maxage=60",
"Vary": "Accept, Authorization, Cookie, X-GitHub-OTP,Accept-Encoding, Accept, X-Requested-With",
Expand All @@ -26,9 +26,9 @@
"X-GitHub-Media-Type": "github.v3; format=json",
"x-github-api-version-selected": "2022-11-28",
"X-RateLimit-Limit": "5000",
"X-RateLimit-Remaining": "4916",
"X-RateLimit-Reset": "1734087596",
"X-RateLimit-Used": "84",
"X-RateLimit-Remaining": "4984",
"X-RateLimit-Reset": "1734094496",
"X-RateLimit-Used": "16",
"X-RateLimit-Resource": "core",
"Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset",
"Access-Control-Allow-Origin": "*",
Expand All @@ -39,10 +39,10 @@
"Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin",
"Content-Security-Policy": "default-src 'none'",
"Server": "github.com",
"X-GitHub-Request-Id": "18E1:3E0BF5:4D7C4A:5945A8:675C09E5"
"X-GitHub-Request-Id": "195C:3E0BF5:5570DC:6294A2:675C20D4"
}
},
"uuid": "27ba4f4c-a668-42eb-8ec3-94887ac71aa7",
"uuid": "06589360-6c74-44c7-ac3c-14a96d4ae30b",
"persistent": true,
"insertionIndex": 1
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"id": "f003626a-56bc-4d1c-b8c0-818630b9321a",
"id": "48185584-35c8-4fa5-82bf-ddaf615cf68a",
"name": "repos_testditto_test-repo",
"request": {
"url": "/repos/TestDitto/test-repo",
Expand All @@ -14,7 +14,7 @@
"status": 200,
"bodyFileName": "2-r_t_test-repo.json",
"headers": {
"Date": "Fri, 13 Dec 2024 10:18:14 GMT",
"Date": "Fri, 13 Dec 2024 11:56:05 GMT",
"Content-Type": "application/json; charset=utf-8",
"Cache-Control": "private, max-age=60, s-maxage=60",
"Vary": "Accept, Authorization, Cookie, X-GitHub-OTP,Accept-Encoding, Accept, X-Requested-With",
Expand All @@ -26,9 +26,9 @@
"X-GitHub-Media-Type": "github.v3; format=json",
"x-github-api-version-selected": "2022-11-28",
"X-RateLimit-Limit": "5000",
"X-RateLimit-Remaining": "4914",
"X-RateLimit-Reset": "1734087596",
"X-RateLimit-Used": "86",
"X-RateLimit-Remaining": "4982",
"X-RateLimit-Reset": "1734094496",
"X-RateLimit-Used": "18",
"X-RateLimit-Resource": "core",
"Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset",
"Access-Control-Allow-Origin": "*",
Expand All @@ -39,10 +39,10 @@
"Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin",
"Content-Security-Policy": "default-src 'none'",
"Server": "github.com",
"X-GitHub-Request-Id": "18E6:3DD5DB:4DF226:59BBCA:675C09E6"
"X-GitHub-Request-Id": "1961:3DD5DB:54EC2E:62103C:675C20D5"
}
},
"uuid": "f003626a-56bc-4d1c-b8c0-818630b9321a",
"uuid": "48185584-35c8-4fa5-82bf-ddaf615cf68a",
"persistent": true,
"insertionIndex": 2
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"id": "4797c06a-f47e-4d25-bc6a-936f90c631b1",
"id": "7a595a08-9965-4a84-95eb-012484f1c5c4",
"name": "repos_testditto_test-repo_forks",
"request": {
"url": "/repos/TestDitto/test-repo/forks",
Expand All @@ -21,17 +21,17 @@
"status": 202,
"bodyFileName": "3-r_t_t_forks.json",
"headers": {
"Date": "Fri, 13 Dec 2024 10:18:15 GMT",
"Date": "Fri, 13 Dec 2024 11:56:06 GMT",
"Content-Type": "application/json; charset=utf-8",
"X-OAuth-Scopes": "admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, admin:ssh_signing_key, audit_log, codespace, delete:packages, delete_repo, gist, project, read:packages, repo, user, workflow, write:discussion",
"X-Accepted-OAuth-Scopes": "",
"github-authentication-token-expiration": "2025-02-25 04:28:56 UTC",
"X-GitHub-Media-Type": "github.v3; format=json",
"x-github-api-version-selected": "2022-11-28",
"X-RateLimit-Limit": "5000",
"X-RateLimit-Remaining": "4913",
"X-RateLimit-Reset": "1734087596",
"X-RateLimit-Used": "87",
"X-RateLimit-Remaining": "4981",
"X-RateLimit-Reset": "1734094496",
"X-RateLimit-Used": "19",
"X-RateLimit-Resource": "core",
"Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset",
"Access-Control-Allow-Origin": "*",
Expand All @@ -43,10 +43,10 @@
"Content-Security-Policy": "default-src 'none'",
"Vary": "Accept-Encoding, Accept, X-Requested-With",
"Server": "github.com",
"X-GitHub-Request-Id": "189B:3DD5DB:4DF24B:59BBF7:675C09E7"
"X-GitHub-Request-Id": "1962:3D576D:55A7CF:62CC05:675C20D6"
}
},
"uuid": "4797c06a-f47e-4d25-bc6a-936f90c631b1",
"uuid": "7a595a08-9965-4a84-95eb-012484f1c5c4",
"persistent": true,
"insertionIndex": 3
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"id": "dc5d9cb5-115e-4bd9-aa8b-e157eb9fd8db",
"id": "9e453181-3202-4b19-9415-cb611da62671",
"name": "repos_alaurant_test-repo",
"request": {
"url": "/repos/Alaurant/test-repo",
Expand All @@ -14,21 +14,21 @@
"status": 200,
"bodyFileName": "4-r_a_test-repo.json",
"headers": {
"Date": "Fri, 13 Dec 2024 10:18:16 GMT",
"Date": "Fri, 13 Dec 2024 11:56:07 GMT",
"Content-Type": "application/json; charset=utf-8",
"Cache-Control": "private, max-age=60, s-maxage=60",
"Vary": "Accept, Authorization, Cookie, X-GitHub-OTP,Accept-Encoding, Accept, X-Requested-With",
"ETag": "W/\"d9b0ababa6c0fbdd5fc5f324b724788df8f9f5653908392160bb90bb20a9001e\"",
"Last-Modified": "Fri, 13 Dec 2024 10:18:15 GMT",
"ETag": "W/\"af24d481e85061c77033ee5956e5906610aa4e42bda0594ccf2ee93fa0ad180a\"",
"Last-Modified": "Fri, 13 Dec 2024 11:56:06 GMT",
"X-OAuth-Scopes": "admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, admin:ssh_signing_key, audit_log, codespace, delete:packages, delete_repo, gist, project, read:packages, repo, user, workflow, write:discussion",
"X-Accepted-OAuth-Scopes": "repo",
"github-authentication-token-expiration": "2025-02-25 04:28:56 UTC",
"X-GitHub-Media-Type": "github.v3; format=json",
"x-github-api-version-selected": "2022-11-28",
"X-RateLimit-Limit": "5000",
"X-RateLimit-Remaining": "4912",
"X-RateLimit-Reset": "1734087596",
"X-RateLimit-Used": "88",
"X-RateLimit-Remaining": "4980",
"X-RateLimit-Reset": "1734094496",
"X-RateLimit-Used": "20",
"X-RateLimit-Resource": "core",
"Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset",
"Access-Control-Allow-Origin": "*",
Expand All @@ -39,10 +39,10 @@
"Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin",
"Content-Security-Policy": "default-src 'none'",
"Server": "github.com",
"X-GitHub-Request-Id": "18EB:3DC041:4B0DB5:56D728:675C09E8"
"X-GitHub-Request-Id": "1967:209B7:B10F0:D315C:675C20D7"
}
},
"uuid": "dc5d9cb5-115e-4bd9-aa8b-e157eb9fd8db",
"uuid": "9e453181-3202-4b19-9415-cb611da62671",
"persistent": true,
"insertionIndex": 4
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"id": "2bf60310-82c8-4a83-9af0-9282058b8b2d",
"id": "658eb013-6ac8-47c3-ad8a-ce1eadd3771d",
"name": "repos_alaurant_test-repo_branches",
"request": {
"url": "/repos/Alaurant/test-repo/branches",
Expand All @@ -12,9 +12,9 @@
},
"response": {
"status": 200,
"bodyFileName": "6-r_a_t_branches.json",
"bodyFileName": "5-r_a_t_branches.json",
"headers": {
"Date": "Fri, 13 Dec 2024 10:18:47 GMT",
"Date": "Fri, 13 Dec 2024 11:56:37 GMT",
"Content-Type": "application/json; charset=utf-8",
"Cache-Control": "private, max-age=60, s-maxage=60",
"Vary": "Accept, Authorization, Cookie, X-GitHub-OTP,Accept-Encoding, Accept, X-Requested-With",
Expand All @@ -25,9 +25,9 @@
"X-GitHub-Media-Type": "github.v3; format=json",
"x-github-api-version-selected": "2022-11-28",
"X-RateLimit-Limit": "5000",
"X-RateLimit-Remaining": "4910",
"X-RateLimit-Reset": "1734087596",
"X-RateLimit-Used": "90",
"X-RateLimit-Remaining": "4979",
"X-RateLimit-Reset": "1734094496",
"X-RateLimit-Used": "21",
"X-RateLimit-Resource": "core",
"Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset",
"Access-Control-Allow-Origin": "*",
Expand All @@ -38,10 +38,10 @@
"Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin",
"Content-Security-Policy": "default-src 'none'",
"Server": "github.com",
"X-GitHub-Request-Id": "193D:0A8D:32930A:3AA5C0:675C0A07"
"X-GitHub-Request-Id": "19B6:3E0BF5:557BA4:62A154:675C20F5"
}
},
"uuid": "2bf60310-82c8-4a83-9af0-9282058b8b2d",
"uuid": "658eb013-6ac8-47c3-ad8a-ce1eadd3771d",
"persistent": true,
"insertionIndex": 6
"insertionIndex": 5
}
Loading

0 comments on commit 8a8d235

Please sign in to comment.