{"action":"created","comment":{"url":"https://api.github.com/repos/arquillian/ike-prow-plugins/pulls/comments/180127073","pull_request_review_id":110481197,"id":180127073,"diff_hunk":"@@ -47,7 +49,13 @@ func ExpectPayload(payloadAssert func(payload map[string]interface{}) bool) gock\n \t\t}\n \t\tvar payload map[string]interface{}\n \t\terr = json.Unmarshal(body, &payload)\n-\t\tpayloadExpectations := payloadAssert(payload)\n+\t\tvar payloadExpectations bool\n+\t\tfor _, assertion := range payloadAssert {\n+\t\t\tpayloadExpectations = assertion(payload)\n+\t\t\tif !payloadExpectations {\n+\t\t\t\tbreak","path":"pkg/internal/test/test_doubles.go","position":35,"original_position":35,"commit_id":"6b52b207de952713b0f60408375159283bb46e97","original_commit_id":"5b15ba68523cb57eb2a47d2f19fcf0666e0cdddb","user":{"login":"bartoszmajsak","id":719616,"avatar_url":"https://avatars1.githubusercontent.com/u/719616?v=4","gravatar_id":"","url":"https://api.github.com/users/bartoszmajsak","html_url":"https://github.com/bartoszmajsak","followers_url":"https://api.github.com/users/bartoszmajsak/followers","following_url":"https://api.github.com/users/bartoszmajsak/following{/other_user}","gists_url":"https://api.github.com/users/bartoszmajsak/gists{/gist_id}","starred_url":"https://api.github.com/users/bartoszmajsak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bartoszmajsak/subscriptions","organizations_url":"https://api.github.com/users/bartoszmajsak/orgs","repos_url":"https://api.github.com/users/bartoszmajsak/repos","events_url":"https://api.github.com/users/bartoszmajsak/events{/privacy}","received_events_url":"https://api.github.com/users/bartoszmajsak/received_events","type":"User","site_admin":false},"body":"I was wondering - would it make sense to make it a \"soft assertion\" instead?","created_at":"2018-04-09T15:08:34Z","updated_at":"2018-04-09T15:17:34Z","html_url":"https://github.com/arquillian/ike-prow-plugins/pull/89#discussion_r180127073","pull_request_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/pulls/89","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/arquillian/ike-prow-plugins/pulls/comments/180127073"},"html":{"href":"https://github.com/arquillian/ike-prow-plugins/pull/89#discussion_r180127073"},"pull_request":{"href":"https://api.github.com/repos/arquillian/ike-prow-plugins/pulls/89"}}},"pull_request":{"url":"https://api.github.com/repos/arquillian/ike-prow-plugins/pulls/89","id":179935580,"html_url":"https://github.com/arquillian/ike-prow-plugins/pull/89","diff_url":"https://github.com/arquillian/ike-prow-plugins/pull/89.diff","patch_url":"https://github.com/arquillian/ike-prow-plugins/pull/89.patch","issue_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/issues/89","number":89,"state":"open","locked":false,"title":"feat(#73): bypassing test check is possible also for reviewers but not PR creator","user":{"login":"MatousJobanek","id":1510709,"avatar_url":"https://avatars3.githubusercontent.com/u/1510709?v=4","gravatar_id":"","url":"https://api.github.com/users/MatousJobanek","html_url":"https://github.com/MatousJobanek","followers_url":"https://api.github.com/users/MatousJobanek/followers","following_url":"https://api.github.com/users/MatousJobanek/following{/other_user}","gists_url":"https://api.github.com/users/MatousJobanek/gists{/gist_id}","starred_url":"https://api.github.com/users/MatousJobanek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MatousJobanek/subscriptions","organizations_url":"https://api.github.com/users/MatousJobanek/orgs","repos_url":"https://api.github.com/users/MatousJobanek/repos","events_url":"https://api.github.com/users/MatousJobanek/events{/privacy}","received_events_url":"https://api.github.com/users/MatousJobanek/received_events","type":"User","site_admin":false},"body":"* restricted bypassing test check to admin or requested reviewer but not PR creator\r\n* added new abstractions:\r\n  * `CommentCmd` is a abstraction of particular comment command. Has two methods:\r\n    * `Perform` that evaluates and executes the command logic itself\r\n    * `Matches` that returns true when comment content matches the expected command\r\n  * `CommentCmdHandler` that can register multiple `CommentCmd` implementations and then handle a comment event against these commands\r\n    * performs only those comment commands that match the comment content\r\n  * `CmdExecutor` - provides an API for setting restrictions and providing a function that should be executed when the restrictions are fulfilled. When the permission restrictions are not met, then it logs a `WARN` with the generated message and if the mode is not quite, then also adds the comment to the PR. Restrictions that can be set are:\r\n     * actions - for which events the command should be triggered - eg.: `When(is.Triggered)`\r\n     * permissions - who can trigger the command - eg.:`By(is.AnyOf(user.ThatIsAdmin, user.ThatIsPRReviewer), is.Not(user.ThatIsPRCreator))`\r\n* Added lazy loading of PRs - see `PullRequestLoader`. The reason is to avoid sending requests when they are not needed (comment content or the actions are not matched). So the PR information is loaded only when needed and only once.\r\n* added tests and changed docs\r\n* changed time sleep in default GH client used in tests to one nanosecond - this will make the tests a bit faster :-)\r\n\r\nNote: I know that the naming is probably are not the best - I'm open to any proposals. Complications that I was facing were:\r\n* I had to name the directory `command` because `cmd` is for `main.go` file\r\n* When I have `command` directory then the structs cannot start with `Command` as I had originally, so that's why they contains `Cmd` instead\r\n* reason for naming the import\r\n `is \"github.com/arquillian/ike-prow-plugins/pkg/command\"`\r\n is fluent reading of the code\r\n\r\nFixes: #73 \r\n    ","created_at":"2018-04-06T12:33:39Z","updated_at":"2018-04-09T15:17:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6e5ec826af6ae62112f430632a3e9996cde38b31","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":892576787,"url":"https://api.github.com/repos/arquillian/ike-prow-plugins/labels/size/XXL","name":"size/XXL","color":"ededed","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/pulls/89/commits","review_comments_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/pulls/89/comments","review_comment_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/pulls/comments{/number}","comments_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/issues/89/comments","statuses_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/statuses/6b52b207de952713b0f60408375159283bb46e97","head":{"label":"MatousJobanek:issue-73-permissions","ref":"issue-73-permissions","sha":"6b52b207de952713b0f60408375159283bb46e97","user":{"login":"MatousJobanek","id":1510709,"avatar_url":"https://avatars3.githubusercontent.com/u/1510709?v=4","gravatar_id":"","url":"https://api.github.com/users/MatousJobanek","html_url":"https://github.com/MatousJobanek","followers_url":"https://api.github.com/users/MatousJobanek/followers","following_url":"https://api.github.com/users/MatousJobanek/following{/other_user}","gists_url":"https://api.github.com/users/MatousJobanek/gists{/gist_id}","starred_url":"https://api.github.com/users/MatousJobanek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MatousJobanek/subscriptions","organizations_url":"https://api.github.com/users/MatousJobanek/orgs","repos_url":"https://api.github.com/users/MatousJobanek/repos","events_url":"https://api.github.com/users/MatousJobanek/events{/privacy}","received_events_url":"https://api.github.com/users/MatousJobanek/received_events","type":"User","site_admin":false},"repo":{"id":122996425,"name":"ike-prow-plugins","full_name":"MatousJobanek/ike-prow-plugins","owner":{"login":"MatousJobanek","id":1510709,"avatar_url":"https://avatars3.githubusercontent.com/u/1510709?v=4","gravatar_id":"","url":"https://api.github.com/users/MatousJobanek","html_url":"https://github.com/MatousJobanek","followers_url":"https://api.github.com/users/MatousJobanek/followers","following_url":"https://api.github.com/users/MatousJobanek/following{/other_user}","gists_url":"https://api.github.com/users/MatousJobanek/gists{/gist_id}","starred_url":"https://api.github.com/users/MatousJobanek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MatousJobanek/subscriptions","organizations_url":"https://api.github.com/users/MatousJobanek/orgs","repos_url":"https://api.github.com/users/MatousJobanek/repos","events_url":"https://api.github.com/users/MatousJobanek/events{/privacy}","received_events_url":"https://api.github.com/users/MatousJobanek/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/MatousJobanek/ike-prow-plugins","description":"Set of plugins for Prow automation platform","fork":true,"url":"https://api.github.com/repos/MatousJobanek/ike-prow-plugins","forks_url":"https://api.github.com/repos/MatousJobanek/ike-prow-plugins/forks","keys_url":"https://api.github.com/repos/MatousJobanek/ike-prow-plugins/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MatousJobanek/ike-prow-plugins/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MatousJobanek/ike-prow-plugins/teams","hooks_url":"https://api.github.com/repos/MatousJobanek/ike-prow-plugins/hooks","issue_events_url":"https://api.github.com/repos/MatousJobanek/ike-prow-plugins/issues/events{/number}","events_url":"https://api.github.com/repos/MatousJobanek/ike-prow-plugins/events","assignees_url":"https://api.github.com/repos/MatousJobanek/ike-prow-plugins/assignees{/user}","branches_url":"https://api.github.com/repos/MatousJobanek/ike-prow-plugins/branches{/branch}","tags_url":"https://api.github.com/repos/MatousJobanek/ike-prow-plugins/tags","blobs_url":"https://api.github.com/repos/MatousJobanek/ike-prow-plugins/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MatousJobanek/ike-prow-plugins/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MatousJobanek/ike-prow-plugins/git/refs{/sha}","trees_url":"https://api.github.com/repos/MatousJobanek/ike-prow-plugins/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MatousJobanek/ike-prow-plugins/statuses/{sha}","languages_url":"https://api.github.com/repos/MatousJobanek/ike-prow-plugins/languages","stargazers_url":"https://api.github.com/repos/MatousJobanek/ike-prow-plugins/stargazers","contributors_url":"https://api.github.com/repos/MatousJobanek/ike-prow-plugins/contributors","subscribers_url":"https://api.github.com/repos/MatousJobanek/ike-prow-plugins/subscribers","subscription_url":"https://api.github.com/repos/MatousJobanek/ike-prow-plugins/subscription","commits_url":"https://api.github.com/repos/MatousJobanek/ike-prow-plugins/commits{/sha}","git_commits_url":"https://api.github.com/repos/MatousJobanek/ike-prow-plugins/git/commits{/sha}","comments_url":"https://api.github.com/repos/MatousJobanek/ike-prow-plugins/comments{/number}","issue_comment_url":"https://api.github.com/repos/MatousJobanek/ike-prow-plugins/issues/comments{/number}","contents_url":"https://api.github.com/repos/MatousJobanek/ike-prow-plugins/contents/{+path}","compare_url":"https://api.github.com/repos/MatousJobanek/ike-prow-plugins/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MatousJobanek/ike-prow-plugins/merges","archive_url":"https://api.github.com/repos/MatousJobanek/ike-prow-plugins/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MatousJobanek/ike-prow-plugins/downloads","issues_url":"https://api.github.com/repos/MatousJobanek/ike-prow-plugins/issues{/number}","pulls_url":"https://api.github.com/repos/MatousJobanek/ike-prow-plugins/pulls{/number}","milestones_url":"https://api.github.com/repos/MatousJobanek/ike-prow-plugins/milestones{/number}","notifications_url":"https://api.github.com/repos/MatousJobanek/ike-prow-plugins/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MatousJobanek/ike-prow-plugins/labels{/name}","releases_url":"https://api.github.com/repos/MatousJobanek/ike-prow-plugins/releases{/id}","deployments_url":"https://api.github.com/repos/MatousJobanek/ike-prow-plugins/deployments","created_at":"2018-02-26T16:23:34Z","updated_at":"2018-04-06T09:17:00Z","pushed_at":"2018-04-09T15:13:39Z","git_url":"git://github.com/MatousJobanek/ike-prow-plugins.git","ssh_url":"git@github.com:MatousJobanek/ike-prow-plugins.git","clone_url":"https://github.com/MatousJobanek/ike-prow-plugins.git","svn_url":"https://github.com/MatousJobanek/ike-prow-plugins","homepage":null,"size":431,"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":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"arquillian:master","ref":"master","sha":"630f02881b38b8e1c098cf4b7c9a065ba781ff57","user":{"login":"arquillian","id":330981,"avatar_url":"https://avatars3.githubusercontent.com/u/330981?v=4","gravatar_id":"","url":"https://api.github.com/users/arquillian","html_url":"https://github.com/arquillian","followers_url":"https://api.github.com/users/arquillian/followers","following_url":"https://api.github.com/users/arquillian/following{/other_user}","gists_url":"https://api.github.com/users/arquillian/gists{/gist_id}","starred_url":"https://api.github.com/users/arquillian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arquillian/subscriptions","organizations_url":"https://api.github.com/users/arquillian/orgs","repos_url":"https://api.github.com/users/arquillian/repos","events_url":"https://api.github.com/users/arquillian/events{/privacy}","received_events_url":"https://api.github.com/users/arquillian/received_events","type":"Organization","site_admin":false},"repo":{"id":122952098,"name":"ike-prow-plugins","full_name":"arquillian/ike-prow-plugins","owner":{"login":"arquillian","id":330981,"avatar_url":"https://avatars3.githubusercontent.com/u/330981?v=4","gravatar_id":"","url":"https://api.github.com/users/arquillian","html_url":"https://github.com/arquillian","followers_url":"https://api.github.com/users/arquillian/followers","following_url":"https://api.github.com/users/arquillian/following{/other_user}","gists_url":"https://api.github.com/users/arquillian/gists{/gist_id}","starred_url":"https://api.github.com/users/arquillian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arquillian/subscriptions","organizations_url":"https://api.github.com/users/arquillian/orgs","repos_url":"https://api.github.com/users/arquillian/repos","events_url":"https://api.github.com/users/arquillian/events{/privacy}","received_events_url":"https://api.github.com/users/arquillian/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/arquillian/ike-prow-plugins","description":"Set of plugins for Prow automation platform","fork":false,"url":"https://api.github.com/repos/arquillian/ike-prow-plugins","forks_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/forks","keys_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/keys{/key_id}","collaborators_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/teams","hooks_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/hooks","issue_events_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/issues/events{/number}","events_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/events","assignees_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/assignees{/user}","branches_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/branches{/branch}","tags_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/tags","blobs_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/git/refs{/sha}","trees_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/git/trees{/sha}","statuses_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/statuses/{sha}","languages_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/languages","stargazers_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/stargazers","contributors_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/contributors","subscribers_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/subscribers","subscription_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/subscription","commits_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/commits{/sha}","git_commits_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/git/commits{/sha}","comments_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/comments{/number}","issue_comment_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/issues/comments{/number}","contents_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/contents/{+path}","compare_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/compare/{base}...{head}","merges_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/merges","archive_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/downloads","issues_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/issues{/number}","pulls_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/pulls{/number}","milestones_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/milestones{/number}","notifications_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/labels{/name}","releases_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/releases{/id}","deployments_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/deployments","created_at":"2018-02-26T10:17:01Z","updated_at":"2018-04-09T12:30:41Z","pushed_at":"2018-04-09T15:13:40Z","git_url":"git://github.com/arquillian/ike-prow-plugins.git","ssh_url":"git@github.com:arquillian/ike-prow-plugins.git","clone_url":"https://github.com/arquillian/ike-prow-plugins.git","svn_url":"https://github.com/arquillian/ike-prow-plugins","homepage":null,"size":445,"stargazers_count":2,"watchers_count":2,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":5,"mirror_url":null,"archived":false,"open_issues_count":32,"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":5,"open_issues":32,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/arquillian/ike-prow-plugins/pulls/89"},"html":{"href":"https://github.com/arquillian/ike-prow-plugins/pull/89"},"issue":{"href":"https://api.github.com/repos/arquillian/ike-prow-plugins/issues/89"},"comments":{"href":"https://api.github.com/repos/arquillian/ike-prow-plugins/issues/89/comments"},"review_comments":{"href":"https://api.github.com/repos/arquillian/ike-prow-plugins/pulls/89/comments"},"review_comment":{"href":"https://api.github.com/repos/arquillian/ike-prow-plugins/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/arquillian/ike-prow-plugins/pulls/89/commits"},"statuses":{"href":"https://api.github.com/repos/arquillian/ike-prow-plugins/statuses/6b52b207de952713b0f60408375159283bb46e97"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"bartoszmajsak"}}