{"action":"created","comment":{"url":"https://api.github.com/repos/open-horizon/anax/pulls/comments/223192303","pull_request_review_id":162268442,"id":223192303,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMzE5MjMwMw==","diff_hunk":"@@ -128,8 +135,57 @@ func (pm *PatternManager) hasPattern(org string, pattern string) bool {\n \treturn false\n }\n \n-// Given a list of org/pattern pairs that this agbot is supported to be serving, take that list and\n-// convert it to map of maps (keyed by org and pattern name) to hold all the pattern metadata. This\n+// copy the given map of served patterns\n+func (pm *PatternManager) setServedPatterns(servedPatterns map[string]exchange.ServedPattern) {\n+\tpm.spMapLock.Lock()\n+\tdefer pm.spMapLock.Unlock()\n+\n+\t// copy the input map\n+\tpm.ServedPatterns = servedPatterns\n+}\n+\n+// chek if the agbot serves the given pattern or not.\n+func (pm *PatternManager) servePattern(pattern_org string, pattern string) bool {\n+\tfor _, sp := range pm.ServedPatterns {","path":"agreementbot/pattern_manager.go","position":52,"original_position":52,"commit_id":"24b9572a8136f3c8b46c1feeee5ba16e7537a60d","original_commit_id":"24b9572a8136f3c8b46c1feeee5ba16e7537a60d","user":{"login":"linggao","id":12394418,"node_id":"MDQ6VXNlcjEyMzk0NDE4","avatar_url":"https://avatars3.githubusercontent.com/u/12394418?v=4","gravatar_id":"","url":"https://api.github.com/users/linggao","html_url":"https://github.com/linggao","followers_url":"https://api.github.com/users/linggao/followers","following_url":"https://api.github.com/users/linggao/following{/other_user}","gists_url":"https://api.github.com/users/linggao/gists{/gist_id}","starred_url":"https://api.github.com/users/linggao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linggao/subscriptions","organizations_url":"https://api.github.com/users/linggao/orgs","repos_url":"https://api.github.com/users/linggao/repos","events_url":"https://api.github.com/users/linggao/events{/privacy}","received_events_url":"https://api.github.com/users/linggao/received_events","type":"User","site_admin":false},"body":"servePattern() is in the same same process with the setServedPatterns(). The only thing that runs in a different process is GetServedNodeOrgs() which has spMapLock already.  Thoug it is safe to add spMapLock in servePattern() and servePattern() just in case someday someone will cal them from a different process. So I will add spMapLock for them. ","created_at":"2018-10-06T19:58:41Z","updated_at":"2018-10-06T19:58:41Z","html_url":"https://github.com/open-horizon/anax/pull/691#discussion_r223192303","pull_request_url":"https://api.github.com/repos/open-horizon/anax/pulls/691","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/open-horizon/anax/pulls/comments/223192303"},"html":{"href":"https://github.com/open-horizon/anax/pull/691#discussion_r223192303"},"pull_request":{"href":"https://api.github.com/repos/open-horizon/anax/pulls/691"}},"in_reply_to_id":223131595},"pull_request":{"url":"https://api.github.com/repos/open-horizon/anax/pulls/691","id":220728458,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIwNzI4NDU4","html_url":"https://github.com/open-horizon/anax/pull/691","diff_url":"https://github.com/open-horizon/anax/pull/691.diff","patch_url":"https://github.com/open-horizon/anax/pull/691.patch","issue_url":"https://api.github.com/repos/open-horizon/anax/issues/691","number":691,"state":"open","locked":false,"title":"Issue 29A - Anax support using pattern in different org","user":{"login":"linggao","id":12394418,"node_id":"MDQ6VXNlcjEyMzk0NDE4","avatar_url":"https://avatars3.githubusercontent.com/u/12394418?v=4","gravatar_id":"","url":"https://api.github.com/users/linggao","html_url":"https://github.com/linggao","followers_url":"https://api.github.com/users/linggao/followers","following_url":"https://api.github.com/users/linggao/following{/other_user}","gists_url":"https://api.github.com/users/linggao/gists{/gist_id}","starred_url":"https://api.github.com/users/linggao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linggao/subscriptions","organizations_url":"https://api.github.com/users/linggao/orgs","repos_url":"https://api.github.com/users/linggao/repos","events_url":"https://api.github.com/users/linggao/events{/privacy}","received_events_url":"https://api.github.com/users/linggao/received_events","type":"User","site_admin":false},"body":"1. anax supports using patterns in different org. (issue 29A)\r\n2. agbot supports all pattern `*` for pattern name for served patterns. (issue 29D)","created_at":"2018-10-05T14:51:43Z","updated_at":"2018-10-06T19:58:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b0d984f42d739f795e08939fb485081e449f14d7","assignee":null,"assignees":[],"requested_reviewers":[{"login":"bmpotter","id":1944811,"node_id":"MDQ6VXNlcjE5NDQ4MTE=","avatar_url":"https://avatars1.githubusercontent.com/u/1944811?v=4","gravatar_id":"","url":"https://api.github.com/users/bmpotter","html_url":"https://github.com/bmpotter","followers_url":"https://api.github.com/users/bmpotter/followers","following_url":"https://api.github.com/users/bmpotter/following{/other_user}","gists_url":"https://api.github.com/users/bmpotter/gists{/gist_id}","starred_url":"https://api.github.com/users/bmpotter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmpotter/subscriptions","organizations_url":"https://api.github.com/users/bmpotter/orgs","repos_url":"https://api.github.com/users/bmpotter/repos","events_url":"https://api.github.com/users/bmpotter/events{/privacy}","received_events_url":"https://api.github.com/users/bmpotter/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/open-horizon/anax/pulls/691/commits","review_comments_url":"https://api.github.com/repos/open-horizon/anax/pulls/691/comments","review_comment_url":"https://api.github.com/repos/open-horizon/anax/pulls/comments{/number}","comments_url":"https://api.github.com/repos/open-horizon/anax/issues/691/comments","statuses_url":"https://api.github.com/repos/open-horizon/anax/statuses/24b9572a8136f3c8b46c1feeee5ba16e7537a60d","head":{"label":"linggao:feature/anax4","ref":"feature/anax4","sha":"24b9572a8136f3c8b46c1feeee5ba16e7537a60d","user":{"login":"linggao","id":12394418,"node_id":"MDQ6VXNlcjEyMzk0NDE4","avatar_url":"https://avatars3.githubusercontent.com/u/12394418?v=4","gravatar_id":"","url":"https://api.github.com/users/linggao","html_url":"https://github.com/linggao","followers_url":"https://api.github.com/users/linggao/followers","following_url":"https://api.github.com/users/linggao/following{/other_user}","gists_url":"https://api.github.com/users/linggao/gists{/gist_id}","starred_url":"https://api.github.com/users/linggao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linggao/subscriptions","organizations_url":"https://api.github.com/users/linggao/orgs","repos_url":"https://api.github.com/users/linggao/repos","events_url":"https://api.github.com/users/linggao/events{/privacy}","received_events_url":"https://api.github.com/users/linggao/received_events","type":"User","site_admin":false},"repo":{"id":71576137,"node_id":"MDEwOlJlcG9zaXRvcnk3MTU3NjEzNw==","name":"anax","full_name":"linggao/anax","private":false,"owner":{"login":"linggao","id":12394418,"node_id":"MDQ6VXNlcjEyMzk0NDE4","avatar_url":"https://avatars3.githubusercontent.com/u/12394418?v=4","gravatar_id":"","url":"https://api.github.com/users/linggao","html_url":"https://github.com/linggao","followers_url":"https://api.github.com/users/linggao/followers","following_url":"https://api.github.com/users/linggao/following{/other_user}","gists_url":"https://api.github.com/users/linggao/gists{/gist_id}","starred_url":"https://api.github.com/users/linggao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linggao/subscriptions","organizations_url":"https://api.github.com/users/linggao/orgs","repos_url":"https://api.github.com/users/linggao/repos","events_url":"https://api.github.com/users/linggao/events{/privacy}","received_events_url":"https://api.github.com/users/linggao/received_events","type":"User","site_admin":false},"html_url":"https://github.com/linggao/anax","description":" Horizon client control system","fork":true,"url":"https://api.github.com/repos/linggao/anax","forks_url":"https://api.github.com/repos/linggao/anax/forks","keys_url":"https://api.github.com/repos/linggao/anax/keys{/key_id}","collaborators_url":"https://api.github.com/repos/linggao/anax/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/linggao/anax/teams","hooks_url":"https://api.github.com/repos/linggao/anax/hooks","issue_events_url":"https://api.github.com/repos/linggao/anax/issues/events{/number}","events_url":"https://api.github.com/repos/linggao/anax/events","assignees_url":"https://api.github.com/repos/linggao/anax/assignees{/user}","branches_url":"https://api.github.com/repos/linggao/anax/branches{/branch}","tags_url":"https://api.github.com/repos/linggao/anax/tags","blobs_url":"https://api.github.com/repos/linggao/anax/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/linggao/anax/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/linggao/anax/git/refs{/sha}","trees_url":"https://api.github.com/repos/linggao/anax/git/trees{/sha}","statuses_url":"https://api.github.com/repos/linggao/anax/statuses/{sha}","languages_url":"https://api.github.com/repos/linggao/anax/languages","stargazers_url":"https://api.github.com/repos/linggao/anax/stargazers","contributors_url":"https://api.github.com/repos/linggao/anax/contributors","subscribers_url":"https://api.github.com/repos/linggao/anax/subscribers","subscription_url":"https://api.github.com/repos/linggao/anax/subscription","commits_url":"https://api.github.com/repos/linggao/anax/commits{/sha}","git_commits_url":"https://api.github.com/repos/linggao/anax/git/commits{/sha}","comments_url":"https://api.github.com/repos/linggao/anax/comments{/number}","issue_comment_url":"https://api.github.com/repos/linggao/anax/issues/comments{/number}","contents_url":"https://api.github.com/repos/linggao/anax/contents/{+path}","compare_url":"https://api.github.com/repos/linggao/anax/compare/{base}...{head}","merges_url":"https://api.github.com/repos/linggao/anax/merges","archive_url":"https://api.github.com/repos/linggao/anax/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/linggao/anax/downloads","issues_url":"https://api.github.com/repos/linggao/anax/issues{/number}","pulls_url":"https://api.github.com/repos/linggao/anax/pulls{/number}","milestones_url":"https://api.github.com/repos/linggao/anax/milestones{/number}","notifications_url":"https://api.github.com/repos/linggao/anax/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/linggao/anax/labels{/name}","releases_url":"https://api.github.com/repos/linggao/anax/releases{/id}","deployments_url":"https://api.github.com/repos/linggao/anax/deployments","created_at":"2016-10-21T15:09:56Z","updated_at":"2016-10-21T15:09:57Z","pushed_at":"2018-10-05T14:50:17Z","git_url":"git://github.com/linggao/anax.git","ssh_url":"git@github.com:linggao/anax.git","clone_url":"https://github.com/linggao/anax.git","svn_url":"https://github.com/linggao/anax","homepage":null,"size":9584,"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","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"open-horizon:master","ref":"master","sha":"fd02c63dbed111c9caa4c6458383cead7573568b","user":{"login":"open-horizon","id":22371287,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyMzcxMjg3","avatar_url":"https://avatars2.githubusercontent.com/u/22371287?v=4","gravatar_id":"","url":"https://api.github.com/users/open-horizon","html_url":"https://github.com/open-horizon","followers_url":"https://api.github.com/users/open-horizon/followers","following_url":"https://api.github.com/users/open-horizon/following{/other_user}","gists_url":"https://api.github.com/users/open-horizon/gists{/gist_id}","starred_url":"https://api.github.com/users/open-horizon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/open-horizon/subscriptions","organizations_url":"https://api.github.com/users/open-horizon/orgs","repos_url":"https://api.github.com/users/open-horizon/repos","events_url":"https://api.github.com/users/open-horizon/events{/privacy}","received_events_url":"https://api.github.com/users/open-horizon/received_events","type":"Organization","site_admin":false},"repo":{"id":70207795,"node_id":"MDEwOlJlcG9zaXRvcnk3MDIwNzc5NQ==","name":"anax","full_name":"open-horizon/anax","private":false,"owner":{"login":"open-horizon","id":22371287,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyMzcxMjg3","avatar_url":"https://avatars2.githubusercontent.com/u/22371287?v=4","gravatar_id":"","url":"https://api.github.com/users/open-horizon","html_url":"https://github.com/open-horizon","followers_url":"https://api.github.com/users/open-horizon/followers","following_url":"https://api.github.com/users/open-horizon/following{/other_user}","gists_url":"https://api.github.com/users/open-horizon/gists{/gist_id}","starred_url":"https://api.github.com/users/open-horizon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/open-horizon/subscriptions","organizations_url":"https://api.github.com/users/open-horizon/orgs","repos_url":"https://api.github.com/users/open-horizon/repos","events_url":"https://api.github.com/users/open-horizon/events{/privacy}","received_events_url":"https://api.github.com/users/open-horizon/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/open-horizon/anax","description":" Horizon client control system","fork":false,"url":"https://api.github.com/repos/open-horizon/anax","forks_url":"https://api.github.com/repos/open-horizon/anax/forks","keys_url":"https://api.github.com/repos/open-horizon/anax/keys{/key_id}","collaborators_url":"https://api.github.com/repos/open-horizon/anax/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/open-horizon/anax/teams","hooks_url":"https://api.github.com/repos/open-horizon/anax/hooks","issue_events_url":"https://api.github.com/repos/open-horizon/anax/issues/events{/number}","events_url":"https://api.github.com/repos/open-horizon/anax/events","assignees_url":"https://api.github.com/repos/open-horizon/anax/assignees{/user}","branches_url":"https://api.github.com/repos/open-horizon/anax/branches{/branch}","tags_url":"https://api.github.com/repos/open-horizon/anax/tags","blobs_url":"https://api.github.com/repos/open-horizon/anax/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/open-horizon/anax/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/open-horizon/anax/git/refs{/sha}","trees_url":"https://api.github.com/repos/open-horizon/anax/git/trees{/sha}","statuses_url":"https://api.github.com/repos/open-horizon/anax/statuses/{sha}","languages_url":"https://api.github.com/repos/open-horizon/anax/languages","stargazers_url":"https://api.github.com/repos/open-horizon/anax/stargazers","contributors_url":"https://api.github.com/repos/open-horizon/anax/contributors","subscribers_url":"https://api.github.com/repos/open-horizon/anax/subscribers","subscription_url":"https://api.github.com/repos/open-horizon/anax/subscription","commits_url":"https://api.github.com/repos/open-horizon/anax/commits{/sha}","git_commits_url":"https://api.github.com/repos/open-horizon/anax/git/commits{/sha}","comments_url":"https://api.github.com/repos/open-horizon/anax/comments{/number}","issue_comment_url":"https://api.github.com/repos/open-horizon/anax/issues/comments{/number}","contents_url":"https://api.github.com/repos/open-horizon/anax/contents/{+path}","compare_url":"https://api.github.com/repos/open-horizon/anax/compare/{base}...{head}","merges_url":"https://api.github.com/repos/open-horizon/anax/merges","archive_url":"https://api.github.com/repos/open-horizon/anax/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/open-horizon/anax/downloads","issues_url":"https://api.github.com/repos/open-horizon/anax/issues{/number}","pulls_url":"https://api.github.com/repos/open-horizon/anax/pulls{/number}","milestones_url":"https://api.github.com/repos/open-horizon/anax/milestones{/number}","notifications_url":"https://api.github.com/repos/open-horizon/anax/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/open-horizon/anax/labels{/name}","releases_url":"https://api.github.com/repos/open-horizon/anax/releases{/id}","deployments_url":"https://api.github.com/repos/open-horizon/anax/deployments","created_at":"2016-10-07T01:59:03Z","updated_at":"2018-10-03T14:52:16Z","pushed_at":"2018-10-05T14:51:44Z","git_url":"git://github.com/open-horizon/anax.git","ssh_url":"git@github.com:open-horizon/anax.git","clone_url":"https://github.com/open-horizon/anax.git","svn_url":"https://github.com/open-horizon/anax","homepage":null,"size":9553,"stargazers_count":7,"watchers_count":7,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"archived":false,"open_issues_count":58,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":6,"open_issues":58,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/open-horizon/anax/pulls/691"},"html":{"href":"https://github.com/open-horizon/anax/pull/691"},"issue":{"href":"https://api.github.com/repos/open-horizon/anax/issues/691"},"comments":{"href":"https://api.github.com/repos/open-horizon/anax/issues/691/comments"},"review_comments":{"href":"https://api.github.com/repos/open-horizon/anax/pulls/691/comments"},"review_comment":{"href":"https://api.github.com/repos/open-horizon/anax/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/open-horizon/anax/pulls/691/commits"},"statuses":{"href":"https://api.github.com/repos/open-horizon/anax/statuses/24b9572a8136f3c8b46c1feeee5ba16e7537a60d"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"linggao"}}