{"action":"created","comment":{"url":"https://api.github.com/repos/openfaas/openfaas-cloud/pulls/comments/229760251","pull_request_review_id":170336094,"id":229760251,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyOTc2MDI1MQ==","diff_hunk":"@@ -100,3 +100,19 @@ func Test_getRepositoryURL_whenGetTokenReturnsError_WhenRepositoryIsPrivate(t *t\n \t\tt.Errorf(\"Expected URL: %s, Got: %s\", expectedURL, gotURL)\n \t}\n }\n+\n+func Test_formatGitLabCloneURL(t *testing.T) {\n+\tevent := sdk.PushEvent{}\n+\tevent.Repository.Owner.Login = \"martindekov\"\n+\tevent.Repository.CloneURL = \"https://gitlab.example.io/martindekov/gitlab-playground.git\"\n+\ttoken := \"xzajncx16zxc42\"\n+\n+\texpectedCloneURL := \"https://martindekov:xzajncx16zxc42@gitlab.example.io/martindekov/gitlab-playground.git\"\n+\tcloneURL, _ := formatGitLabCloneURL(event, token)\n+\tt.Run(\"Properly formatted URL\", func(t *testing.T) {\n+\t\tif cloneURL != expectedCloneURL {\n+\t\t\tt.Errorf(\"Expected URL: %s got: %s\", expectedCloneURL, cloneURL)\n+\t\t}\n+\t})\n+","path":"git-tar/function/ops_test.go","position":null,"original_position":18,"commit_id":"61879e57c4a6108d3a51b6048914a922dc053495","original_commit_id":"38861931d2bafc409d095bf8a118ffb723fb0ae1","user":{"login":"martindekov","id":34942004,"node_id":"MDQ6VXNlcjM0OTQyMDA0","avatar_url":"https://avatars1.githubusercontent.com/u/34942004?v=4","gravatar_id":"","url":"https://api.github.com/users/martindekov","html_url":"https://github.com/martindekov","followers_url":"https://api.github.com/users/martindekov/followers","following_url":"https://api.github.com/users/martindekov/following{/other_user}","gists_url":"https://api.github.com/users/martindekov/gists{/gist_id}","starred_url":"https://api.github.com/users/martindekov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martindekov/subscriptions","organizations_url":"https://api.github.com/users/martindekov/orgs","repos_url":"https://api.github.com/users/martindekov/repos","events_url":"https://api.github.com/users/martindekov/events{/privacy}","received_events_url":"https://api.github.com/users/martindekov/received_events","type":"User","site_admin":false},"body":"Added ^","created_at":"2018-10-31T16:02:49Z","updated_at":"2018-10-31T16:02:50Z","html_url":"https://github.com/openfaas/openfaas-cloud/pull/308#discussion_r229760251","pull_request_url":"https://api.github.com/repos/openfaas/openfaas-cloud/pulls/308","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/openfaas/openfaas-cloud/pulls/comments/229760251"},"html":{"href":"https://github.com/openfaas/openfaas-cloud/pull/308#discussion_r229760251"},"pull_request":{"href":"https://api.github.com/repos/openfaas/openfaas-cloud/pulls/308"}},"in_reply_to_id":228912914},"pull_request":{"url":"https://api.github.com/repos/openfaas/openfaas-cloud/pulls/308","id":225385750,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI1Mzg1NzUw","html_url":"https://github.com/openfaas/openfaas-cloud/pull/308","diff_url":"https://github.com/openfaas/openfaas-cloud/pull/308.diff","patch_url":"https://github.com/openfaas/openfaas-cloud/pull/308.patch","issue_url":"https://api.github.com/repos/openfaas/openfaas-cloud/issues/308","number":308,"state":"open","locked":false,"title":"Add gitlab-push function","user":{"login":"martindekov","id":34942004,"node_id":"MDQ6VXNlcjM0OTQyMDA0","avatar_url":"https://avatars1.githubusercontent.com/u/34942004?v=4","gravatar_id":"","url":"https://api.github.com/users/martindekov","html_url":"https://github.com/martindekov","followers_url":"https://api.github.com/users/martindekov/followers","following_url":"https://api.github.com/users/martindekov/following{/other_user}","gists_url":"https://api.github.com/users/martindekov/gists{/gist_id}","starred_url":"https://api.github.com/users/martindekov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martindekov/subscriptions","organizations_url":"https://api.github.com/users/martindekov/orgs","repos_url":"https://api.github.com/users/martindekov/repos","events_url":"https://api.github.com/users/martindekov/events{/privacy}","received_events_url":"https://api.github.com/users/martindekov/received_events","type":"User","site_admin":false},"body":"Adding gitlab-push function which can be added to webhook route\r\nto handle push or system hooks from gitlab\r\n\r\nSigned-off-by: Martin Dekov (VMware) <mdekov@vmware.com>\r\n\r\n## Description\r\n\r\nAbstract of how the function work + private/internal repository support:\r\n\r\n![gitlab push](https://user-images.githubusercontent.com/34942004/47503654-4ed1a180-d873-11e8-8751-71cbfde4db26.jpg)\r\n\r\nThis is clearer version of PR #109 . Validation of customers is removed along with webhook validation since those are given to `gitlab-event` function in another PR and this is no longer the front-facing function. Also internal trust/signing of the payload is added when calling `gitlab-status`.\r\n\r\n## How Has This Been Tested?\r\n<!--- Please describe in detail how you tested your changes. -->\r\n<!--- Include details of your testing environment, and the tests you ran to -->\r\n<!--- see how your change affects other areas of the code, etc. -->\r\n\r\nHave `gitlab.yml` file with configuration:\r\n\r\n```\r\nprovider:\r\n  name: faas\r\n  gateway: http://127.0.0.1:8080\r\n\r\nfunctions:\r\n  gitlab-push:\r\n    lang: go\r\n    handler: ./gitlab-push\r\n    image: martindekov/gitlab-push:0.2\r\n    labels:\r\n      openfaas-cloud: \"1\"\r\n      role: openfaas-system\r\n    environment:\r\n      write_debug: true\r\n      read_debug: true\r\n    environment_file:\r\n      - gateway_config.yml\r\n    secrets:\r\n      - payload-secret\r\n```\r\n\r\nIt is pretty standard\r\n\r\n## How are existing users impacted? What migration steps/scripts do we need?\r\n\r\nGitLab support for PushEvents\r\n\r\n## Checklist:\r\n\r\nI have:\r\n\r\n- [x] updated the documentation and/or roadmap (if required)\r\n- [x] read the [CONTRIBUTION](https://github.com/openfaas/faas/blob/master/CONTRIBUTING.md) guide\r\n- [x] signed-off my commits with `git commit -s`\r\n- [x] added unit tests\r\n","created_at":"2018-10-24T12:38:08Z","updated_at":"2018-10-31T16:02:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1435265bd25d781ce17c0421497ca7530f477c49","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/openfaas/openfaas-cloud/pulls/308/commits","review_comments_url":"https://api.github.com/repos/openfaas/openfaas-cloud/pulls/308/comments","review_comment_url":"https://api.github.com/repos/openfaas/openfaas-cloud/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openfaas/openfaas-cloud/issues/308/comments","statuses_url":"https://api.github.com/repos/openfaas/openfaas-cloud/statuses/61879e57c4a6108d3a51b6048914a922dc053495","head":{"label":"martindekov:martindekov/adding_gitlab_push_support","ref":"martindekov/adding_gitlab_push_support","sha":"61879e57c4a6108d3a51b6048914a922dc053495","user":{"login":"martindekov","id":34942004,"node_id":"MDQ6VXNlcjM0OTQyMDA0","avatar_url":"https://avatars1.githubusercontent.com/u/34942004?v=4","gravatar_id":"","url":"https://api.github.com/users/martindekov","html_url":"https://github.com/martindekov","followers_url":"https://api.github.com/users/martindekov/followers","following_url":"https://api.github.com/users/martindekov/following{/other_user}","gists_url":"https://api.github.com/users/martindekov/gists{/gist_id}","starred_url":"https://api.github.com/users/martindekov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martindekov/subscriptions","organizations_url":"https://api.github.com/users/martindekov/orgs","repos_url":"https://api.github.com/users/martindekov/repos","events_url":"https://api.github.com/users/martindekov/events{/privacy}","received_events_url":"https://api.github.com/users/martindekov/received_events","type":"User","site_admin":false},"repo":{"id":142837971,"node_id":"MDEwOlJlcG9zaXRvcnkxNDI4Mzc5NzE=","name":"openfaas-cloud","full_name":"martindekov/openfaas-cloud","private":false,"owner":{"login":"martindekov","id":34942004,"node_id":"MDQ6VXNlcjM0OTQyMDA0","avatar_url":"https://avatars1.githubusercontent.com/u/34942004?v=4","gravatar_id":"","url":"https://api.github.com/users/martindekov","html_url":"https://github.com/martindekov","followers_url":"https://api.github.com/users/martindekov/followers","following_url":"https://api.github.com/users/martindekov/following{/other_user}","gists_url":"https://api.github.com/users/martindekov/gists{/gist_id}","starred_url":"https://api.github.com/users/martindekov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martindekov/subscriptions","organizations_url":"https://api.github.com/users/martindekov/orgs","repos_url":"https://api.github.com/users/martindekov/repos","events_url":"https://api.github.com/users/martindekov/events{/privacy}","received_events_url":"https://api.github.com/users/martindekov/received_events","type":"User","site_admin":false},"html_url":"https://github.com/martindekov/openfaas-cloud","description":"OpenFaaS Cloud - GitOps for your functions with native GitHub integrations","fork":true,"url":"https://api.github.com/repos/martindekov/openfaas-cloud","forks_url":"https://api.github.com/repos/martindekov/openfaas-cloud/forks","keys_url":"https://api.github.com/repos/martindekov/openfaas-cloud/keys{/key_id}","collaborators_url":"https://api.github.com/repos/martindekov/openfaas-cloud/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/martindekov/openfaas-cloud/teams","hooks_url":"https://api.github.com/repos/martindekov/openfaas-cloud/hooks","issue_events_url":"https://api.github.com/repos/martindekov/openfaas-cloud/issues/events{/number}","events_url":"https://api.github.com/repos/martindekov/openfaas-cloud/events","assignees_url":"https://api.github.com/repos/martindekov/openfaas-cloud/assignees{/user}","branches_url":"https://api.github.com/repos/martindekov/openfaas-cloud/branches{/branch}","tags_url":"https://api.github.com/repos/martindekov/openfaas-cloud/tags","blobs_url":"https://api.github.com/repos/martindekov/openfaas-cloud/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/martindekov/openfaas-cloud/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/martindekov/openfaas-cloud/git/refs{/sha}","trees_url":"https://api.github.com/repos/martindekov/openfaas-cloud/git/trees{/sha}","statuses_url":"https://api.github.com/repos/martindekov/openfaas-cloud/statuses/{sha}","languages_url":"https://api.github.com/repos/martindekov/openfaas-cloud/languages","stargazers_url":"https://api.github.com/repos/martindekov/openfaas-cloud/stargazers","contributors_url":"https://api.github.com/repos/martindekov/openfaas-cloud/contributors","subscribers_url":"https://api.github.com/repos/martindekov/openfaas-cloud/subscribers","subscription_url":"https://api.github.com/repos/martindekov/openfaas-cloud/subscription","commits_url":"https://api.github.com/repos/martindekov/openfaas-cloud/commits{/sha}","git_commits_url":"https://api.github.com/repos/martindekov/openfaas-cloud/git/commits{/sha}","comments_url":"https://api.github.com/repos/martindekov/openfaas-cloud/comments{/number}","issue_comment_url":"https://api.github.com/repos/martindekov/openfaas-cloud/issues/comments{/number}","contents_url":"https://api.github.com/repos/martindekov/openfaas-cloud/contents/{+path}","compare_url":"https://api.github.com/repos/martindekov/openfaas-cloud/compare/{base}...{head}","merges_url":"https://api.github.com/repos/martindekov/openfaas-cloud/merges","archive_url":"https://api.github.com/repos/martindekov/openfaas-cloud/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/martindekov/openfaas-cloud/downloads","issues_url":"https://api.github.com/repos/martindekov/openfaas-cloud/issues{/number}","pulls_url":"https://api.github.com/repos/martindekov/openfaas-cloud/pulls{/number}","milestones_url":"https://api.github.com/repos/martindekov/openfaas-cloud/milestones{/number}","notifications_url":"https://api.github.com/repos/martindekov/openfaas-cloud/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/martindekov/openfaas-cloud/labels{/name}","releases_url":"https://api.github.com/repos/martindekov/openfaas-cloud/releases{/id}","deployments_url":"https://api.github.com/repos/martindekov/openfaas-cloud/deployments","created_at":"2018-07-30T07:04:55Z","updated_at":"2018-09-14T12:11:59Z","pushed_at":"2018-10-31T15:50:45Z","git_url":"git://github.com/martindekov/openfaas-cloud.git","ssh_url":"git@github.com:martindekov/openfaas-cloud.git","clone_url":"https://github.com/martindekov/openfaas-cloud.git","svn_url":"https://github.com/martindekov/openfaas-cloud","homepage":"https://blog.alexellis.io/introducing-openfaas-cloud/","size":20823,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"openfaas:integrate/gitlab","ref":"integrate/gitlab","sha":"f94bcd4a251e13cacb88de6f7ec0f100c16867d4","user":{"login":"openfaas","id":27013154,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI3MDEzMTU0","avatar_url":"https://avatars3.githubusercontent.com/u/27013154?v=4","gravatar_id":"","url":"https://api.github.com/users/openfaas","html_url":"https://github.com/openfaas","followers_url":"https://api.github.com/users/openfaas/followers","following_url":"https://api.github.com/users/openfaas/following{/other_user}","gists_url":"https://api.github.com/users/openfaas/gists{/gist_id}","starred_url":"https://api.github.com/users/openfaas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openfaas/subscriptions","organizations_url":"https://api.github.com/users/openfaas/orgs","repos_url":"https://api.github.com/users/openfaas/repos","events_url":"https://api.github.com/users/openfaas/events{/privacy}","received_events_url":"https://api.github.com/users/openfaas/received_events","type":"Organization","site_admin":false},"repo":{"id":109512938,"node_id":"MDEwOlJlcG9zaXRvcnkxMDk1MTI5Mzg=","name":"openfaas-cloud","full_name":"openfaas/openfaas-cloud","private":false,"owner":{"login":"openfaas","id":27013154,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI3MDEzMTU0","avatar_url":"https://avatars3.githubusercontent.com/u/27013154?v=4","gravatar_id":"","url":"https://api.github.com/users/openfaas","html_url":"https://github.com/openfaas","followers_url":"https://api.github.com/users/openfaas/followers","following_url":"https://api.github.com/users/openfaas/following{/other_user}","gists_url":"https://api.github.com/users/openfaas/gists{/gist_id}","starred_url":"https://api.github.com/users/openfaas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openfaas/subscriptions","organizations_url":"https://api.github.com/users/openfaas/orgs","repos_url":"https://api.github.com/users/openfaas/repos","events_url":"https://api.github.com/users/openfaas/events{/privacy}","received_events_url":"https://api.github.com/users/openfaas/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/openfaas/openfaas-cloud","description":"OpenFaaS Cloud - portable, multi-user Serverless Functions powered by GitOps","fork":false,"url":"https://api.github.com/repos/openfaas/openfaas-cloud","forks_url":"https://api.github.com/repos/openfaas/openfaas-cloud/forks","keys_url":"https://api.github.com/repos/openfaas/openfaas-cloud/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openfaas/openfaas-cloud/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openfaas/openfaas-cloud/teams","hooks_url":"https://api.github.com/repos/openfaas/openfaas-cloud/hooks","issue_events_url":"https://api.github.com/repos/openfaas/openfaas-cloud/issues/events{/number}","events_url":"https://api.github.com/repos/openfaas/openfaas-cloud/events","assignees_url":"https://api.github.com/repos/openfaas/openfaas-cloud/assignees{/user}","branches_url":"https://api.github.com/repos/openfaas/openfaas-cloud/branches{/branch}","tags_url":"https://api.github.com/repos/openfaas/openfaas-cloud/tags","blobs_url":"https://api.github.com/repos/openfaas/openfaas-cloud/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openfaas/openfaas-cloud/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openfaas/openfaas-cloud/git/refs{/sha}","trees_url":"https://api.github.com/repos/openfaas/openfaas-cloud/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openfaas/openfaas-cloud/statuses/{sha}","languages_url":"https://api.github.com/repos/openfaas/openfaas-cloud/languages","stargazers_url":"https://api.github.com/repos/openfaas/openfaas-cloud/stargazers","contributors_url":"https://api.github.com/repos/openfaas/openfaas-cloud/contributors","subscribers_url":"https://api.github.com/repos/openfaas/openfaas-cloud/subscribers","subscription_url":"https://api.github.com/repos/openfaas/openfaas-cloud/subscription","commits_url":"https://api.github.com/repos/openfaas/openfaas-cloud/commits{/sha}","git_commits_url":"https://api.github.com/repos/openfaas/openfaas-cloud/git/commits{/sha}","comments_url":"https://api.github.com/repos/openfaas/openfaas-cloud/comments{/number}","issue_comment_url":"https://api.github.com/repos/openfaas/openfaas-cloud/issues/comments{/number}","contents_url":"https://api.github.com/repos/openfaas/openfaas-cloud/contents/{+path}","compare_url":"https://api.github.com/repos/openfaas/openfaas-cloud/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openfaas/openfaas-cloud/merges","archive_url":"https://api.github.com/repos/openfaas/openfaas-cloud/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openfaas/openfaas-cloud/downloads","issues_url":"https://api.github.com/repos/openfaas/openfaas-cloud/issues{/number}","pulls_url":"https://api.github.com/repos/openfaas/openfaas-cloud/pulls{/number}","milestones_url":"https://api.github.com/repos/openfaas/openfaas-cloud/milestones{/number}","notifications_url":"https://api.github.com/repos/openfaas/openfaas-cloud/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openfaas/openfaas-cloud/labels{/name}","releases_url":"https://api.github.com/repos/openfaas/openfaas-cloud/releases{/id}","deployments_url":"https://api.github.com/repos/openfaas/openfaas-cloud/deployments","created_at":"2017-11-04T16:54:15Z","updated_at":"2018-10-31T14:21:51Z","pushed_at":"2018-10-31T15:50:46Z","git_url":"git://github.com/openfaas/openfaas-cloud.git","ssh_url":"git@github.com:openfaas/openfaas-cloud.git","clone_url":"https://github.com/openfaas/openfaas-cloud.git","svn_url":"https://github.com/openfaas/openfaas-cloud","homepage":"https://blog.alexellis.io/introducing-openfaas-cloud/","size":20584,"stargazers_count":190,"watchers_count":190,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":65,"mirror_url":null,"archived":false,"open_issues_count":67,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":65,"open_issues":67,"watchers":190,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openfaas/openfaas-cloud/pulls/308"},"html":{"href":"https://github.com/openfaas/openfaas-cloud/pull/308"},"issue":{"href":"https://api.github.com/repos/openfaas/openfaas-cloud/issues/308"},"comments":{"href":"https://api.github.com/repos/openfaas/openfaas-cloud/issues/308/comments"},"review_comments":{"href":"https://api.github.com/repos/openfaas/openfaas-cloud/pulls/308/comments"},"review_comment":{"href":"https://api.github.com/repos/openfaas/openfaas-cloud/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openfaas/openfaas-cloud/pulls/308/commits"},"statuses":{"href":"https://api.github.com/repos/openfaas/openfaas-cloud/statuses/61879e57c4a6108d3a51b6048914a922dc053495"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"martindekov"}}