{"action":"created","comment":{"url":"https://api.github.com/repos/intelsdi-x/snap-plugin-lib-go/pulls/comments/81186972","pull_request_review_id":2185632,"id":81186972,"diff_hunk":"@@ -31,65 +31,59 @@ import (\n func TestStringRule(t *testing.T) {\n \ttc := stringPassTestCases()\n \tConvey(\"Test stringRule Passes\", t, func() {\n-\t\tvar sr stringRule\n+\t\tp := NewConfigPolicy()\n \t\tvar err error\n \t\tfor _, c := range tc {\n \t\t\tConvey(fmt.Sprintf(\"Test stringRule %+v\", c.input.key), func() {\n \t\t\t\tif c.input.opts != nil {\n-\t\t\t\t\tsr, err = NewStringRule(c.input.key, c.input.req, c.input.opts)\n+\t\t\t\t\terr = p.AddNewStringRule(c.input.ns, c.input.key, c.input.req, c.input.opts)\n \t\t\t\t} else {\n-\t\t\t\t\tsr, err = NewStringRule(c.input.key, c.input.req)\n+\t\t\t\t\terr = p.AddNewStringRule(c.input.ns, c.input.key, c.input.req)\n \t\t\t\t}\n \t\t\t\tSo(err, ShouldBeNil)\n-\t\t\t\tSo(sr, ShouldResemble, c.expected)\n \t\t\t})\n \t\t}\n \t})\n \n \ttc = stringErrTestCases()\n \tConvey(\"Test stringRule Fails\", t, func() {\n-\t\tvar sr stringRule\n+\t\tp := NewConfigPolicy()\n \t\tvar err error\n \t\tfor _, c := range tc {\n \t\t\tif c.input.opts != nil {\n-\t\t\t\tsr, err = NewStringRule(c.input.key, c.input.req, c.input.opts)\n+\t\t\t\terr = p.AddNewStringRule(c.input.ns, c.input.key, c.input.req, c.input.opts)\n \t\t\t} else {\n-\t\t\t\tsr, err = NewStringRule(c.input.key, c.input.req)\n+\t\t\t\terr = p.AddNewStringRule(c.input.ns, c.input.key, c.input.req)\n \t\t\t}\n \t\t\tSo(err, ShouldNotBeNil)\n-\t\t\tSo(sr, ShouldResemble, c.expected)\n \t\t}\n \t})\n }\n \n type stringInput struct {\n+\tns   []string\n \tkey  string\n \treq  bool\n \topts stringRuleOpt\n }\n \n type testCaseString struct {\n-\texpected stringRule\n-\tinput    stringInput\n+\tinput stringInput\n }\n \n func stringPassTestCases() []testCaseString {\n \ttc := []testCaseString{\n \t\ttestCaseString{\n-\t\t\texpected: stringRule{Key: \"xyz\", Required: true},\n-\t\t\tinput:    stringInput{key: \"xyz\", req: true},\n+\t\t\tinput: stringInput{key: \"xyz\", req: true},","path":"v1/plugin/string_test.go","position":59,"original_position":59,"commit_id":"00b7922bc0162cb29bb6606bf64aa4e4bbd59026","original_commit_id":"00b7922bc0162cb29bb6606bf64aa4e4bbd59026","user":{"login":"candysmurf","id":13841563,"avatar_url":"https://avatars.githubusercontent.com/u/13841563?v=3","gravatar_id":"","url":"https://api.github.com/users/candysmurf","html_url":"https://github.com/candysmurf","followers_url":"https://api.github.com/users/candysmurf/followers","following_url":"https://api.github.com/users/candysmurf/following{/other_user}","gists_url":"https://api.github.com/users/candysmurf/gists{/gist_id}","starred_url":"https://api.github.com/users/candysmurf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/candysmurf/subscriptions","organizations_url":"https://api.github.com/users/candysmurf/orgs","repos_url":"https://api.github.com/users/candysmurf/repos","events_url":"https://api.github.com/users/candysmurf/events{/privacy}","received_events_url":"https://api.github.com/users/candysmurf/received_events","type":"User","site_admin":false},"body":"Shouldn't keep expected here?","created_at":"2016-09-29T17:13:53Z","updated_at":"2016-09-29T17:35:24Z","html_url":"https://github.com/intelsdi-x/snap-plugin-lib-go/pull/31#discussion_r81186972","pull_request_url":"https://api.github.com/repos/intelsdi-x/snap-plugin-lib-go/pulls/31","_links":{"self":{"href":"https://api.github.com/repos/intelsdi-x/snap-plugin-lib-go/pulls/comments/81186972"},"html":{"href":"https://github.com/intelsdi-x/snap-plugin-lib-go/pull/31#discussion_r81186972"},"pull_request":{"href":"https://api.github.com/repos/intelsdi-x/snap-plugin-lib-go/pulls/31"}}},"pull_request":{"url":"https://api.github.com/repos/intelsdi-x/snap-plugin-lib-go/pulls/31","id":87203929,"html_url":"https://github.com/intelsdi-x/snap-plugin-lib-go/pull/31","diff_url":"https://github.com/intelsdi-x/snap-plugin-lib-go/pull/31.diff","patch_url":"https://github.com/intelsdi-x/snap-plugin-lib-go/pull/31.patch","issue_url":"https://api.github.com/repos/intelsdi-x/snap-plugin-lib-go/issues/31","number":31,"state":"open","locked":false,"title":"AddNew<type>Rule() as default way to create a rule","user":{"login":"kindermoumoute","id":10092554,"avatar_url":"https://avatars.githubusercontent.com/u/10092554?v=3","gravatar_id":"","url":"https://api.github.com/users/kindermoumoute","html_url":"https://github.com/kindermoumoute","followers_url":"https://api.github.com/users/kindermoumoute/followers","following_url":"https://api.github.com/users/kindermoumoute/following{/other_user}","gists_url":"https://api.github.com/users/kindermoumoute/gists{/gist_id}","starred_url":"https://api.github.com/users/kindermoumoute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kindermoumoute/subscriptions","organizations_url":"https://api.github.com/users/kindermoumoute/orgs","repos_url":"https://api.github.com/users/kindermoumoute/repos","events_url":"https://api.github.com/users/kindermoumoute/events{/privacy}","received_events_url":"https://api.github.com/users/kindermoumoute/received_events","type":"User","site_admin":false},"body":"This commit changes 3 things that are linked:\r\n- Fixes issue that was overwriting a same type rule when it was using a\r\ncommon key.\r\n- Change ConfigPolicy structure. Fields are now private and use\r\nsame types than rpc ConfigPolicy.\r\n- Mix `New<typeRule()` and `Add<type>Rule()` in one function:\r\n`AddNew<type>Rule()`.","created_at":"2016-09-28T21:20:23Z","updated_at":"2016-09-29T17:35:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bccbfe65dac882a93cdba844669038ffa757c898","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/intelsdi-x/snap-plugin-lib-go/pulls/31/commits","review_comments_url":"https://api.github.com/repos/intelsdi-x/snap-plugin-lib-go/pulls/31/comments","review_comment_url":"https://api.github.com/repos/intelsdi-x/snap-plugin-lib-go/pulls/comments{/number}","comments_url":"https://api.github.com/repos/intelsdi-x/snap-plugin-lib-go/issues/31/comments","statuses_url":"https://api.github.com/repos/intelsdi-x/snap-plugin-lib-go/statuses/00b7922bc0162cb29bb6606bf64aa4e4bbd59026","head":{"label":"kindermoumoute:fix_glitch_and_new_feature","ref":"fix_glitch_and_new_feature","sha":"00b7922bc0162cb29bb6606bf64aa4e4bbd59026","user":{"login":"kindermoumoute","id":10092554,"avatar_url":"https://avatars.githubusercontent.com/u/10092554?v=3","gravatar_id":"","url":"https://api.github.com/users/kindermoumoute","html_url":"https://github.com/kindermoumoute","followers_url":"https://api.github.com/users/kindermoumoute/followers","following_url":"https://api.github.com/users/kindermoumoute/following{/other_user}","gists_url":"https://api.github.com/users/kindermoumoute/gists{/gist_id}","starred_url":"https://api.github.com/users/kindermoumoute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kindermoumoute/subscriptions","organizations_url":"https://api.github.com/users/kindermoumoute/orgs","repos_url":"https://api.github.com/users/kindermoumoute/repos","events_url":"https://api.github.com/users/kindermoumoute/events{/privacy}","received_events_url":"https://api.github.com/users/kindermoumoute/received_events","type":"User","site_admin":false},"repo":{"id":69503763,"name":"snap-plugin-lib-go","full_name":"kindermoumoute/snap-plugin-lib-go","owner":{"login":"kindermoumoute","id":10092554,"avatar_url":"https://avatars.githubusercontent.com/u/10092554?v=3","gravatar_id":"","url":"https://api.github.com/users/kindermoumoute","html_url":"https://github.com/kindermoumoute","followers_url":"https://api.github.com/users/kindermoumoute/followers","following_url":"https://api.github.com/users/kindermoumoute/following{/other_user}","gists_url":"https://api.github.com/users/kindermoumoute/gists{/gist_id}","starred_url":"https://api.github.com/users/kindermoumoute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kindermoumoute/subscriptions","organizations_url":"https://api.github.com/users/kindermoumoute/orgs","repos_url":"https://api.github.com/users/kindermoumoute/repos","events_url":"https://api.github.com/users/kindermoumoute/events{/privacy}","received_events_url":"https://api.github.com/users/kindermoumoute/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kindermoumoute/snap-plugin-lib-go","description":null,"fork":true,"url":"https://api.github.com/repos/kindermoumoute/snap-plugin-lib-go","forks_url":"https://api.github.com/repos/kindermoumoute/snap-plugin-lib-go/forks","keys_url":"https://api.github.com/repos/kindermoumoute/snap-plugin-lib-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kindermoumoute/snap-plugin-lib-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kindermoumoute/snap-plugin-lib-go/teams","hooks_url":"https://api.github.com/repos/kindermoumoute/snap-plugin-lib-go/hooks","issue_events_url":"https://api.github.com/repos/kindermoumoute/snap-plugin-lib-go/issues/events{/number}","events_url":"https://api.github.com/repos/kindermoumoute/snap-plugin-lib-go/events","assignees_url":"https://api.github.com/repos/kindermoumoute/snap-plugin-lib-go/assignees{/user}","branches_url":"https://api.github.com/repos/kindermoumoute/snap-plugin-lib-go/branches{/branch}","tags_url":"https://api.github.com/repos/kindermoumoute/snap-plugin-lib-go/tags","blobs_url":"https://api.github.com/repos/kindermoumoute/snap-plugin-lib-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kindermoumoute/snap-plugin-lib-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kindermoumoute/snap-plugin-lib-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/kindermoumoute/snap-plugin-lib-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kindermoumoute/snap-plugin-lib-go/statuses/{sha}","languages_url":"https://api.github.com/repos/kindermoumoute/snap-plugin-lib-go/languages","stargazers_url":"https://api.github.com/repos/kindermoumoute/snap-plugin-lib-go/stargazers","contributors_url":"https://api.github.com/repos/kindermoumoute/snap-plugin-lib-go/contributors","subscribers_url":"https://api.github.com/repos/kindermoumoute/snap-plugin-lib-go/subscribers","subscription_url":"https://api.github.com/repos/kindermoumoute/snap-plugin-lib-go/subscription","commits_url":"https://api.github.com/repos/kindermoumoute/snap-plugin-lib-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/kindermoumoute/snap-plugin-lib-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/kindermoumoute/snap-plugin-lib-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/kindermoumoute/snap-plugin-lib-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/kindermoumoute/snap-plugin-lib-go/contents/{+path}","compare_url":"https://api.github.com/repos/kindermoumoute/snap-plugin-lib-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kindermoumoute/snap-plugin-lib-go/merges","archive_url":"https://api.github.com/repos/kindermoumoute/snap-plugin-lib-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kindermoumoute/snap-plugin-lib-go/downloads","issues_url":"https://api.github.com/repos/kindermoumoute/snap-plugin-lib-go/issues{/number}","pulls_url":"https://api.github.com/repos/kindermoumoute/snap-plugin-lib-go/pulls{/number}","milestones_url":"https://api.github.com/repos/kindermoumoute/snap-plugin-lib-go/milestones{/number}","notifications_url":"https://api.github.com/repos/kindermoumoute/snap-plugin-lib-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kindermoumoute/snap-plugin-lib-go/labels{/name}","releases_url":"https://api.github.com/repos/kindermoumoute/snap-plugin-lib-go/releases{/id}","deployments_url":"https://api.github.com/repos/kindermoumoute/snap-plugin-lib-go/deployments","created_at":"2016-09-28T21:06:52Z","updated_at":"2016-09-28T21:06:53Z","pushed_at":"2016-09-28T22:26:13Z","git_url":"git://github.com/kindermoumoute/snap-plugin-lib-go.git","ssh_url":"git@github.com:kindermoumoute/snap-plugin-lib-go.git","clone_url":"https://github.com/kindermoumoute/snap-plugin-lib-go.git","svn_url":"https://github.com/kindermoumoute/snap-plugin-lib-go","homepage":null,"size":86,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"intelsdi-x:master","ref":"master","sha":"55956e53732655f4875708b15c25904090af41ec","user":{"login":"intelsdi-x","id":8398747,"avatar_url":"https://avatars.githubusercontent.com/u/8398747?v=3","gravatar_id":"","url":"https://api.github.com/users/intelsdi-x","html_url":"https://github.com/intelsdi-x","followers_url":"https://api.github.com/users/intelsdi-x/followers","following_url":"https://api.github.com/users/intelsdi-x/following{/other_user}","gists_url":"https://api.github.com/users/intelsdi-x/gists{/gist_id}","starred_url":"https://api.github.com/users/intelsdi-x/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/intelsdi-x/subscriptions","organizations_url":"https://api.github.com/users/intelsdi-x/orgs","repos_url":"https://api.github.com/users/intelsdi-x/repos","events_url":"https://api.github.com/users/intelsdi-x/events{/privacy}","received_events_url":"https://api.github.com/users/intelsdi-x/received_events","type":"Organization","site_admin":false},"repo":{"id":62181666,"name":"snap-plugin-lib-go","full_name":"intelsdi-x/snap-plugin-lib-go","owner":{"login":"intelsdi-x","id":8398747,"avatar_url":"https://avatars.githubusercontent.com/u/8398747?v=3","gravatar_id":"","url":"https://api.github.com/users/intelsdi-x","html_url":"https://github.com/intelsdi-x","followers_url":"https://api.github.com/users/intelsdi-x/followers","following_url":"https://api.github.com/users/intelsdi-x/following{/other_user}","gists_url":"https://api.github.com/users/intelsdi-x/gists{/gist_id}","starred_url":"https://api.github.com/users/intelsdi-x/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/intelsdi-x/subscriptions","organizations_url":"https://api.github.com/users/intelsdi-x/orgs","repos_url":"https://api.github.com/users/intelsdi-x/repos","events_url":"https://api.github.com/users/intelsdi-x/events{/privacy}","received_events_url":"https://api.github.com/users/intelsdi-x/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/intelsdi-x/snap-plugin-lib-go","description":null,"fork":false,"url":"https://api.github.com/repos/intelsdi-x/snap-plugin-lib-go","forks_url":"https://api.github.com/repos/intelsdi-x/snap-plugin-lib-go/forks","keys_url":"https://api.github.com/repos/intelsdi-x/snap-plugin-lib-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/intelsdi-x/snap-plugin-lib-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/intelsdi-x/snap-plugin-lib-go/teams","hooks_url":"https://api.github.com/repos/intelsdi-x/snap-plugin-lib-go/hooks","issue_events_url":"https://api.github.com/repos/intelsdi-x/snap-plugin-lib-go/issues/events{/number}","events_url":"https://api.github.com/repos/intelsdi-x/snap-plugin-lib-go/events","assignees_url":"https://api.github.com/repos/intelsdi-x/snap-plugin-lib-go/assignees{/user}","branches_url":"https://api.github.com/repos/intelsdi-x/snap-plugin-lib-go/branches{/branch}","tags_url":"https://api.github.com/repos/intelsdi-x/snap-plugin-lib-go/tags","blobs_url":"https://api.github.com/repos/intelsdi-x/snap-plugin-lib-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/intelsdi-x/snap-plugin-lib-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/intelsdi-x/snap-plugin-lib-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/intelsdi-x/snap-plugin-lib-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/intelsdi-x/snap-plugin-lib-go/statuses/{sha}","languages_url":"https://api.github.com/repos/intelsdi-x/snap-plugin-lib-go/languages","stargazers_url":"https://api.github.com/repos/intelsdi-x/snap-plugin-lib-go/stargazers","contributors_url":"https://api.github.com/repos/intelsdi-x/snap-plugin-lib-go/contributors","subscribers_url":"https://api.github.com/repos/intelsdi-x/snap-plugin-lib-go/subscribers","subscription_url":"https://api.github.com/repos/intelsdi-x/snap-plugin-lib-go/subscription","commits_url":"https://api.github.com/repos/intelsdi-x/snap-plugin-lib-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/intelsdi-x/snap-plugin-lib-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/intelsdi-x/snap-plugin-lib-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/intelsdi-x/snap-plugin-lib-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/intelsdi-x/snap-plugin-lib-go/contents/{+path}","compare_url":"https://api.github.com/repos/intelsdi-x/snap-plugin-lib-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/intelsdi-x/snap-plugin-lib-go/merges","archive_url":"https://api.github.com/repos/intelsdi-x/snap-plugin-lib-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/intelsdi-x/snap-plugin-lib-go/downloads","issues_url":"https://api.github.com/repos/intelsdi-x/snap-plugin-lib-go/issues{/number}","pulls_url":"https://api.github.com/repos/intelsdi-x/snap-plugin-lib-go/pulls{/number}","milestones_url":"https://api.github.com/repos/intelsdi-x/snap-plugin-lib-go/milestones{/number}","notifications_url":"https://api.github.com/repos/intelsdi-x/snap-plugin-lib-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/intelsdi-x/snap-plugin-lib-go/labels{/name}","releases_url":"https://api.github.com/repos/intelsdi-x/snap-plugin-lib-go/releases{/id}","deployments_url":"https://api.github.com/repos/intelsdi-x/snap-plugin-lib-go/deployments","created_at":"2016-06-28T23:56:00Z","updated_at":"2016-09-02T23:34:28Z","pushed_at":"2016-09-29T15:55:35Z","git_url":"git://github.com/intelsdi-x/snap-plugin-lib-go.git","ssh_url":"git@github.com:intelsdi-x/snap-plugin-lib-go.git","clone_url":"https://github.com/intelsdi-x/snap-plugin-lib-go.git","svn_url":"https://github.com/intelsdi-x/snap-plugin-lib-go","homepage":null,"size":88,"stargazers_count":1,"watchers_count":1,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":6,"forks":6,"open_issues":6,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/intelsdi-x/snap-plugin-lib-go/pulls/31"},"html":{"href":"https://github.com/intelsdi-x/snap-plugin-lib-go/pull/31"},"issue":{"href":"https://api.github.com/repos/intelsdi-x/snap-plugin-lib-go/issues/31"},"comments":{"href":"https://api.github.com/repos/intelsdi-x/snap-plugin-lib-go/issues/31/comments"},"review_comments":{"href":"https://api.github.com/repos/intelsdi-x/snap-plugin-lib-go/pulls/31/comments"},"review_comment":{"href":"https://api.github.com/repos/intelsdi-x/snap-plugin-lib-go/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/intelsdi-x/snap-plugin-lib-go/pulls/31/commits"},"statuses":{"href":"https://api.github.com/repos/intelsdi-x/snap-plugin-lib-go/statuses/00b7922bc0162cb29bb6606bf64aa4e4bbd59026"}}}}
{"actor":{"display_login":"candysmurf"}}