{"action":"created","comment":{"url":"https://api.github.com/repos/openfaas/openfaas-cloud/pulls/comments/184325441","pull_request_review_id":115495791,"id":184325441,"diff_hunk":"@@ -75,12 +82,14 @@ func Handle(req []byte) string {\n \t\tresult, err := deployFunction(deploy, gatewayURL, c)\n \n \t\tif err != nil {\n+\t\t\treportStatus(\"failure\", err.Error(), \"DEPLOY\")\n \t\t\tlog.Fatal(err.Error())\n \t\t}\n \n \t\tlog.Println(result)\n \t}\n \n+\treportStatus(\"success\", fmt.Sprintf(\"function successfully deployed as: %s\", serviceValue), \"DEPLOY\")","path":"buildshiprun/handler.go","position":54,"original_position":54,"commit_id":"5ada40ce170ee80a1396424776e6b7dca2ac15e6","original_commit_id":"5ada40ce170ee80a1396424776e6b7dca2ac15e6","user":{"login":"alexellis","id":6358735,"avatar_url":"https://avatars1.githubusercontent.com/u/6358735?v=4","gravatar_id":"","url":"https://api.github.com/users/alexellis","html_url":"https://github.com/alexellis","followers_url":"https://api.github.com/users/alexellis/followers","following_url":"https://api.github.com/users/alexellis/following{/other_user}","gists_url":"https://api.github.com/users/alexellis/gists{/gist_id}","starred_url":"https://api.github.com/users/alexellis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexellis/subscriptions","organizations_url":"https://api.github.com/users/alexellis/orgs","repos_url":"https://api.github.com/users/alexellis/repos","events_url":"https://api.github.com/users/alexellis/events{/privacy}","received_events_url":"https://api.github.com/users/alexellis/received_events","type":"User","site_admin":false},"body":"The status functionality must be put behind a feature flag so that we don't break the existing site or force everyone to use status updates. Not everyone will want this feature.\r\n\r\nFor instance:\r\n\r\n```\r\nreport_status: \"true\"\r\n```","created_at":"2018-04-26T09:28:02Z","updated_at":"2018-04-26T09:28:02Z","html_url":"https://github.com/openfaas/openfaas-cloud/pull/23#discussion_r184325441","pull_request_url":"https://api.github.com/repos/openfaas/openfaas-cloud/pulls/23","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/openfaas/openfaas-cloud/pulls/comments/184325441"},"html":{"href":"https://github.com/openfaas/openfaas-cloud/pull/23#discussion_r184325441"},"pull_request":{"href":"https://api.github.com/repos/openfaas/openfaas-cloud/pulls/23"}}},"pull_request":{"url":"https://api.github.com/repos/openfaas/openfaas-cloud/pulls/23","id":183931027,"html_url":"https://github.com/openfaas/openfaas-cloud/pull/23","diff_url":"https://github.com/openfaas/openfaas-cloud/pull/23.diff","patch_url":"https://github.com/openfaas/openfaas-cloud/pull/23.patch","issue_url":"https://api.github.com/repos/openfaas/openfaas-cloud/issues/23","number":23,"state":"open","locked":false,"title":"Issue 5 : Github Commit Status integration","user":{"login":"s8sg","id":7374058,"avatar_url":"https://avatars2.githubusercontent.com/u/7374058?v=4","gravatar_id":"","url":"https://api.github.com/users/s8sg","html_url":"https://github.com/s8sg","followers_url":"https://api.github.com/users/s8sg/followers","following_url":"https://api.github.com/users/s8sg/following{/other_user}","gists_url":"https://api.github.com/users/s8sg/gists{/gist_id}","starred_url":"https://api.github.com/users/s8sg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/s8sg/subscriptions","organizations_url":"https://api.github.com/users/s8sg/orgs","repos_url":"https://api.github.com/users/s8sg/repos","events_url":"https://api.github.com/users/s8sg/events{/privacy}","received_events_url":"https://api.github.com/users/s8sg/received_events","type":"User","site_admin":false},"body":"This pull request implements the gitlab status integration \r\n\r\nThis issue resolves: #5 \r\n\r\n##### Change Overview\r\nOpenfaas-cloud will update status for repo based on Build and Deployment Status\r\nCurrent status definition are being provided as: \r\n```\r\n{\r\n\"state\": \"failure\", // Current applicable values success / failure\r\n\"target_url\": \":CloneURL\",\r\n\"description\": \"Error String of actual Error\",\r\n\"context\": \"BUILD\". //  Current applicable values BUILD / DEPLOY\r\n}\r\n```\r\n\r\n##### To Test: \r\n1. Gitlab App Should be created with read + write permission on `Commit Statuses`\r\n![screen shot 2018-04-25 at 2 46 31 pm](https://user-images.githubusercontent.com/7374058/39228157-84114e98-4897-11e8-87b0-1be49cf70fff.png)\r\n\r\n2. Get you gitlab APP Id\r\n![screen shot 2018-04-25 at 2 47 24 pm](https://user-images.githubusercontent.com/7374058/39228182-bafda49c-4897-11e8-9473-37b3070fe729.jpg)\r\n\r\n3. Add gitlab Id in your `github.yml`\r\n```bash\r\nenvironment:\r\n    github_webhook_secret: \"webhook secret\"\r\n    github_app_id: \"app id\"\r\n```\r\n3. Download Private Key\r\n![screen shot 2018-04-25 at 2 49 51 pm](https://user-images.githubusercontent.com/7374058/39228225-f5f5aee6-4897-11e8-80ac-54735b3c97eb.png)\r\n\r\n4. Create Docker Secret with Private Key\r\n```bash\r\ndocker secret create private_key.pem <downloaded_pem_file_path>\r\n```\r\n5. Commit Something in your repo to get status published.  \r\nor can be manually tested by\r\n```bash\r\ncurl -X POST -H \"Content-Type: application/json\" -H \"X_Github_Event: push\" http://my.openfaas.cloud/function/gh-push -d '{\"after\": \"<latest_commit_sha>\",\"repository\":{\"name\":\"<foo>\",\"full_name\": \"bar/foo\",\"clone_url\": \"https://github.com/bar/foo.git\",\"owner\":{\"login\": \"bar\",\"email\": \"bar@email.com\"}}, \"installation\":{\"id\": <your_ins_id>}}'\r\n```\r\n\r\n##### Example Repo: \r\n[regex_go](https://github.com/s8sg/regex_go) is integrated with openfaas \r\n\r\n<img width=\"962\" alt=\"screen shot 2018-04-26 at 12 00 06 am\" src=\"https://user-images.githubusercontent.com/7374058/39254383-ea1a2cf8-48e4-11e8-8f99-9113f30d035c.png\">\r\n\r\nWith Application: [s8sgofcloud](https://github.com/apps/s8sgofcloud)\r\n\r\n","created_at":"2018-04-25T05:54:51Z","updated_at":"2018-04-26T09:28:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"232e30d194781fa9195fe5c63eb856f50c40f263","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/openfaas/openfaas-cloud/pulls/23/commits","review_comments_url":"https://api.github.com/repos/openfaas/openfaas-cloud/pulls/23/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/23/comments","statuses_url":"https://api.github.com/repos/openfaas/openfaas-cloud/statuses/5ada40ce170ee80a1396424776e6b7dca2ac15e6","head":{"label":"s8sg:issue-5","ref":"issue-5","sha":"5ada40ce170ee80a1396424776e6b7dca2ac15e6","user":{"login":"s8sg","id":7374058,"avatar_url":"https://avatars2.githubusercontent.com/u/7374058?v=4","gravatar_id":"","url":"https://api.github.com/users/s8sg","html_url":"https://github.com/s8sg","followers_url":"https://api.github.com/users/s8sg/followers","following_url":"https://api.github.com/users/s8sg/following{/other_user}","gists_url":"https://api.github.com/users/s8sg/gists{/gist_id}","starred_url":"https://api.github.com/users/s8sg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/s8sg/subscriptions","organizations_url":"https://api.github.com/users/s8sg/orgs","repos_url":"https://api.github.com/users/s8sg/repos","events_url":"https://api.github.com/users/s8sg/events{/privacy}","received_events_url":"https://api.github.com/users/s8sg/received_events","type":"User","site_admin":false},"repo":{"id":128858977,"name":"openfaas-cloud","full_name":"s8sg/openfaas-cloud","owner":{"login":"s8sg","id":7374058,"avatar_url":"https://avatars2.githubusercontent.com/u/7374058?v=4","gravatar_id":"","url":"https://api.github.com/users/s8sg","html_url":"https://github.com/s8sg","followers_url":"https://api.github.com/users/s8sg/followers","following_url":"https://api.github.com/users/s8sg/following{/other_user}","gists_url":"https://api.github.com/users/s8sg/gists{/gist_id}","starred_url":"https://api.github.com/users/s8sg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/s8sg/subscriptions","organizations_url":"https://api.github.com/users/s8sg/orgs","repos_url":"https://api.github.com/users/s8sg/repos","events_url":"https://api.github.com/users/s8sg/events{/privacy}","received_events_url":"https://api.github.com/users/s8sg/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/s8sg/openfaas-cloud","description":"OpenFaaS Cloud - FaaS in a box with CI/CD for functions","fork":true,"url":"https://api.github.com/repos/s8sg/openfaas-cloud","forks_url":"https://api.github.com/repos/s8sg/openfaas-cloud/forks","keys_url":"https://api.github.com/repos/s8sg/openfaas-cloud/keys{/key_id}","collaborators_url":"https://api.github.com/repos/s8sg/openfaas-cloud/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/s8sg/openfaas-cloud/teams","hooks_url":"https://api.github.com/repos/s8sg/openfaas-cloud/hooks","issue_events_url":"https://api.github.com/repos/s8sg/openfaas-cloud/issues/events{/number}","events_url":"https://api.github.com/repos/s8sg/openfaas-cloud/events","assignees_url":"https://api.github.com/repos/s8sg/openfaas-cloud/assignees{/user}","branches_url":"https://api.github.com/repos/s8sg/openfaas-cloud/branches{/branch}","tags_url":"https://api.github.com/repos/s8sg/openfaas-cloud/tags","blobs_url":"https://api.github.com/repos/s8sg/openfaas-cloud/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/s8sg/openfaas-cloud/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/s8sg/openfaas-cloud/git/refs{/sha}","trees_url":"https://api.github.com/repos/s8sg/openfaas-cloud/git/trees{/sha}","statuses_url":"https://api.github.com/repos/s8sg/openfaas-cloud/statuses/{sha}","languages_url":"https://api.github.com/repos/s8sg/openfaas-cloud/languages","stargazers_url":"https://api.github.com/repos/s8sg/openfaas-cloud/stargazers","contributors_url":"https://api.github.com/repos/s8sg/openfaas-cloud/contributors","subscribers_url":"https://api.github.com/repos/s8sg/openfaas-cloud/subscribers","subscription_url":"https://api.github.com/repos/s8sg/openfaas-cloud/subscription","commits_url":"https://api.github.com/repos/s8sg/openfaas-cloud/commits{/sha}","git_commits_url":"https://api.github.com/repos/s8sg/openfaas-cloud/git/commits{/sha}","comments_url":"https://api.github.com/repos/s8sg/openfaas-cloud/comments{/number}","issue_comment_url":"https://api.github.com/repos/s8sg/openfaas-cloud/issues/comments{/number}","contents_url":"https://api.github.com/repos/s8sg/openfaas-cloud/contents/{+path}","compare_url":"https://api.github.com/repos/s8sg/openfaas-cloud/compare/{base}...{head}","merges_url":"https://api.github.com/repos/s8sg/openfaas-cloud/merges","archive_url":"https://api.github.com/repos/s8sg/openfaas-cloud/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/s8sg/openfaas-cloud/downloads","issues_url":"https://api.github.com/repos/s8sg/openfaas-cloud/issues{/number}","pulls_url":"https://api.github.com/repos/s8sg/openfaas-cloud/pulls{/number}","milestones_url":"https://api.github.com/repos/s8sg/openfaas-cloud/milestones{/number}","notifications_url":"https://api.github.com/repos/s8sg/openfaas-cloud/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/s8sg/openfaas-cloud/labels{/name}","releases_url":"https://api.github.com/repos/s8sg/openfaas-cloud/releases{/id}","deployments_url":"https://api.github.com/repos/s8sg/openfaas-cloud/deployments","created_at":"2018-04-10T02:04:04Z","updated_at":"2018-04-24T02:19:04Z","pushed_at":"2018-04-26T04:22:29Z","git_url":"git://github.com/s8sg/openfaas-cloud.git","ssh_url":"git@github.com:s8sg/openfaas-cloud.git","clone_url":"https://github.com/s8sg/openfaas-cloud.git","svn_url":"https://github.com/s8sg/openfaas-cloud","homepage":"https://www.openfaas.com","size":7984,"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":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"openfaas:master","ref":"master","sha":"3435017e316894a45aef5ba66e16c16108de9ad3","user":{"login":"openfaas","id":27013154,"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,"name":"openfaas-cloud","full_name":"openfaas/openfaas-cloud","owner":{"login":"openfaas","id":27013154,"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},"private":false,"html_url":"https://github.com/openfaas/openfaas-cloud","description":"OpenFaaS Cloud - FaaS in a box with CI/CD for functions","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-04-25T19:06:13Z","pushed_at":"2018-04-26T04:22:30Z","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://www.openfaas.com","size":7801,"stargazers_count":27,"watchers_count":27,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"archived":false,"open_issues_count":14,"license":null,"forks":8,"open_issues":14,"watchers":27,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openfaas/openfaas-cloud/pulls/23"},"html":{"href":"https://github.com/openfaas/openfaas-cloud/pull/23"},"issue":{"href":"https://api.github.com/repos/openfaas/openfaas-cloud/issues/23"},"comments":{"href":"https://api.github.com/repos/openfaas/openfaas-cloud/issues/23/comments"},"review_comments":{"href":"https://api.github.com/repos/openfaas/openfaas-cloud/pulls/23/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/23/commits"},"statuses":{"href":"https://api.github.com/repos/openfaas/openfaas-cloud/statuses/5ada40ce170ee80a1396424776e6b7dca2ac15e6"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"alexellis"}}