diff --git a/server/forge/bitbucket/fixtures/handler.go b/server/forge/bitbucket/fixtures/handler.go index d92d0e500d..ce95e7409f 100644 --- a/server/forge/bitbucket/fixtures/handler.go +++ b/server/forge/bitbucket/fixtures/handler.go @@ -230,162 +230,162 @@ const tokenNotFoundPayload = ` const repoPayload = ` { - "full_name": "test_name/repo_name", - "scm": "git", - "is_private": true + "full_name": "test_name/repo_name", + "scm": "git", + "is_private": true } ` const permissionRepoPayload = ` { - "full_name": "test_name/%s", - "scm": "git", - "is_private": true + "full_name": "test_name/%s", + "scm": "git", + "is_private": true } ` const repoPayloadFromHook = ` { - "type": "repository", - "full_name": "martinherren1984/publictestrepo", - "links": { - "self": { - "href": "https://api.bitbucket.org/2.0/repositories/martinherren1984/publictestrepo" - }, - "html": { - "href": "https://bitbucket.org/martinherren1984/publictestrepo" - }, - "avatar": { - "href": "https://bytebucket.org/ravatar/%7B898477b2-a080-4089-b385-597a783db392%7D?ts=default" - }, - "pullrequests": { - "href": "https://api.bitbucket.org/2.0/repositories/martinherren1984/publictestrepo/pullrequests" - }, - "commits": { - "href": "https://api.bitbucket.org/2.0/repositories/martinherren1984/publictestrepo/commits" - }, - "forks": { - "href": "https://api.bitbucket.org/2.0/repositories/martinherren1984/publictestrepo/forks" - }, - "watchers": { - "href": "https://api.bitbucket.org/2.0/repositories/martinherren1984/publictestrepo/watchers" - }, - "branches": { - "href": "https://api.bitbucket.org/2.0/repositories/martinherren1984/publictestrepo/refs/branches" - }, - "tags": { - "href": "https://api.bitbucket.org/2.0/repositories/martinherren1984/publictestrepo/refs/tags" - }, - "downloads": { - "href": "https://api.bitbucket.org/2.0/repositories/martinherren1984/publictestrepo/downloads" - }, - "source": { - "href": "https://api.bitbucket.org/2.0/repositories/martinherren1984/publictestrepo/src" - }, - "clone": [ - { - "name": "https", - "href": "https://bitbucket.org/martinherren1984/publictestrepo.git" - }, - { - "name": "ssh", - "href": "git@bitbucket.org:martinherren1984/publictestrepo.git" - } - ], - "hooks": { - "href": "https://api.bitbucket.org/2.0/repositories/martinherren1984/publictestrepo/hooks" - } - }, - "name": "PublicTestRepo", - "slug": "publictestrepo", - "description": "", - "scm": "git", - "website": null, - "owner": { - "display_name": "Martin Herren", - "links": { - "self": { - "href": "https://api.bitbucket.org/2.0/users/%7Bc5a0d676-fd27-4bd4-ac69-a7540d7b495b%7D" - }, - "avatar": { - "href": "https://secure.gravatar.com/avatar/37de364488b2ec474b5458ca86442bbb?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FMH-2.png" - }, - "html": { - "href": "https://bitbucket.org/%7Bc5a0d676-fd27-4bd4-ac69-a7540d7b495b%7D/" - } - }, - "type": "user", - "uuid": "{c5a0d676-fd27-4bd4-ac69-a7540d7b495b}", - "account_id": "5cf8e3a9678ca90f8e7cc8a8", - "nickname": "Martin Herren" - }, - "workspace": { - "type": "workspace", - "uuid": "{c5a0d676-fd27-4bd4-ac69-a7540d7b495b}", - "name": "Martin Herren", - "slug": "martinherren1984", - "links": { - "avatar": { - "href": "https://bitbucket.org/workspaces/martinherren1984/avatar/?ts=1658761964" - }, - "html": { - "href": "https://bitbucket.org/martinherren1984/" - }, - "self": { - "href": "https://api.bitbucket.org/2.0/workspaces/martinherren1984" - } - } - }, - "is_private": false, - "project": { - "type": "project", - "key": "PUB", - "uuid": "{2cede481-f59e-49ec-88d0-a85629b7925d}", - "name": "PublicTestProject", - "links": { - "self": { - "href": "https://api.bitbucket.org/2.0/workspaces/martinherren1984/projects/PUB" - }, - "html": { - "href": "https://bitbucket.org/martinherren1984/workspace/projects/PUB" - }, - "avatar": { - "href": "https://bitbucket.org/martinherren1984/workspace/projects/PUB/avatar/32?ts=1658768453" - } - } - }, - "fork_policy": "allow_forks", - "created_on": "2022-07-25T17:01:20.950706+00:00", - "updated_on": "2022-09-07T20:19:30.622886+00:00", - "size": 85955, - "language": "", - "uuid": "{898477b2-a080-4089-b385-597a783db392}", - "mainbranch": { - "name": "master", - "type": "branch" - }, - "override_settings": { - "default_merge_strategy": true, - "branching_model": true - }, - "parent": null, - "enforced_signed_commits": null, - "has_issues": false, - "has_wiki": false + "type": "repository", + "full_name": "martinherren1984/publictestrepo", + "links": { + "self": { + "href": "https://api.bitbucket.org/2.0/repositories/martinherren1984/publictestrepo" + }, + "html": { + "href": "https://bitbucket.org/martinherren1984/publictestrepo" + }, + "avatar": { + "href": "https://bytebucket.org/ravatar/%7B898477b2-a080-4089-b385-597a783db392%7D?ts=default" + }, + "pullrequests": { + "href": "https://api.bitbucket.org/2.0/repositories/martinherren1984/publictestrepo/pullrequests" + }, + "commits": { + "href": "https://api.bitbucket.org/2.0/repositories/martinherren1984/publictestrepo/commits" + }, + "forks": { + "href": "https://api.bitbucket.org/2.0/repositories/martinherren1984/publictestrepo/forks" + }, + "watchers": { + "href": "https://api.bitbucket.org/2.0/repositories/martinherren1984/publictestrepo/watchers" + }, + "branches": { + "href": "https://api.bitbucket.org/2.0/repositories/martinherren1984/publictestrepo/refs/branches" + }, + "tags": { + "href": "https://api.bitbucket.org/2.0/repositories/martinherren1984/publictestrepo/refs/tags" + }, + "downloads": { + "href": "https://api.bitbucket.org/2.0/repositories/martinherren1984/publictestrepo/downloads" + }, + "source": { + "href": "https://api.bitbucket.org/2.0/repositories/martinherren1984/publictestrepo/src" + }, + "clone": [ + { + "name": "https", + "href": "https://bitbucket.org/martinherren1984/publictestrepo.git" + }, + { + "name": "ssh", + "href": "git@bitbucket.org:martinherren1984/publictestrepo.git" + } + ], + "hooks": { + "href": "https://api.bitbucket.org/2.0/repositories/martinherren1984/publictestrepo/hooks" + } + }, + "name": "PublicTestRepo", + "slug": "publictestrepo", + "description": "", + "scm": "git", + "website": null, + "owner": { + "display_name": "Martin Herren", + "links": { + "self": { + "href": "https://api.bitbucket.org/2.0/users/%7Bc5a0d676-fd27-4bd4-ac69-a7540d7b495b%7D" + }, + "avatar": { + "href": "https://secure.gravatar.com/avatar/37de364488b2ec474b5458ca86442bbb?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FMH-2.png" + }, + "html": { + "href": "https://bitbucket.org/%7Bc5a0d676-fd27-4bd4-ac69-a7540d7b495b%7D/" + } + }, + "type": "user", + "uuid": "{c5a0d676-fd27-4bd4-ac69-a7540d7b495b}", + "account_id": "5cf8e3a9678ca90f8e7cc8a8", + "nickname": "Martin Herren" + }, + "workspace": { + "type": "workspace", + "uuid": "{c5a0d676-fd27-4bd4-ac69-a7540d7b495b}", + "name": "Martin Herren", + "slug": "martinherren1984", + "links": { + "avatar": { + "href": "https://bitbucket.org/workspaces/martinherren1984/avatar/?ts=1658761964" + }, + "html": { + "href": "https://bitbucket.org/martinherren1984/" + }, + "self": { + "href": "https://api.bitbucket.org/2.0/workspaces/martinherren1984" + } + } + }, + "is_private": false, + "project": { + "type": "project", + "key": "PUB", + "uuid": "{2cede481-f59e-49ec-88d0-a85629b7925d}", + "name": "PublicTestProject", + "links": { + "self": { + "href": "https://api.bitbucket.org/2.0/workspaces/martinherren1984/projects/PUB" + }, + "html": { + "href": "https://bitbucket.org/martinherren1984/workspace/projects/PUB" + }, + "avatar": { + "href": "https://bitbucket.org/martinherren1984/workspace/projects/PUB/avatar/32?ts=1658768453" + } + } + }, + "fork_policy": "allow_forks", + "created_on": "2022-07-25T17:01:20.950706+00:00", + "updated_on": "2022-09-07T20:19:30.622886+00:00", + "size": 85955, + "language": "", + "uuid": "{898477b2-a080-4089-b385-597a783db392}", + "mainbranch": { + "name": "master", + "type": "branch" + }, + "override_settings": { + "default_merge_strategy": true, + "branching_model": true + }, + "parent": null, + "enforced_signed_commits": null, + "has_issues": false, + "has_wiki": false } ` const repoHookPayload = ` { - "pagelen": 10, - "values": [ - { - "uuid": "{afe61e14-2c5f-49e8-8b68-ad1fb55fc052}", - "url": "http://127.0.0.1" - } - ], - "page": 1, - "size": 1 + "pagelen": 10, + "values": [ + { + "uuid": "{afe61e14-2c5f-49e8-8b68-ad1fb55fc052}", + "url": "http://127.0.0.1" + } + ], + "page": 1, + "size": 1 } ` @@ -393,109 +393,109 @@ const repoFilePayload = "dummy payload" const repoDirPayload = ` { - "pagelen": 10, - "page": 1, - "values": [ - { - "path": "README.md", - "type": "commit_file" - }, - { - "path": "test", - "type": "commit_directory" - }, - { - "path": ".gitignore", - "type": "commit_file" - } - ] + "pagelen": 10, + "page": 1, + "values": [ + { + "path": "README.md", + "type": "commit_file" + }, + { + "path": "test", + "type": "commit_directory" + }, + { + "path": ".gitignore", + "type": "commit_file" + } + ] } ` const branchCommitsPayload = ` { - "values": [ - { - "hash": "branch_head_name", + "values": [ + { + "hash": "branch_head_name", "links": { "html": { "href": "https://bitbucket.org/commitlink" } } - }, - { - "hash": "random1" - }, - { - "hash": "random2" - } - ] + }, + { + "hash": "random1" + }, + { + "hash": "random2" + } + ] } ` const pullRequestsPayload = ` { - "values": [ - { - "id": 123, + "values": [ + { + "id": 123, "title": "PRs title" - }, - { - "id": 456, + }, + { + "id": 456, "title": "Another PRs title" - } - ], + } + ], "pagelen": 10, - "size": 2, - "page": 1 + "size": 2, + "page": 1 } ` const diffStatPayload = ` { - "values": [ - { - "old": { - "path": "main.go" - }, - "new": { - "path": "main.go" - } - } - ] + "values": [ + { + "old": { + "path": "main.go" + }, + "new": { + "path": "main.go" + } + } + ] } ` const userPayload = ` { "uuid": "{4d8c0f46-cd62-4b77-b0cf-faa3e4d932c6}", - "username": "superman", - "links": { - "avatar": { - "href": "http:\/\/i.imgur.com\/ZygP55A.jpg" - } - }, - "type": "user" + "username": "superman", + "links": { + "avatar": { + "href": "http:\/\/i.imgur.com\/ZygP55A.jpg" + } + }, + "type": "user" } ` const userRepoPayload = ` { - "page": 1, - "pagelen": 10, - "size": 1, - "values": [ - { - "links": { - "avatar": { - "href": "http:\/\/i.imgur.com\/ZygP55A.jpg" - } - }, - "full_name": "test_name/repo_name", - "scm": "git", - "is_private": true - } - ] + "page": 1, + "pagelen": 10, + "size": 1, + "values": [ + { + "links": { + "avatar": { + "href": "http:\/\/i.imgur.com\/ZygP55A.jpg" + } + }, + "full_name": "test_name/repo_name", + "scm": "git", + "is_private": true + } + ] } ` @@ -517,59 +517,59 @@ const emailsPayload = ` const workspacesPayload = ` { "page": 1, - "pagelen": 100, + "pagelen": 100, "size": 1, - "values": [ - { + "values": [ + { "type": "workspace", "uuid": "{c7a04a76-fa20-43e4-dc42-a7506db4c95b}", "name": "Ueber Dev", "slug": "ueberdev42", - "links": { + "links": { "avatar": { - "href": "https://bitbucket.org/workspaces/ueberdev42/avatar/?ts=1658761964" - }, - "html": { - "href": "https://bitbucket.org/ueberdev42/" - }, - "self": { - "href": "https://api.bitbucket.org/2.0/workspaces/ueberdev42" - } - } - } - ] + "href": "https://bitbucket.org/workspaces/ueberdev42/avatar/?ts=1658761964" + }, + "html": { + "href": "https://bitbucket.org/ueberdev42/" + }, + "self": { + "href": "https://api.bitbucket.org/2.0/workspaces/ueberdev42" + } + } + } + ] } ` const permissionsPayLoad = ` { - "pagelen": 100, + "pagelen": 100, "page": 1, - "values": [ - { - "repository": { - "full_name": "test_name/repo_name" - }, - "permission": "read" - }, + "values": [ { - "repository": { - "full_name": "test_name/permission_read" - }, - "permission": "read" - }, + "repository": { + "full_name": "test_name/repo_name" + }, + "permission": "read" + }, { - "repository": { - "full_name": "test_name/permission_write" - }, - "permission": "write" - }, + "repository": { + "full_name": "test_name/permission_read" + }, + "permission": "read" + }, { - "repository": { - "full_name": "test_name/permission_admin" - }, - "permission": "admin" - } - ] + "repository": { + "full_name": "test_name/permission_write" + }, + "permission": "write" + }, + { + "repository": { + "full_name": "test_name/permission_admin" + }, + "permission": "admin" + } + ] } ` diff --git a/server/forge/forgejo/fixtures/handler.go b/server/forge/forgejo/fixtures/handler.go index 73c3a9eb7c..68e2d85906 100644 --- a/server/forge/forgejo/fixtures/handler.go +++ b/server/forge/forgejo/fixtures/handler.go @@ -139,34 +139,34 @@ func getPRFiles(c *gin.Context) { const listRepoHookPayloads = ` [ - { - "id": 1, - "type": "forgejo", - "config": { - "content_type": "json", - "url": "http:\/\/localhost\/hook?access_token=1234567890" - } - } + { + "id": 1, + "type": "forgejo", + "config": { + "content_type": "json", + "url": "http:\/\/localhost\/hook?access_token=1234567890" + } + } ] ` const repoPayload = ` { "id": 5, - "owner": { - "login": "test_name", - "email": "octocat@github.com", - "avatar_url": "https:\/\/secure.gravatar.com\/avatar\/8c58a0be77ee441bb8f8595b7f1b4e87" - }, - "full_name": "test_name\/repo_name", - "private": true, - "html_url": "http:\/\/localhost\/test_name\/repo_name", - "clone_url": "http:\/\/localhost\/test_name\/repo_name.git", - "permissions": { - "admin": true, - "push": true, - "pull": true - } + "owner": { + "login": "test_name", + "email": "octocat@github.com", + "avatar_url": "https:\/\/secure.gravatar.com\/avatar\/8c58a0be77ee441bb8f8595b7f1b4e87" + }, + "full_name": "test_name\/repo_name", + "private": true, + "html_url": "http:\/\/localhost\/test_name\/repo_name", + "clone_url": "http:\/\/localhost\/test_name\/repo_name.git", + "permissions": { + "admin": true, + "push": true, + "pull": true + } } ` @@ -174,37 +174,37 @@ const repoFilePayload = `{ platform: linux/amd64 }` const userRepoPayload = ` [ - { + { "id": 5, - "owner": { - "login": "test_name", - "email": "octocat@github.com", - "avatar_url": "https:\/\/secure.gravatar.com\/avatar\/8c58a0be77ee441bb8f8595b7f1b4e87" - }, - "full_name": "test_name\/repo_name", - "private": true, - "html_url": "http:\/\/localhost\/test_name\/repo_name", - "clone_url": "http:\/\/localhost\/test_name\/repo_name.git", - "permissions": { - "admin": true, - "push": true, - "pull": true - } - } + "owner": { + "login": "test_name", + "email": "octocat@github.com", + "avatar_url": "https:\/\/secure.gravatar.com\/avatar\/8c58a0be77ee441bb8f8595b7f1b4e87" + }, + "full_name": "test_name\/repo_name", + "private": true, + "html_url": "http:\/\/localhost\/test_name\/repo_name", + "clone_url": "http:\/\/localhost\/test_name\/repo_name.git", + "permissions": { + "admin": true, + "push": true, + "pull": true + } + } ] ` const prFilesPayload = ` [ - { - "filename": "README.md", - "status": "changed", - "additions": 2, - "deletions": 0, - "changes": 2, - "html_url": "http://localhost/username/repo/src/commit/e79e4b0e8d9dd6f72b70e776c3317db7c19ca0fd/README.md", - "contents_url": "http://localhost:3000/api/v1/repos/username/repo/contents/README.md?ref=e79e4b0e8d9dd6f72b70e776c3317db7c19ca0fd", - "raw_url": "http://localhost/username/repo/raw/commit/e79e4b0e8d9dd6f72b70e776c3317db7c19ca0fd/README.md" - } + { + "filename": "README.md", + "status": "changed", + "additions": 2, + "deletions": 0, + "changes": 2, + "html_url": "http://localhost/username/repo/src/commit/e79e4b0e8d9dd6f72b70e776c3317db7c19ca0fd/README.md", + "contents_url": "http://localhost:3000/api/v1/repos/username/repo/contents/README.md?ref=e79e4b0e8d9dd6f72b70e776c3317db7c19ca0fd", + "raw_url": "http://localhost/username/repo/raw/commit/e79e4b0e8d9dd6f72b70e776c3317db7c19ca0fd/README.md" + } ] ` diff --git a/server/forge/gitea/fixtures/handler.go b/server/forge/gitea/fixtures/handler.go index 7bc2bbb42a..9545a02303 100644 --- a/server/forge/gitea/fixtures/handler.go +++ b/server/forge/gitea/fixtures/handler.go @@ -139,34 +139,34 @@ func getPRFiles(c *gin.Context) { const listRepoHookPayloads = ` [ - { - "id": 1, - "type": "gitea", - "config": { - "content_type": "json", - "url": "http:\/\/localhost\/hook?access_token=1234567890" - } - } + { + "id": 1, + "type": "gitea", + "config": { + "content_type": "json", + "url": "http:\/\/localhost\/hook?access_token=1234567890" + } + } ] ` const repoPayload = ` { "id": 5, - "owner": { - "login": "test_name", - "email": "octocat@github.com", - "avatar_url": "https:\/\/secure.gravatar.com\/avatar\/8c58a0be77ee441bb8f8595b7f1b4e87" - }, - "full_name": "test_name\/repo_name", - "private": true, - "html_url": "http:\/\/localhost\/test_name\/repo_name", - "clone_url": "http:\/\/localhost\/test_name\/repo_name.git", - "permissions": { - "admin": true, - "push": true, - "pull": true - } + "owner": { + "login": "test_name", + "email": "octocat@github.com", + "avatar_url": "https:\/\/secure.gravatar.com\/avatar\/8c58a0be77ee441bb8f8595b7f1b4e87" + }, + "full_name": "test_name\/repo_name", + "private": true, + "html_url": "http:\/\/localhost\/test_name\/repo_name", + "clone_url": "http:\/\/localhost\/test_name\/repo_name.git", + "permissions": { + "admin": true, + "push": true, + "pull": true + } } ` @@ -174,37 +174,37 @@ const repoFilePayload = `{ platform: linux/amd64 }` const userRepoPayload = ` [ - { + { "id": 5, - "owner": { - "login": "test_name", - "email": "octocat@github.com", - "avatar_url": "https:\/\/secure.gravatar.com\/avatar\/8c58a0be77ee441bb8f8595b7f1b4e87" - }, - "full_name": "test_name\/repo_name", - "private": true, - "html_url": "http:\/\/localhost\/test_name\/repo_name", - "clone_url": "http:\/\/localhost\/test_name\/repo_name.git", - "permissions": { - "admin": true, - "push": true, - "pull": true - } - } + "owner": { + "login": "test_name", + "email": "octocat@github.com", + "avatar_url": "https:\/\/secure.gravatar.com\/avatar\/8c58a0be77ee441bb8f8595b7f1b4e87" + }, + "full_name": "test_name\/repo_name", + "private": true, + "html_url": "http:\/\/localhost\/test_name\/repo_name", + "clone_url": "http:\/\/localhost\/test_name\/repo_name.git", + "permissions": { + "admin": true, + "push": true, + "pull": true + } + } ] ` const prFilesPayload = ` [ - { - "filename": "README.md", - "status": "changed", - "additions": 2, - "deletions": 0, - "changes": 2, - "html_url": "http://localhost/username/repo/src/commit/e79e4b0e8d9dd6f72b70e776c3317db7c19ca0fd/README.md", - "contents_url": "http://localhost:3000/api/v1/repos/username/repo/contents/README.md?ref=e79e4b0e8d9dd6f72b70e776c3317db7c19ca0fd", - "raw_url": "http://localhost/username/repo/raw/commit/e79e4b0e8d9dd6f72b70e776c3317db7c19ca0fd/README.md" - } + { + "filename": "README.md", + "status": "changed", + "additions": 2, + "deletions": 0, + "changes": 2, + "html_url": "http://localhost/username/repo/src/commit/e79e4b0e8d9dd6f72b70e776c3317db7c19ca0fd/README.md", + "contents_url": "http://localhost:3000/api/v1/repos/username/repo/contents/README.md?ref=e79e4b0e8d9dd6f72b70e776c3317db7c19ca0fd", + "raw_url": "http://localhost/username/repo/raw/commit/e79e4b0e8d9dd6f72b70e776c3317db7c19ca0fd/README.md" + } ] ` diff --git a/server/forge/github/fixtures/handler.go b/server/forge/github/fixtures/handler.go index 0f02557053..b6c9231ca0 100644 --- a/server/forge/github/fixtures/handler.go +++ b/server/forge/github/fixtures/handler.go @@ -66,102 +66,102 @@ func getMembership(c *gin.Context) { var repoPayload = ` { "id": 5, - "owner": { - "login": "octocat", - "avatar_url": "https://github.com/images/error/octocat_happy.gif" - }, - "name": "Hello-World", - "full_name": "octocat/Hello-World", - "private": true, - "html_url": "https://github.com/octocat/Hello-World", - "clone_url": "https://github.com/octocat/Hello-World.git", - "language": null, - "permissions": { - "admin": true, - "push": true, - "pull": true - } + "owner": { + "login": "octocat", + "avatar_url": "https://github.com/images/error/octocat_happy.gif" + }, + "name": "Hello-World", + "full_name": "octocat/Hello-World", + "private": true, + "html_url": "https://github.com/octocat/Hello-World", + "clone_url": "https://github.com/octocat/Hello-World.git", + "language": null, + "permissions": { + "admin": true, + "push": true, + "pull": true + } } ` var membershipIsOwnerPayload = ` { - "url": "https://api.github.com/orgs/octocat/memberships/octocat", - "state": "active", - "role": "admin", - "organization_url": "https://api.github.com/orgs/octocat", - "user": { - "login": "octocat", - "id": 5555555, - "avatar_url": "https://github.com/images/error/octocat_happy.gif", - "gravatar_id": "", - "url": "https://api.github.com/users/octocat", - "html_url": "https://github.com/octocat", - "followers_url": "https://api.github.com/users/octocat/followers", - "following_url": "https://api.github.com/users/octocat/following{/other_user}", - "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", - "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", - "organizations_url": "https://api.github.com/users/octocat/orgs", - "repos_url": "https://api.github.com/users/octocat/repos", - "events_url": "https://api.github.com/users/octocat/events{/privacy}", - "received_events_url": "https://api.github.com/users/octocat/received_events", - "type": "User", - "site_admin": false - }, - "organization": { - "login": "octocat", - "id": 5555556, - "url": "https://api.github.com/orgs/octocat", - "repos_url": "https://api.github.com/orgs/octocat/repos", - "events_url": "https://api.github.com/orgs/octocat/events", - "hooks_url": "https://api.github.com/orgs/octocat/hooks", - "issues_url": "https://api.github.com/orgs/octocat/issues", - "members_url": "https://api.github.com/orgs/octocat/members{/member}", - "public_members_url": "https://api.github.com/orgs/octocat/public_members{/member}", - "avatar_url": "https://github.com/images/error/octocat_happy.gif", - "description": "" - } + "url": "https://api.github.com/orgs/octocat/memberships/octocat", + "state": "active", + "role": "admin", + "organization_url": "https://api.github.com/orgs/octocat", + "user": { + "login": "octocat", + "id": 5555555, + "avatar_url": "https://github.com/images/error/octocat_happy.gif", + "gravatar_id": "", + "url": "https://api.github.com/users/octocat", + "html_url": "https://github.com/octocat", + "followers_url": "https://api.github.com/users/octocat/followers", + "following_url": "https://api.github.com/users/octocat/following{/other_user}", + "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", + "organizations_url": "https://api.github.com/users/octocat/orgs", + "repos_url": "https://api.github.com/users/octocat/repos", + "events_url": "https://api.github.com/users/octocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/octocat/received_events", + "type": "User", + "site_admin": false + }, + "organization": { + "login": "octocat", + "id": 5555556, + "url": "https://api.github.com/orgs/octocat", + "repos_url": "https://api.github.com/orgs/octocat/repos", + "events_url": "https://api.github.com/orgs/octocat/events", + "hooks_url": "https://api.github.com/orgs/octocat/hooks", + "issues_url": "https://api.github.com/orgs/octocat/issues", + "members_url": "https://api.github.com/orgs/octocat/members{/member}", + "public_members_url": "https://api.github.com/orgs/octocat/public_members{/member}", + "avatar_url": "https://github.com/images/error/octocat_happy.gif", + "description": "" + } } ` var membershipIsMemberPayload = ` { - "url": "https://api.github.com/orgs/github/memberships/octocat", - "state": "active", - "role": "member", - "organization_url": "https://api.github.com/orgs/github", - "user": { - "login": "octocat", - "id": 5555555, - "avatar_url": "https://github.com/images/error/octocat_happy.gif", - "gravatar_id": "", - "url": "https://api.github.com/users/octocat", - "html_url": "https://github.com/octocat", - "followers_url": "https://api.github.com/users/octocat/followers", - "following_url": "https://api.github.com/users/octocat/following{/other_user}", - "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", - "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", - "organizations_url": "https://api.github.com/users/octocat/orgs", - "repos_url": "https://api.github.com/users/octocat/repos", - "events_url": "https://api.github.com/users/octocat/events{/privacy}", - "received_events_url": "https://api.github.com/users/octocat/received_events", - "type": "User", - "site_admin": false - }, - "organization": { - "login": "octocat", - "id": 5555557, - "url": "https://api.github.com/orgs/github", - "repos_url": "https://api.github.com/orgs/github/repos", - "events_url": "https://api.github.com/orgs/github/events", - "hooks_url": "https://api.github.com/orgs/github/hooks", - "issues_url": "https://api.github.com/orgs/github/issues", - "members_url": "https://api.github.com/orgs/github/members{/member}", - "public_members_url": "https://api.github.com/orgs/github/public_members{/member}", - "avatar_url": "https://github.com/images/error/octocat_happy.gif", - "description": "" - } + "url": "https://api.github.com/orgs/github/memberships/octocat", + "state": "active", + "role": "member", + "organization_url": "https://api.github.com/orgs/github", + "user": { + "login": "octocat", + "id": 5555555, + "avatar_url": "https://github.com/images/error/octocat_happy.gif", + "gravatar_id": "", + "url": "https://api.github.com/users/octocat", + "html_url": "https://github.com/octocat", + "followers_url": "https://api.github.com/users/octocat/followers", + "following_url": "https://api.github.com/users/octocat/following{/other_user}", + "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", + "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", + "organizations_url": "https://api.github.com/users/octocat/orgs", + "repos_url": "https://api.github.com/users/octocat/repos", + "events_url": "https://api.github.com/users/octocat/events{/privacy}", + "received_events_url": "https://api.github.com/users/octocat/received_events", + "type": "User", + "site_admin": false + }, + "organization": { + "login": "octocat", + "id": 5555557, + "url": "https://api.github.com/orgs/github", + "repos_url": "https://api.github.com/orgs/github/repos", + "events_url": "https://api.github.com/orgs/github/events", + "hooks_url": "https://api.github.com/orgs/github/hooks", + "issues_url": "https://api.github.com/orgs/github/issues", + "members_url": "https://api.github.com/orgs/github/members{/member}", + "public_members_url": "https://api.github.com/orgs/github/public_members{/member}", + "avatar_url": "https://github.com/images/error/octocat_happy.gif", + "description": "" + } } ` diff --git a/server/forge/gitlab/fixtures/projects.go b/server/forge/gitlab/fixtures/projects.go index 4eed500000..9a6dfc5ea4 100644 --- a/server/forge/gitlab/fixtures/projects.go +++ b/server/forge/gitlab/fixtures/projects.go @@ -281,56 +281,56 @@ var project4PayloadHook = []byte(` var project4PayloadHooks = []byte(` [ - { - "id": 10717088, - "url": "http://example.com/api/hook", - "created_at": "2021-12-18T23:29:33.852Z", - "push_events": true, - "tag_push_events": true, - "merge_requests_events": true, - "repository_update_events": false, - "enable_ssl_verification": true, - "project_id": 4, - "issues_events": false, - "confidential_issues_events": false, - "note_events": false, - "confidential_note_events": null, - "pipeline_events": false, - "wiki_page_events": false, - "deployment_events": true, - "job_events": false, - "releases_events": false, - "push_events_branch_filter": null - } + { + "id": 10717088, + "url": "http://example.com/api/hook", + "created_at": "2021-12-18T23:29:33.852Z", + "push_events": true, + "tag_push_events": true, + "merge_requests_events": true, + "repository_update_events": false, + "enable_ssl_verification": true, + "project_id": 4, + "issues_events": false, + "confidential_issues_events": false, + "note_events": false, + "confidential_note_events": null, + "pipeline_events": false, + "wiki_page_events": false, + "deployment_events": true, + "job_events": false, + "releases_events": false, + "push_events_branch_filter": null + } ] `) var project4PayloadMembers = []byte(` { - "id": 3, - "username": "some_user", - "name": "Diaspora", - "state": "active", - "locked": false, - "avatar_url": "https://example.com/uploads/-/system/user/avatar/3/avatar.png", - "web_url": "https://example.com/some_user", - "access_level": 50, - "created_at": "2024-01-16T12:39:58.912Z", - "expires_at": null + "id": 3, + "username": "some_user", + "name": "Diaspora", + "state": "active", + "locked": false, + "avatar_url": "https://example.com/uploads/-/system/user/avatar/3/avatar.png", + "web_url": "https://example.com/some_user", + "access_level": 50, + "created_at": "2024-01-16T12:39:58.912Z", + "expires_at": null } `) var project6PayloadMembers = []byte(` { - "id": 3, - "username": "some_user", - "name": "Diaspora", - "state": "active", - "locked": false, - "avatar_url": "https://example.com/uploads/-/system/user/avatar/3/avatar.png", - "web_url": "https://example.com/some_user", - "access_level": 30, - "created_at": "2024-01-16T12:39:58.912Z", - "expires_at": null + "id": 3, + "username": "some_user", + "name": "Diaspora", + "state": "active", + "locked": false, + "avatar_url": "https://example.com/uploads/-/system/user/avatar/3/avatar.png", + "web_url": "https://example.com/some_user", + "access_level": 30, + "created_at": "2024-01-16T12:39:58.912Z", + "expires_at": null } `) diff --git a/server/forge/gitlab/fixtures/users.go b/server/forge/gitlab/fixtures/users.go index b5ee1c4c4e..8a6e2770f9 100644 --- a/server/forge/gitlab/fixtures/users.go +++ b/server/forge/gitlab/fixtures/users.go @@ -16,23 +16,23 @@ package fixtures var currentUserPayload = []byte(` { - "id": 1, - "username": "john_smith", - "email": "john@example.com", - "name": "John Smith", - "private_token": "dd34asd13as", - "state": "active", - "created_at": "2012-05-23T08:00:58Z", - "bio": null, - "skype": "", - "linkedin": "", - "twitter": "", - "website_url": "", - "theme_id": 1, - "color_scheme_id": 2, - "is_admin": false, - "can_create_group": true, - "can_create_project": true, - "projects_limit": 100 + "id": 1, + "username": "john_smith", + "email": "john@example.com", + "name": "John Smith", + "private_token": "dd34asd13as", + "state": "active", + "created_at": "2012-05-23T08:00:58Z", + "bio": null, + "skype": "", + "linkedin": "", + "twitter": "", + "website_url": "", + "theme_id": 1, + "color_scheme_id": 2, + "is_admin": false, + "can_create_group": true, + "can_create_project": true, + "projects_limit": 100 } `)