{"action":"created","comment":{"url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/pulls/comments/105346121","pull_request_review_id":26222291,"id":105346121,"diff_hunk":"@@ -50,11 +50,21 @@ func (dp *DefaultProcessor) execute(ctx context.Context, notifier Notifier, stat\n \t}\n \turl := \"gs://\" + bucket + \"/\" + name\n \n+\tservice := &WatchService{ctx}\n+\ttopic, err := service.topicFor(url)\n+\tif err != nil {\n+\t\treturn err\n+\t}\n+\tif topic == \"\" {\n+\t\tlog.Infof(ctx, \"No topic found for %q\", url)\n+\t\treturn nil","path":"processor.go","position":11,"original_position":11,"commit_id":"2704c967df95d110e6496924b2d7b0429e26dbf0","original_commit_id":"2704c967df95d110e6496924b2d7b0429e26dbf0","user":{"login":"minimum2scp","id":162862,"avatar_url":"https://avatars3.githubusercontent.com/u/162862?v=3","gravatar_id":"","url":"https://api.github.com/users/minimum2scp","html_url":"https://github.com/minimum2scp","followers_url":"https://api.github.com/users/minimum2scp/followers","following_url":"https://api.github.com/users/minimum2scp/following{/other_user}","gists_url":"https://api.github.com/users/minimum2scp/gists{/gist_id}","starred_url":"https://api.github.com/users/minimum2scp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/minimum2scp/subscriptions","organizations_url":"https://api.github.com/users/minimum2scp/orgs","repos_url":"https://api.github.com/users/minimum2scp/repos","events_url":"https://api.github.com/users/minimum2scp/events{/privacy}","received_events_url":"https://api.github.com/users/minimum2scp/received_events","type":"User","site_admin":false},"body":"At first I saw `return nil`, I thought it should return an error,\r\nbut I understand that it should not return an error to prevent OCN retry loop, is this correct?\r\n(ref: https://cloud.google.com/storage/docs/object-change-notification#_Reliable_Delivery)","created_at":"2017-03-10T07:54:54Z","updated_at":"2017-03-10T07:54:54Z","html_url":"https://github.com/groovenauts/blocks-gcs-watcher/pull/4#discussion_r105346121","pull_request_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/pulls/comments/105346121"},"html":{"href":"https://github.com/groovenauts/blocks-gcs-watcher/pull/4#discussion_r105346121"},"pull_request":{"href":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/pulls/4","id":110073584,"html_url":"https://github.com/groovenauts/blocks-gcs-watcher/pull/4","diff_url":"https://github.com/groovenauts/blocks-gcs-watcher/pull/4.diff","patch_url":"https://github.com/groovenauts/blocks-gcs-watcher/pull/4.patch","issue_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/issues/4","number":4,"state":"open","locked":false,"title":"Dispatch notifications to related topics","user":{"login":"akm","id":18912,"avatar_url":"https://avatars1.githubusercontent.com/u/18912?v=3","gravatar_id":"","url":"https://api.github.com/users/akm","html_url":"https://github.com/akm","followers_url":"https://api.github.com/users/akm/followers","following_url":"https://api.github.com/users/akm/following{/other_user}","gists_url":"https://api.github.com/users/akm/gists{/gist_id}","starred_url":"https://api.github.com/users/akm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akm/subscriptions","organizations_url":"https://api.github.com/users/akm/orgs","repos_url":"https://api.github.com/users/akm/repos","events_url":"https://api.github.com/users/akm/events{/privacy}","received_events_url":"https://api.github.com/users/akm/received_events","type":"User","site_admin":false},"body":"## Configration\r\n\r\nA configuration has the following fields:\r\n\r\n| Field | Type  | Description |\r\n|------|-------|-------------|\r\n|  Seq | int      | Order to find the topic for the updated file. |\r\n|  Pattern | string | [Regular Expression](https://github.com/google/re2/wiki/Syntax) to check the upload file URL |\r\n| Topic | string | pubsub topic like `projects/dummy-proj-999/topics/test1-topic` |\r\n\r\n### Screenshot\r\n\r\n![screen shot 2017-03-10 at 15 43 07](https://cloud.githubusercontent.com/assets/18912/23784949/62ad938e-05a8-11e7-86b7-53751c25b569.png)\r\n\r\n## Behavior\r\n\r\n1. `Cloud Storage` calls an HTTP request of [OCN](https://cloud.google.com/storage/docs/object-change-notification)\r\n2. `blocks-gcs-watcher` loads all configurations\r\n3. `blocks-gcs-watcher` sorts configurations in ascending order\r\n4. `blocks-gcs-watcher` check the file URL for each configurations\r\n  - if the URL matches the configuration Pattern\r\n    1. `blocks-gcs-watcher` publishes the message to the configuration Topic\r\n    2. `blocks-gcs-watcher` stops checking\r\n\r\n### Note\r\n\r\nNow `blocks-gcs-watcher` publishes 0 or 1 message per 1 OCN request.\r\nIf you want to publish messages to multiple topic, we have to modify this behavior.\r\n","created_at":"2017-03-10T07:13:54Z","updated_at":"2017-03-10T07:54:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"79b548109d3d75fedb310edf8105100b76c55c48","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/pulls/4/commits","review_comments_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/pulls/4/comments","review_comment_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/pulls/comments{/number}","comments_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/issues/4/comments","statuses_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/statuses/2704c967df95d110e6496924b2d7b0429e26dbf0","head":{"label":"groovenauts:features/dispatch_pipeline_by_pattern","ref":"features/dispatch_pipeline_by_pattern","sha":"2704c967df95d110e6496924b2d7b0429e26dbf0","user":{"login":"groovenauts","id":1589863,"avatar_url":"https://avatars1.githubusercontent.com/u/1589863?v=3","gravatar_id":"","url":"https://api.github.com/users/groovenauts","html_url":"https://github.com/groovenauts","followers_url":"https://api.github.com/users/groovenauts/followers","following_url":"https://api.github.com/users/groovenauts/following{/other_user}","gists_url":"https://api.github.com/users/groovenauts/gists{/gist_id}","starred_url":"https://api.github.com/users/groovenauts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/groovenauts/subscriptions","organizations_url":"https://api.github.com/users/groovenauts/orgs","repos_url":"https://api.github.com/users/groovenauts/repos","events_url":"https://api.github.com/users/groovenauts/events{/privacy}","received_events_url":"https://api.github.com/users/groovenauts/received_events","type":"Organization","site_admin":false},"repo":{"id":78105117,"name":"blocks-gcs-watcher","full_name":"groovenauts/blocks-gcs-watcher","owner":{"login":"groovenauts","id":1589863,"avatar_url":"https://avatars1.githubusercontent.com/u/1589863?v=3","gravatar_id":"","url":"https://api.github.com/users/groovenauts","html_url":"https://github.com/groovenauts","followers_url":"https://api.github.com/users/groovenauts/followers","following_url":"https://api.github.com/users/groovenauts/following{/other_user}","gists_url":"https://api.github.com/users/groovenauts/gists{/gist_id}","starred_url":"https://api.github.com/users/groovenauts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/groovenauts/subscriptions","organizations_url":"https://api.github.com/users/groovenauts/orgs","repos_url":"https://api.github.com/users/groovenauts/repos","events_url":"https://api.github.com/users/groovenauts/events{/privacy}","received_events_url":"https://api.github.com/users/groovenauts/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/groovenauts/blocks-gcs-watcher","description":null,"fork":false,"url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher","forks_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/forks","keys_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/keys{/key_id}","collaborators_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/teams","hooks_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/hooks","issue_events_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/issues/events{/number}","events_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/events","assignees_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/assignees{/user}","branches_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/branches{/branch}","tags_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/tags","blobs_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/git/refs{/sha}","trees_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/git/trees{/sha}","statuses_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/statuses/{sha}","languages_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/languages","stargazers_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/stargazers","contributors_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/contributors","subscribers_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/subscribers","subscription_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/subscription","commits_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/commits{/sha}","git_commits_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/git/commits{/sha}","comments_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/comments{/number}","issue_comment_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/issues/comments{/number}","contents_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/contents/{+path}","compare_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/compare/{base}...{head}","merges_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/merges","archive_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/downloads","issues_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/issues{/number}","pulls_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/pulls{/number}","milestones_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/milestones{/number}","notifications_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/labels{/name}","releases_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/releases{/id}","deployments_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/deployments","created_at":"2017-01-05T10:51:55Z","updated_at":"2017-01-17T10:41:44Z","pushed_at":"2017-03-10T07:13:55Z","git_url":"git://github.com/groovenauts/blocks-gcs-watcher.git","ssh_url":"git@github.com:groovenauts/blocks-gcs-watcher.git","clone_url":"https://github.com/groovenauts/blocks-gcs-watcher.git","svn_url":"https://github.com/groovenauts/blocks-gcs-watcher","homepage":null,"size":62,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"groovenauts:master","ref":"master","sha":"abc2b0a6a871c8df5334b8b6d7e4f7c9f27e88f7","user":{"login":"groovenauts","id":1589863,"avatar_url":"https://avatars1.githubusercontent.com/u/1589863?v=3","gravatar_id":"","url":"https://api.github.com/users/groovenauts","html_url":"https://github.com/groovenauts","followers_url":"https://api.github.com/users/groovenauts/followers","following_url":"https://api.github.com/users/groovenauts/following{/other_user}","gists_url":"https://api.github.com/users/groovenauts/gists{/gist_id}","starred_url":"https://api.github.com/users/groovenauts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/groovenauts/subscriptions","organizations_url":"https://api.github.com/users/groovenauts/orgs","repos_url":"https://api.github.com/users/groovenauts/repos","events_url":"https://api.github.com/users/groovenauts/events{/privacy}","received_events_url":"https://api.github.com/users/groovenauts/received_events","type":"Organization","site_admin":false},"repo":{"id":78105117,"name":"blocks-gcs-watcher","full_name":"groovenauts/blocks-gcs-watcher","owner":{"login":"groovenauts","id":1589863,"avatar_url":"https://avatars1.githubusercontent.com/u/1589863?v=3","gravatar_id":"","url":"https://api.github.com/users/groovenauts","html_url":"https://github.com/groovenauts","followers_url":"https://api.github.com/users/groovenauts/followers","following_url":"https://api.github.com/users/groovenauts/following{/other_user}","gists_url":"https://api.github.com/users/groovenauts/gists{/gist_id}","starred_url":"https://api.github.com/users/groovenauts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/groovenauts/subscriptions","organizations_url":"https://api.github.com/users/groovenauts/orgs","repos_url":"https://api.github.com/users/groovenauts/repos","events_url":"https://api.github.com/users/groovenauts/events{/privacy}","received_events_url":"https://api.github.com/users/groovenauts/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/groovenauts/blocks-gcs-watcher","description":null,"fork":false,"url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher","forks_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/forks","keys_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/keys{/key_id}","collaborators_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/teams","hooks_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/hooks","issue_events_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/issues/events{/number}","events_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/events","assignees_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/assignees{/user}","branches_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/branches{/branch}","tags_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/tags","blobs_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/git/refs{/sha}","trees_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/git/trees{/sha}","statuses_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/statuses/{sha}","languages_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/languages","stargazers_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/stargazers","contributors_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/contributors","subscribers_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/subscribers","subscription_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/subscription","commits_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/commits{/sha}","git_commits_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/git/commits{/sha}","comments_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/comments{/number}","issue_comment_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/issues/comments{/number}","contents_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/contents/{+path}","compare_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/compare/{base}...{head}","merges_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/merges","archive_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/downloads","issues_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/issues{/number}","pulls_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/pulls{/number}","milestones_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/milestones{/number}","notifications_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/labels{/name}","releases_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/releases{/id}","deployments_url":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/deployments","created_at":"2017-01-05T10:51:55Z","updated_at":"2017-01-17T10:41:44Z","pushed_at":"2017-03-10T07:13:55Z","git_url":"git://github.com/groovenauts/blocks-gcs-watcher.git","ssh_url":"git@github.com:groovenauts/blocks-gcs-watcher.git","clone_url":"https://github.com/groovenauts/blocks-gcs-watcher.git","svn_url":"https://github.com/groovenauts/blocks-gcs-watcher","homepage":null,"size":62,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/pulls/4"},"html":{"href":"https://github.com/groovenauts/blocks-gcs-watcher/pull/4"},"issue":{"href":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/issues/4"},"comments":{"href":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/groovenauts/blocks-gcs-watcher/statuses/2704c967df95d110e6496924b2d7b0429e26dbf0"}}}}
{"actor":{"display_login":"minimum2scp"}}