{"action":"opened","number":398,"pull_request":{"url":"https://api.github.com/repos/serverless/event-gateway/pulls/398","id":177194166,"html_url":"https://github.com/serverless/event-gateway/pull/398","diff_url":"https://github.com/serverless/event-gateway/pull/398.diff","patch_url":"https://github.com/serverless/event-gateway/pull/398.patch","issue_url":"https://api.github.com/repos/serverless/event-gateway/issues/398","number":398,"state":"open","locked":false,"title":"Add UpdateSubscription endpoint","user":{"login":"alexdebrie","id":6509926,"avatar_url":"https://avatars3.githubusercontent.com/u/6509926?v=4","gravatar_id":"","url":"https://api.github.com/users/alexdebrie","html_url":"https://github.com/alexdebrie","followers_url":"https://api.github.com/users/alexdebrie/followers","following_url":"https://api.github.com/users/alexdebrie/following{/other_user}","gists_url":"https://api.github.com/users/alexdebrie/gists{/gist_id}","starred_url":"https://api.github.com/users/alexdebrie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexdebrie/subscriptions","organizations_url":"https://api.github.com/users/alexdebrie/orgs","repos_url":"https://api.github.com/users/alexdebrie/repos","events_url":"https://api.github.com/users/alexdebrie/events{/privacy}","received_events_url":"https://api.github.com/users/alexdebrie/received_events","type":"User","site_admin":false},"body":"## What did you implement:\r\n\r\nAdds an `UpdateSubscription` API endpoint in the Config API. For now, this should only be called if updating the CORS config on an HTTP subscription as the rest of the metadata is included in the subscriptionId.\r\n\r\n## How did you implement it:\r\n\r\nMost of the implementation is pretty straight-forward. As noted above, we should *only* allow a Subscription to be updated if the CORS config is being changed, as the rest of the Subscription data is included in the subscriptionID. If you're changing one of those elements, you're not updating a Subscription but rather creating a new Subscription.\r\n\r\nTo handle this check, I [generate a subscriptionID and compare it against the existing subscriptionID](https://github.com/serverless/event-gateway/blob/5244dd891cb91ee86e0efe0d2fd14739005517e6/libkv/subscription.go#L75-L81). If they're different, I throw an error. I thought this would be better than explicitly checking for CORS changes or otherwise comparing the update to the existing.\r\n\r\nOnce this approach is confirmed, I'll add tests.\r\n\r\n## How can we verify it:\r\n\r\nPending confirmation.\r\n\r\n## Todos:\r\n\r\n- [ ] Write tests\r\n- [ ] Write documentation\r\n- [ ] Fix linting errors\r\n- [ ] Make sure code coverage hasn't dropped\r\n- [ ] Provide verification commands / resources\r\n- [ ] Enable \"Allow edits from maintainers\" for this PR\r\n- [ ] Update the messages below\r\n\r\n***Is this ready for review?:*** NO\r\n***Is it a breaking change?:*** NO","created_at":"2018-03-23T22:04:35Z","updated_at":"2018-03-23T22:04:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/serverless/event-gateway/pulls/398/commits","review_comments_url":"https://api.github.com/repos/serverless/event-gateway/pulls/398/comments","review_comment_url":"https://api.github.com/repos/serverless/event-gateway/pulls/comments{/number}","comments_url":"https://api.github.com/repos/serverless/event-gateway/issues/398/comments","statuses_url":"https://api.github.com/repos/serverless/event-gateway/statuses/5244dd891cb91ee86e0efe0d2fd14739005517e6","head":{"label":"serverless:UpdateSubscription","ref":"UpdateSubscription","sha":"5244dd891cb91ee86e0efe0d2fd14739005517e6","user":{"login":"serverless","id":13742415,"avatar_url":"https://avatars0.githubusercontent.com/u/13742415?v=4","gravatar_id":"","url":"https://api.github.com/users/serverless","html_url":"https://github.com/serverless","followers_url":"https://api.github.com/users/serverless/followers","following_url":"https://api.github.com/users/serverless/following{/other_user}","gists_url":"https://api.github.com/users/serverless/gists{/gist_id}","starred_url":"https://api.github.com/users/serverless/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/serverless/subscriptions","organizations_url":"https://api.github.com/users/serverless/orgs","repos_url":"https://api.github.com/users/serverless/repos","events_url":"https://api.github.com/users/serverless/events{/privacy}","received_events_url":"https://api.github.com/users/serverless/received_events","type":"Organization","site_admin":false},"repo":{"id":90390933,"name":"event-gateway","full_name":"serverless/event-gateway","owner":{"login":"serverless","id":13742415,"avatar_url":"https://avatars0.githubusercontent.com/u/13742415?v=4","gravatar_id":"","url":"https://api.github.com/users/serverless","html_url":"https://github.com/serverless","followers_url":"https://api.github.com/users/serverless/followers","following_url":"https://api.github.com/users/serverless/following{/other_user}","gists_url":"https://api.github.com/users/serverless/gists{/gist_id}","starred_url":"https://api.github.com/users/serverless/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/serverless/subscriptions","organizations_url":"https://api.github.com/users/serverless/orgs","repos_url":"https://api.github.com/users/serverless/repos","events_url":"https://api.github.com/users/serverless/events{/privacy}","received_events_url":"https://api.github.com/users/serverless/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/serverless/event-gateway","description":"The Event Gateway combines both API Gateway and Pub/Sub functionality into a single event-driven experience.","fork":false,"url":"https://api.github.com/repos/serverless/event-gateway","forks_url":"https://api.github.com/repos/serverless/event-gateway/forks","keys_url":"https://api.github.com/repos/serverless/event-gateway/keys{/key_id}","collaborators_url":"https://api.github.com/repos/serverless/event-gateway/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/serverless/event-gateway/teams","hooks_url":"https://api.github.com/repos/serverless/event-gateway/hooks","issue_events_url":"https://api.github.com/repos/serverless/event-gateway/issues/events{/number}","events_url":"https://api.github.com/repos/serverless/event-gateway/events","assignees_url":"https://api.github.com/repos/serverless/event-gateway/assignees{/user}","branches_url":"https://api.github.com/repos/serverless/event-gateway/branches{/branch}","tags_url":"https://api.github.com/repos/serverless/event-gateway/tags","blobs_url":"https://api.github.com/repos/serverless/event-gateway/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/serverless/event-gateway/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/serverless/event-gateway/git/refs{/sha}","trees_url":"https://api.github.com/repos/serverless/event-gateway/git/trees{/sha}","statuses_url":"https://api.github.com/repos/serverless/event-gateway/statuses/{sha}","languages_url":"https://api.github.com/repos/serverless/event-gateway/languages","stargazers_url":"https://api.github.com/repos/serverless/event-gateway/stargazers","contributors_url":"https://api.github.com/repos/serverless/event-gateway/contributors","subscribers_url":"https://api.github.com/repos/serverless/event-gateway/subscribers","subscription_url":"https://api.github.com/repos/serverless/event-gateway/subscription","commits_url":"https://api.github.com/repos/serverless/event-gateway/commits{/sha}","git_commits_url":"https://api.github.com/repos/serverless/event-gateway/git/commits{/sha}","comments_url":"https://api.github.com/repos/serverless/event-gateway/comments{/number}","issue_comment_url":"https://api.github.com/repos/serverless/event-gateway/issues/comments{/number}","contents_url":"https://api.github.com/repos/serverless/event-gateway/contents/{+path}","compare_url":"https://api.github.com/repos/serverless/event-gateway/compare/{base}...{head}","merges_url":"https://api.github.com/repos/serverless/event-gateway/merges","archive_url":"https://api.github.com/repos/serverless/event-gateway/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/serverless/event-gateway/downloads","issues_url":"https://api.github.com/repos/serverless/event-gateway/issues{/number}","pulls_url":"https://api.github.com/repos/serverless/event-gateway/pulls{/number}","milestones_url":"https://api.github.com/repos/serverless/event-gateway/milestones{/number}","notifications_url":"https://api.github.com/repos/serverless/event-gateway/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/serverless/event-gateway/labels{/name}","releases_url":"https://api.github.com/repos/serverless/event-gateway/releases{/id}","deployments_url":"https://api.github.com/repos/serverless/event-gateway/deployments","created_at":"2017-05-05T15:33:42Z","updated_at":"2018-03-23T21:31:43Z","pushed_at":"2018-03-23T21:58:16Z","git_url":"git://github.com/serverless/event-gateway.git","ssh_url":"git@github.com:serverless/event-gateway.git","clone_url":"https://github.com/serverless/event-gateway.git","svn_url":"https://github.com/serverless/event-gateway","homepage":"","size":826,"stargazers_count":1054,"watchers_count":1054,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":45,"mirror_url":null,"archived":false,"open_issues_count":42,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":45,"open_issues":42,"watchers":1054,"default_branch":"master"}},"base":{"label":"serverless:master","ref":"master","sha":"c9090550355f2a045cb88efe3462bb44c9eda62a","user":{"login":"serverless","id":13742415,"avatar_url":"https://avatars0.githubusercontent.com/u/13742415?v=4","gravatar_id":"","url":"https://api.github.com/users/serverless","html_url":"https://github.com/serverless","followers_url":"https://api.github.com/users/serverless/followers","following_url":"https://api.github.com/users/serverless/following{/other_user}","gists_url":"https://api.github.com/users/serverless/gists{/gist_id}","starred_url":"https://api.github.com/users/serverless/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/serverless/subscriptions","organizations_url":"https://api.github.com/users/serverless/orgs","repos_url":"https://api.github.com/users/serverless/repos","events_url":"https://api.github.com/users/serverless/events{/privacy}","received_events_url":"https://api.github.com/users/serverless/received_events","type":"Organization","site_admin":false},"repo":{"id":90390933,"name":"event-gateway","full_name":"serverless/event-gateway","owner":{"login":"serverless","id":13742415,"avatar_url":"https://avatars0.githubusercontent.com/u/13742415?v=4","gravatar_id":"","url":"https://api.github.com/users/serverless","html_url":"https://github.com/serverless","followers_url":"https://api.github.com/users/serverless/followers","following_url":"https://api.github.com/users/serverless/following{/other_user}","gists_url":"https://api.github.com/users/serverless/gists{/gist_id}","starred_url":"https://api.github.com/users/serverless/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/serverless/subscriptions","organizations_url":"https://api.github.com/users/serverless/orgs","repos_url":"https://api.github.com/users/serverless/repos","events_url":"https://api.github.com/users/serverless/events{/privacy}","received_events_url":"https://api.github.com/users/serverless/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/serverless/event-gateway","description":"The Event Gateway combines both API Gateway and Pub/Sub functionality into a single event-driven experience.","fork":false,"url":"https://api.github.com/repos/serverless/event-gateway","forks_url":"https://api.github.com/repos/serverless/event-gateway/forks","keys_url":"https://api.github.com/repos/serverless/event-gateway/keys{/key_id}","collaborators_url":"https://api.github.com/repos/serverless/event-gateway/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/serverless/event-gateway/teams","hooks_url":"https://api.github.com/repos/serverless/event-gateway/hooks","issue_events_url":"https://api.github.com/repos/serverless/event-gateway/issues/events{/number}","events_url":"https://api.github.com/repos/serverless/event-gateway/events","assignees_url":"https://api.github.com/repos/serverless/event-gateway/assignees{/user}","branches_url":"https://api.github.com/repos/serverless/event-gateway/branches{/branch}","tags_url":"https://api.github.com/repos/serverless/event-gateway/tags","blobs_url":"https://api.github.com/repos/serverless/event-gateway/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/serverless/event-gateway/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/serverless/event-gateway/git/refs{/sha}","trees_url":"https://api.github.com/repos/serverless/event-gateway/git/trees{/sha}","statuses_url":"https://api.github.com/repos/serverless/event-gateway/statuses/{sha}","languages_url":"https://api.github.com/repos/serverless/event-gateway/languages","stargazers_url":"https://api.github.com/repos/serverless/event-gateway/stargazers","contributors_url":"https://api.github.com/repos/serverless/event-gateway/contributors","subscribers_url":"https://api.github.com/repos/serverless/event-gateway/subscribers","subscription_url":"https://api.github.com/repos/serverless/event-gateway/subscription","commits_url":"https://api.github.com/repos/serverless/event-gateway/commits{/sha}","git_commits_url":"https://api.github.com/repos/serverless/event-gateway/git/commits{/sha}","comments_url":"https://api.github.com/repos/serverless/event-gateway/comments{/number}","issue_comment_url":"https://api.github.com/repos/serverless/event-gateway/issues/comments{/number}","contents_url":"https://api.github.com/repos/serverless/event-gateway/contents/{+path}","compare_url":"https://api.github.com/repos/serverless/event-gateway/compare/{base}...{head}","merges_url":"https://api.github.com/repos/serverless/event-gateway/merges","archive_url":"https://api.github.com/repos/serverless/event-gateway/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/serverless/event-gateway/downloads","issues_url":"https://api.github.com/repos/serverless/event-gateway/issues{/number}","pulls_url":"https://api.github.com/repos/serverless/event-gateway/pulls{/number}","milestones_url":"https://api.github.com/repos/serverless/event-gateway/milestones{/number}","notifications_url":"https://api.github.com/repos/serverless/event-gateway/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/serverless/event-gateway/labels{/name}","releases_url":"https://api.github.com/repos/serverless/event-gateway/releases{/id}","deployments_url":"https://api.github.com/repos/serverless/event-gateway/deployments","created_at":"2017-05-05T15:33:42Z","updated_at":"2018-03-23T21:31:43Z","pushed_at":"2018-03-23T21:58:16Z","git_url":"git://github.com/serverless/event-gateway.git","ssh_url":"git@github.com:serverless/event-gateway.git","clone_url":"https://github.com/serverless/event-gateway.git","svn_url":"https://github.com/serverless/event-gateway","homepage":"","size":826,"stargazers_count":1054,"watchers_count":1054,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":45,"mirror_url":null,"archived":false,"open_issues_count":42,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":45,"open_issues":42,"watchers":1054,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/serverless/event-gateway/pulls/398"},"html":{"href":"https://github.com/serverless/event-gateway/pull/398"},"issue":{"href":"https://api.github.com/repos/serverless/event-gateway/issues/398"},"comments":{"href":"https://api.github.com/repos/serverless/event-gateway/issues/398/comments"},"review_comments":{"href":"https://api.github.com/repos/serverless/event-gateway/pulls/398/comments"},"review_comment":{"href":"https://api.github.com/repos/serverless/event-gateway/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/serverless/event-gateway/pulls/398/commits"},"statuses":{"href":"https://api.github.com/repos/serverless/event-gateway/statuses/5244dd891cb91ee86e0efe0d2fd14739005517e6"}},"author_association":"CONTRIBUTOR","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":false,"commits":1,"additions":96,"deletions":2,"changed_files":4}}
{"actor":{"display_login":"alexdebrie"}}