{"action":"created","comment":{"url":"https://api.github.com/repos/contiv/volplugin/pulls/comments/72371382","id":72371382,"diff_hunk":"@@ -0,0 +1,120 @@\n+package config\n+\n+import (\n+\t\"io/ioutil\"\n+\t\"os\"\n+\t\"strconv\"\n+\t\"strings\"\n+\t\"time\"\n+\n+\t\"github.com/contiv/volplugin/watch\"\n+\t. \"gopkg.in/check.v1\"\n+)\n+\n+const (\n+\ttestPolicyName = \"foobar\"\n+)\n+\n+func revisionCount(s *configSuite) int {\n+\trevisions, _ := s.tlc.ListPolicyRevisions(testPolicyName)\n+\treturn len(revisions)\n+}\n+\n+func createTestPolicy(s *configSuite, c *C) {\n+\terr := s.tlc.CreatePolicyRevision(testPolicyName, \"{}\")\n+\tc.Assert(err, IsNil)\n+}\n+\n+func (s *configSuite) TestCreatePolicyRevision(c *C) {\n+\tc.Assert(revisionCount(s), Equals, 0)\n+\tcreateTestPolicy(s, c)\n+\tc.Assert(revisionCount(s), Equals, 1)\n+}\n+\n+func (s *configSuite) TestListPolicyRevisions(c *C) {\n+\tc.Assert(revisionCount(s), Equals, 0)\n+\n+\t// edge case: the second may roll over between saving the current timestamp\n+\t//            and the HTTP request to upload the policy being handled\n+\tt := int(time.Now().Unix())","path":"config/archive_test.go","position":39,"original_position":39,"commit_id":"4200a64bd5181b9d617c2b1cfa6365e193ddf5f0","original_commit_id":"4200a64bd5181b9d617c2b1cfa6365e193ddf5f0","user":{"login":"dseevr","id":97581,"avatar_url":"https://avatars.githubusercontent.com/u/97581?v=3","gravatar_id":"","url":"https://api.github.com/users/dseevr","html_url":"https://github.com/dseevr","followers_url":"https://api.github.com/users/dseevr/followers","following_url":"https://api.github.com/users/dseevr/following{/other_user}","gists_url":"https://api.github.com/users/dseevr/gists{/gist_id}","starred_url":"https://api.github.com/users/dseevr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dseevr/subscriptions","organizations_url":"https://api.github.com/users/dseevr/orgs","repos_url":"https://api.github.com/users/dseevr/repos","events_url":"https://api.github.com/users/dseevr/events{/privacy}","received_events_url":"https://api.github.com/users/dseevr/received_events","type":"User","site_admin":false},"body":"Sure, I don't think verifying the timestamp is exact really matters for this test.  The TestWatchForPolicyChanges() test below tests that since it has to verify that the stdout output was correct.","created_at":"2016-07-27T02:21:26Z","updated_at":"2016-07-27T02:21:26Z","html_url":"https://github.com/contiv/volplugin/pull/367#discussion_r72371382","pull_request_url":"https://api.github.com/repos/contiv/volplugin/pulls/367","_links":{"self":{"href":"https://api.github.com/repos/contiv/volplugin/pulls/comments/72371382"},"html":{"href":"https://github.com/contiv/volplugin/pull/367#discussion_r72371382"},"pull_request":{"href":"https://api.github.com/repos/contiv/volplugin/pulls/367"}}},"pull_request":{"url":"https://api.github.com/repos/contiv/volplugin/pulls/367","id":78943179,"html_url":"https://github.com/contiv/volplugin/pull/367","diff_url":"https://github.com/contiv/volplugin/pull/367.diff","patch_url":"https://github.com/contiv/volplugin/pull/367.patch","issue_url":"https://api.github.com/repos/contiv/volplugin/issues/367","number":367,"state":"open","locked":false,"title":"apiserver,config,errors,volcli: add volcli commands to get, list, and watch policy revision changes","user":{"login":"dseevr","id":97581,"avatar_url":"https://avatars.githubusercontent.com/u/97581?v=3","gravatar_id":"","url":"https://api.github.com/users/dseevr","html_url":"https://github.com/dseevr","followers_url":"https://api.github.com/users/dseevr/followers","following_url":"https://api.github.com/users/dseevr/following{/other_user}","gists_url":"https://api.github.com/users/dseevr/gists{/gist_id}","starred_url":"https://api.github.com/users/dseevr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dseevr/subscriptions","organizations_url":"https://api.github.com/users/dseevr/orgs","repos_url":"https://api.github.com/users/dseevr/repos","events_url":"https://api.github.com/users/dseevr/events{/privacy}","received_events_url":"https://api.github.com/users/dseevr/received_events","type":"User","site_admin":false},"body":"- Get all revision numbers: `volcli policy history list $name`\r\n- Retrieve the policy text for a specific revision: `volcli policy history get $name $revision`\r\n- Watch for new policies being uploaded: `volcli policy watch`\r\n\r\nRelated to: https://github.com/contiv/volplugin/issues/269\r\nFixes #269","created_at":"2016-07-26T23:30:38Z","updated_at":"2016-07-27T02:21:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"81a142cb6283ebfe849b36b797f93dd302e1c5f0","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/contiv/volplugin/pulls/367/commits","review_comments_url":"https://api.github.com/repos/contiv/volplugin/pulls/367/comments","review_comment_url":"https://api.github.com/repos/contiv/volplugin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/contiv/volplugin/issues/367/comments","statuses_url":"https://api.github.com/repos/contiv/volplugin/statuses/4200a64bd5181b9d617c2b1cfa6365e193ddf5f0","head":{"label":"dseevr:policy_history","ref":"policy_history","sha":"4200a64bd5181b9d617c2b1cfa6365e193ddf5f0","user":{"login":"dseevr","id":97581,"avatar_url":"https://avatars.githubusercontent.com/u/97581?v=3","gravatar_id":"","url":"https://api.github.com/users/dseevr","html_url":"https://github.com/dseevr","followers_url":"https://api.github.com/users/dseevr/followers","following_url":"https://api.github.com/users/dseevr/following{/other_user}","gists_url":"https://api.github.com/users/dseevr/gists{/gist_id}","starred_url":"https://api.github.com/users/dseevr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dseevr/subscriptions","organizations_url":"https://api.github.com/users/dseevr/orgs","repos_url":"https://api.github.com/users/dseevr/repos","events_url":"https://api.github.com/users/dseevr/events{/privacy}","received_events_url":"https://api.github.com/users/dseevr/received_events","type":"User","site_admin":false},"repo":{"id":58024657,"name":"volplugin","full_name":"dseevr/volplugin","owner":{"login":"dseevr","id":97581,"avatar_url":"https://avatars.githubusercontent.com/u/97581?v=3","gravatar_id":"","url":"https://api.github.com/users/dseevr","html_url":"https://github.com/dseevr","followers_url":"https://api.github.com/users/dseevr/followers","following_url":"https://api.github.com/users/dseevr/following{/other_user}","gists_url":"https://api.github.com/users/dseevr/gists{/gist_id}","starred_url":"https://api.github.com/users/dseevr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dseevr/subscriptions","organizations_url":"https://api.github.com/users/dseevr/orgs","repos_url":"https://api.github.com/users/dseevr/repos","events_url":"https://api.github.com/users/dseevr/events{/privacy}","received_events_url":"https://api.github.com/users/dseevr/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dseevr/volplugin","description":"Policy backed Clustered Storage (via Ceph) for Docker","fork":true,"url":"https://api.github.com/repos/dseevr/volplugin","forks_url":"https://api.github.com/repos/dseevr/volplugin/forks","keys_url":"https://api.github.com/repos/dseevr/volplugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dseevr/volplugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dseevr/volplugin/teams","hooks_url":"https://api.github.com/repos/dseevr/volplugin/hooks","issue_events_url":"https://api.github.com/repos/dseevr/volplugin/issues/events{/number}","events_url":"https://api.github.com/repos/dseevr/volplugin/events","assignees_url":"https://api.github.com/repos/dseevr/volplugin/assignees{/user}","branches_url":"https://api.github.com/repos/dseevr/volplugin/branches{/branch}","tags_url":"https://api.github.com/repos/dseevr/volplugin/tags","blobs_url":"https://api.github.com/repos/dseevr/volplugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dseevr/volplugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dseevr/volplugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/dseevr/volplugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dseevr/volplugin/statuses/{sha}","languages_url":"https://api.github.com/repos/dseevr/volplugin/languages","stargazers_url":"https://api.github.com/repos/dseevr/volplugin/stargazers","contributors_url":"https://api.github.com/repos/dseevr/volplugin/contributors","subscribers_url":"https://api.github.com/repos/dseevr/volplugin/subscribers","subscription_url":"https://api.github.com/repos/dseevr/volplugin/subscription","commits_url":"https://api.github.com/repos/dseevr/volplugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/dseevr/volplugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/dseevr/volplugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/dseevr/volplugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/dseevr/volplugin/contents/{+path}","compare_url":"https://api.github.com/repos/dseevr/volplugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dseevr/volplugin/merges","archive_url":"https://api.github.com/repos/dseevr/volplugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dseevr/volplugin/downloads","issues_url":"https://api.github.com/repos/dseevr/volplugin/issues{/number}","pulls_url":"https://api.github.com/repos/dseevr/volplugin/pulls{/number}","milestones_url":"https://api.github.com/repos/dseevr/volplugin/milestones{/number}","notifications_url":"https://api.github.com/repos/dseevr/volplugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dseevr/volplugin/labels{/name}","releases_url":"https://api.github.com/repos/dseevr/volplugin/releases{/id}","deployments_url":"https://api.github.com/repos/dseevr/volplugin/deployments","created_at":"2016-05-04T05:16:11Z","updated_at":"2016-05-04T05:16:12Z","pushed_at":"2016-07-26T23:55:46Z","git_url":"git://github.com/dseevr/volplugin.git","ssh_url":"git@github.com:dseevr/volplugin.git","clone_url":"https://github.com/dseevr/volplugin.git","svn_url":"https://github.com/dseevr/volplugin","homepage":"http://docs.contiv.io","size":3259,"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":"contiv:master","ref":"master","sha":"9e5562da4b711e17b891ec9ccbcc04c677873d37","user":{"login":"contiv","id":10272443,"avatar_url":"https://avatars.githubusercontent.com/u/10272443?v=3","gravatar_id":"","url":"https://api.github.com/users/contiv","html_url":"https://github.com/contiv","followers_url":"https://api.github.com/users/contiv/followers","following_url":"https://api.github.com/users/contiv/following{/other_user}","gists_url":"https://api.github.com/users/contiv/gists{/gist_id}","starred_url":"https://api.github.com/users/contiv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/contiv/subscriptions","organizations_url":"https://api.github.com/users/contiv/orgs","repos_url":"https://api.github.com/users/contiv/repos","events_url":"https://api.github.com/users/contiv/events{/privacy}","received_events_url":"https://api.github.com/users/contiv/received_events","type":"Organization","site_admin":false},"repo":{"id":38460040,"name":"volplugin","full_name":"contiv/volplugin","owner":{"login":"contiv","id":10272443,"avatar_url":"https://avatars.githubusercontent.com/u/10272443?v=3","gravatar_id":"","url":"https://api.github.com/users/contiv","html_url":"https://github.com/contiv","followers_url":"https://api.github.com/users/contiv/followers","following_url":"https://api.github.com/users/contiv/following{/other_user}","gists_url":"https://api.github.com/users/contiv/gists{/gist_id}","starred_url":"https://api.github.com/users/contiv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/contiv/subscriptions","organizations_url":"https://api.github.com/users/contiv/orgs","repos_url":"https://api.github.com/users/contiv/repos","events_url":"https://api.github.com/users/contiv/events{/privacy}","received_events_url":"https://api.github.com/users/contiv/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/contiv/volplugin","description":"Contiv Storage: Policy backed Clustered Storage (via Ceph or NFS) for Docker","fork":false,"url":"https://api.github.com/repos/contiv/volplugin","forks_url":"https://api.github.com/repos/contiv/volplugin/forks","keys_url":"https://api.github.com/repos/contiv/volplugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/contiv/volplugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/contiv/volplugin/teams","hooks_url":"https://api.github.com/repos/contiv/volplugin/hooks","issue_events_url":"https://api.github.com/repos/contiv/volplugin/issues/events{/number}","events_url":"https://api.github.com/repos/contiv/volplugin/events","assignees_url":"https://api.github.com/repos/contiv/volplugin/assignees{/user}","branches_url":"https://api.github.com/repos/contiv/volplugin/branches{/branch}","tags_url":"https://api.github.com/repos/contiv/volplugin/tags","blobs_url":"https://api.github.com/repos/contiv/volplugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/contiv/volplugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/contiv/volplugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/contiv/volplugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/contiv/volplugin/statuses/{sha}","languages_url":"https://api.github.com/repos/contiv/volplugin/languages","stargazers_url":"https://api.github.com/repos/contiv/volplugin/stargazers","contributors_url":"https://api.github.com/repos/contiv/volplugin/contributors","subscribers_url":"https://api.github.com/repos/contiv/volplugin/subscribers","subscription_url":"https://api.github.com/repos/contiv/volplugin/subscription","commits_url":"https://api.github.com/repos/contiv/volplugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/contiv/volplugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/contiv/volplugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/contiv/volplugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/contiv/volplugin/contents/{+path}","compare_url":"https://api.github.com/repos/contiv/volplugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/contiv/volplugin/merges","archive_url":"https://api.github.com/repos/contiv/volplugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/contiv/volplugin/downloads","issues_url":"https://api.github.com/repos/contiv/volplugin/issues{/number}","pulls_url":"https://api.github.com/repos/contiv/volplugin/pulls{/number}","milestones_url":"https://api.github.com/repos/contiv/volplugin/milestones{/number}","notifications_url":"https://api.github.com/repos/contiv/volplugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/contiv/volplugin/labels{/name}","releases_url":"https://api.github.com/repos/contiv/volplugin/releases{/id}","deployments_url":"https://api.github.com/repos/contiv/volplugin/deployments","created_at":"2015-07-02T22:31:53Z","updated_at":"2016-07-21T12:59:41Z","pushed_at":"2016-07-27T01:00:49Z","git_url":"git://github.com/contiv/volplugin.git","ssh_url":"git@github.com:contiv/volplugin.git","clone_url":"https://github.com/contiv/volplugin.git","svn_url":"https://github.com/contiv/volplugin","homepage":"http://contiv.github.io","size":3321,"stargazers_count":128,"watchers_count":128,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":24,"mirror_url":null,"open_issues_count":27,"forks":24,"open_issues":27,"watchers":128,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/contiv/volplugin/pulls/367"},"html":{"href":"https://github.com/contiv/volplugin/pull/367"},"issue":{"href":"https://api.github.com/repos/contiv/volplugin/issues/367"},"comments":{"href":"https://api.github.com/repos/contiv/volplugin/issues/367/comments"},"review_comments":{"href":"https://api.github.com/repos/contiv/volplugin/pulls/367/comments"},"review_comment":{"href":"https://api.github.com/repos/contiv/volplugin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/contiv/volplugin/pulls/367/commits"},"statuses":{"href":"https://api.github.com/repos/contiv/volplugin/statuses/4200a64bd5181b9d617c2b1cfa6365e193ddf5f0"}}}}
{"actor":{"display_login":"dseevr"}}