GitHub PullRequestReviewCommentEvent at 2014-09-04 22:34:10
Repository: juju
Actor: ericsnowcurrently
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/juju/juju/pulls/comments/17147130","id":17147130,"diff_hunk":"@@ -0,0 +1,73 @@\n+// Copyright 2014 Canonical Ltd.\n+// Licensed under the AGPLv3, see LICENCE file for details.\n+\n+package db\n+\n+import (\n+\t\"os\"\n+\t\"os/exec\"\n+\t\"path/filepath\"\n+\n+\t\"github.com/juju/errors\"\n+\n+\t\"github.com/juju/juju/mongo\"\n+)\n+\n+const dumpName = \"mongodump\"\n+\n+var getMongodumpPath = func() (string, error) {\n+\tmongod, err := mongo.Path()\n+\tif err != nil {\n+\t\treturn \"\", errors.Annotate(err, \"failed to get mongod path\")\n+\t}\n+\tmongoDumpPath := filepath.Join(filepath.Dir(mongod), dumpName)\n+\n+\tif _, err := os.Stat(mongoDumpPath); err == nil {\n+\t\t// It already exists so no need to continue.\n+\t\treturn mongoDumpPath, nil\n+\t}\n+\n+\tpath, err := exec.LookPath(dumpName)\n+\tif err != nil {\n+\t\treturn \"\", errors.Trace(err)\n+\t}\n+\treturn path, nil\n+}\n+\n+type mongoDumper struct {\n+\tconnInfo\n+}\n+\n+// NewDumper returns a new value with a Dump method for dumping the\n+// juju state database.\n+func NewDumper(info connInfo) *mongoDumper {\n+\treturn &mongoDumper{info}\n+}\n+\n+// Dump dumps the juju state database.\n+func (md *mongoDumper) Dump(dumpDir string) error {","path":"state/backups/db/dump.go","position":48,"original_position":48,"commit_id":"20a541e296232e1f3e6de0933af91455c11f1101","original_commit_id":"20a541e296232e1f3e6de0933af91455c11f1101","user":{"login":"ericsnowcurrently","id":1152074,"avatar_url":"https://avatars.githubusercontent.com/u/1152074?v=2","gravatar_id":"dd4761743695d5efd3692f2a3b35d37d","url":"https://api.github.com/users/ericsnowcurrently","html_url":"https://github.com/ericsnowcurrently","followers_url":"https://api.github.com/users/ericsnowcurrently/followers","following_url":"https://api.github.com/users/ericsnowcurrently/following{/other_user}","gists_url":"https://api.github.com/users/ericsnowcurrently/gists{/gist_id}","starred_url":"https://api.github.com/users/ericsnowcurrently/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericsnowcurrently/subscriptions","organizations_url":"https://api.github.com/users/ericsnowcurrently/orgs","repos_url":"https://api.github.com/users/ericsnowcurrently/repos","events_url":"https://api.github.com/users/ericsnowcurrently/events{/privacy}","received_events_url":"https://api.github.com/users/ericsnowcurrently/received_events","type":"User","site_admin":false},"body":"We pass a value that implements Dumper (has a Dump method) in to create().  So we need the type, simple as it may be.  I suppose we could pass a dump function into create(), but passing a Dumper makes more sense.","created_at":"2014-09-04T22:34:10Z","updated_at":"2014-09-04T22:34:10Z","html_url":"https://github.com/juju/juju/pull/606#discussion_r17147130","pull_request_url":"https://api.github.com/repos/juju/juju/pulls/606","_links":{"self":{"href":"https://api.github.com/repos/juju/juju/pulls/comments/17147130"},"html":{"href":"https://github.com/juju/juju/pull/606#discussion_r17147130"},"pull_request":{"href":"https://api.github.com/repos/juju/juju/pulls/606"}}},"pull_request":{"url":"https://api.github.com/repos/juju/juju/pulls/606","id":20289266,"html_url":"https://github.com/juju/juju/pull/606","diff_url":"https://github.com/juju/juju/pull/606.diff","patch_url":"https://github.com/juju/juju/pull/606.patch","issue_url":"https://api.github.com/repos/juju/juju/issues/606","number":606,"state":"open","locked":false,"title":"Replace the legacy backups implementation with a new one.","user":{"login":"ericsnowcurrently","id":1152074,"avatar_url":"https://avatars.githubusercontent.com/u/1152074?v=2","gravatar_id":"dd4761743695d5efd3692f2a3b35d37d","url":"https://api.github.com/users/ericsnowcurrently","html_url":"https://github.com/ericsnowcurrently","followers_url":"https://api.github.com/users/ericsnowcurrently/followers","following_url":"https://api.github.com/users/ericsnowcurrently/following{/other_user}","gists_url":"https://api.github.com/users/ericsnowcurrently/gists{/gist_id}","starred_url":"https://api.github.com/users/ericsnowcurrently/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericsnowcurrently/subscriptions","organizations_url":"https://api.github.com/users/ericsnowcurrently/orgs","repos_url":"https://api.github.com/users/ericsnowcurrently/repos","events_url":"https://api.github.com/users/ericsnowcurrently/events{/privacy}","received_events_url":"https://api.github.com/users/ericsnowcurrently/received_events","type":"User","site_admin":false},"body":"The new implementation is refactored to fit to the new backups approach of storing the backups in env storage (along with metadata in mongo). This is the final large patch in the backup series (the remaining ones are much smaller).\r\n\r\nThe next 2 patches in the series:\r\nhttps://github.com/ericsnowcurrently/juju/pull/3\r\nhttps://github.com/ericsnowcurrently/juju/pull/4","created_at":"2014-08-26T06:01:39Z","updated_at":"2014-09-04T22:34:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8544cfc80b30f92b3b03043d049a5712d13f0e92","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/juju/juju/pulls/606/commits","review_comments_url":"https://api.github.com/repos/juju/juju/pulls/606/comments","review_comment_url":"https://api.github.com/repos/juju/juju/pulls/comments/{number}","comments_url":"https://api.github.com/repos/juju/juju/issues/606/comments","statuses_url":"https://api.github.com/repos/juju/juju/statuses/20a541e296232e1f3e6de0933af91455c11f1101","head":{"label":"ericsnowcurrently:backups-kill-legacy","ref":"backups-kill-legacy","sha":"20a541e296232e1f3e6de0933af91455c11f1101","user":{"login":"ericsnowcurrently","id":1152074,"avatar_url":"https://avatars.githubusercontent.com/u/1152074?v=2","gravatar_id":"dd4761743695d5efd3692f2a3b35d37d","url":"https://api.github.com/users/ericsnowcurrently","html_url":"https://github.com/ericsnowcurrently","followers_url":"https://api.github.com/users/ericsnowcurrently/followers","following_url":"https://api.github.com/users/ericsnowcurrently/following{/other_user}","gists_url":"https://api.github.com/users/ericsnowcurrently/gists{/gist_id}","starred_url":"https://api.github.com/users/ericsnowcurrently/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericsnowcurrently/subscriptions","organizations_url":"https://api.github.com/users/ericsnowcurrently/orgs","repos_url":"https://api.github.com/users/ericsnowcurrently/repos","events_url":"https://api.github.com/users/ericsnowcurrently/events{/privacy}","received_events_url":"https://api.github.com/users/ericsnowcurrently/received_events","type":"User","site_admin":false},"repo":{"id":20663016,"name":"juju","full_name":"ericsnowcurrently/juju","owner":{"login":"ericsnowcurrently","id":1152074,"avatar_url":"https://avatars.githubusercontent.com/u/1152074?v=2","gravatar_id":"dd4761743695d5efd3692f2a3b35d37d","url":"https://api.github.com/users/ericsnowcurrently","html_url":"https://github.com/ericsnowcurrently","followers_url":"https://api.github.com/users/ericsnowcurrently/followers","following_url":"https://api.github.com/users/ericsnowcurrently/following{/other_user}","gists_url":"https://api.github.com/users/ericsnowcurrently/gists{/gist_id}","starred_url":"https://api.github.com/users/ericsnowcurrently/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericsnowcurrently/subscriptions","organizations_url":"https://api.github.com/users/ericsnowcurrently/orgs","repos_url":"https://api.github.com/users/ericsnowcurrently/repos","events_url":"https://api.github.com/users/ericsnowcurrently/events{/privacy}","received_events_url":"https://api.github.com/users/ericsnowcurrently/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ericsnowcurrently/juju","description":"juju is devops distilled","fork":true,"url":"https://api.github.com/repos/ericsnowcurrently/juju","forks_url":"https://api.github.com/repos/ericsnowcurrently/juju/forks","keys_url":"https://api.github.com/repos/ericsnowcurrently/juju/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ericsnowcurrently/juju/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ericsnowcurrently/juju/teams","hooks_url":"https://api.github.com/repos/ericsnowcurrently/juju/hooks","issue_events_url":"https://api.github.com/repos/ericsnowcurrently/juju/issues/events{/number}","events_url":"https://api.github.com/repos/ericsnowcurrently/juju/events","assignees_url":"https://api.github.com/repos/ericsnowcurrently/juju/assignees{/user}","branches_url":"https://api.github.com/repos/ericsnowcurrently/juju/branches{/branch}","tags_url":"https://api.github.com/repos/ericsnowcurrently/juju/tags","blobs_url":"https://api.github.com/repos/ericsnowcurrently/juju/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ericsnowcurrently/juju/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ericsnowcurrently/juju/git/refs{/sha}","trees_url":"https://api.github.com/repos/ericsnowcurrently/juju/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ericsnowcurrently/juju/statuses/{sha}","languages_url":"https://api.github.com/repos/ericsnowcurrently/juju/languages","stargazers_url":"https://api.github.com/repos/ericsnowcurrently/juju/stargazers","contributors_url":"https://api.github.com/repos/ericsnowcurrently/juju/contributors","subscribers_url":"https://api.github.com/repos/ericsnowcurrently/juju/subscribers","subscription_url":"https://api.github.com/repos/ericsnowcurrently/juju/subscription","commits_url":"https://api.github.com/repos/ericsnowcurrently/juju/commits{/sha}","git_commits_url":"https://api.github.com/repos/ericsnowcurrently/juju/git/commits{/sha}","comments_url":"https://api.github.com/repos/ericsnowcurrently/juju/comments{/number}","issue_comment_url":"https://api.github.com/repos/ericsnowcurrently/juju/issues/comments/{number}","contents_url":"https://api.github.com/repos/ericsnowcurrently/juju/contents/{+path}","compare_url":"https://api.github.com/repos/ericsnowcurrently/juju/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ericsnowcurrently/juju/merges","archive_url":"https://api.github.com/repos/ericsnowcurrently/juju/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ericsnowcurrently/juju/downloads","issues_url":"https://api.github.com/repos/ericsnowcurrently/juju/issues{/number}","pulls_url":"https://api.github.com/repos/ericsnowcurrently/juju/pulls{/number}","milestones_url":"https://api.github.com/repos/ericsnowcurrently/juju/milestones{/number}","notifications_url":"https://api.github.com/repos/ericsnowcurrently/juju/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ericsnowcurrently/juju/labels{/name}","releases_url":"https://api.github.com/repos/ericsnowcurrently/juju/releases{/id}","created_at":"2014-06-09T21:34:34Z","updated_at":"2014-06-26T05:19:53Z","pushed_at":"2014-09-02T17:11:52Z","git_url":"git://github.com/ericsnowcurrently/juju.git","ssh_url":"git@github.com:ericsnowcurrently/juju.git","clone_url":"https://github.com/ericsnowcurrently/juju.git","svn_url":"https://github.com/ericsnowcurrently/juju","homepage":"juju.ubuntu.com","size":30595,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"juju:master","ref":"master","sha":"1060f2dce3d5f7c6bfc72f203457bfdced794b45","user":{"login":"juju","id":4604548,"avatar_url":"https://avatars.githubusercontent.com/u/4604548?v=2","gravatar_id":"b095d1e26e5705abe0ad2de7d87aac2e","url":"https://api.github.com/users/juju","html_url":"https://github.com/juju","followers_url":"https://api.github.com/users/juju/followers","following_url":"https://api.github.com/users/juju/following{/other_user}","gists_url":"https://api.github.com/users/juju/gists{/gist_id}","starred_url":"https://api.github.com/users/juju/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juju/subscriptions","organizations_url":"https://api.github.com/users/juju/orgs","repos_url":"https://api.github.com/users/juju/repos","events_url":"https://api.github.com/users/juju/events{/privacy}","received_events_url":"https://api.github.com/users/juju/received_events","type":"Organization","site_admin":false},"repo":{"id":20445947,"name":"juju","full_name":"juju/juju","owner":{"login":"juju","id":4604548,"avatar_url":"https://avatars.githubusercontent.com/u/4604548?v=2","gravatar_id":"b095d1e26e5705abe0ad2de7d87aac2e","url":"https://api.github.com/users/juju","html_url":"https://github.com/juju","followers_url":"https://api.github.com/users/juju/followers","following_url":"https://api.github.com/users/juju/following{/other_user}","gists_url":"https://api.github.com/users/juju/gists{/gist_id}","starred_url":"https://api.github.com/users/juju/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juju/subscriptions","organizations_url":"https://api.github.com/users/juju/orgs","repos_url":"https://api.github.com/users/juju/repos","events_url":"https://api.github.com/users/juju/events{/privacy}","received_events_url":"https://api.github.com/users/juju/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/juju/juju","description":"juju is devops distilled","fork":false,"url":"https://api.github.com/repos/juju/juju","forks_url":"https://api.github.com/repos/juju/juju/forks","keys_url":"https://api.github.com/repos/juju/juju/keys{/key_id}","collaborators_url":"https://api.github.com/repos/juju/juju/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/juju/juju/teams","hooks_url":"https://api.github.com/repos/juju/juju/hooks","issue_events_url":"https://api.github.com/repos/juju/juju/issues/events{/number}","events_url":"https://api.github.com/repos/juju/juju/events","assignees_url":"https://api.github.com/repos/juju/juju/assignees{/user}","branches_url":"https://api.github.com/repos/juju/juju/branches{/branch}","tags_url":"https://api.github.com/repos/juju/juju/tags","blobs_url":"https://api.github.com/repos/juju/juju/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/juju/juju/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/juju/juju/git/refs{/sha}","trees_url":"https://api.github.com/repos/juju/juju/git/trees{/sha}","statuses_url":"https://api.github.com/repos/juju/juju/statuses/{sha}","languages_url":"https://api.github.com/repos/juju/juju/languages","stargazers_url":"https://api.github.com/repos/juju/juju/stargazers","contributors_url":"https://api.github.com/repos/juju/juju/contributors","subscribers_url":"https://api.github.com/repos/juju/juju/subscribers","subscription_url":"https://api.github.com/repos/juju/juju/subscription","commits_url":"https://api.github.com/repos/juju/juju/commits{/sha}","git_commits_url":"https://api.github.com/repos/juju/juju/git/commits{/sha}","comments_url":"https://api.github.com/repos/juju/juju/comments{/number}","issue_comment_url":"https://api.github.com/repos/juju/juju/issues/comments/{number}","contents_url":"https://api.github.com/repos/juju/juju/contents/{+path}","compare_url":"https://api.github.com/repos/juju/juju/compare/{base}...{head}","merges_url":"https://api.github.com/repos/juju/juju/merges","archive_url":"https://api.github.com/repos/juju/juju/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/juju/juju/downloads","issues_url":"https://api.github.com/repos/juju/juju/issues{/number}","pulls_url":"https://api.github.com/repos/juju/juju/pulls{/number}","milestones_url":"https://api.github.com/repos/juju/juju/milestones{/number}","notifications_url":"https://api.github.com/repos/juju/juju/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/juju/juju/labels{/name}","releases_url":"https://api.github.com/repos/juju/juju/releases{/id}","created_at":"2014-06-03T14:28:10Z","updated_at":"2014-09-02T01:17:27Z","pushed_at":"2014-09-04T17:03:15Z","git_url":"git://github.com/juju/juju.git","ssh_url":"git@github.com:juju/juju.git","clone_url":"https://github.com/juju/juju.git","svn_url":"https://github.com/juju/juju","homepage":"juju.ubuntu.com","size":44277,"stargazers_count":203,"watchers_count":203,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":55,"mirror_url":null,"open_issues_count":52,"forks":55,"open_issues":52,"watchers":203,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/juju/juju/pulls/606"},"html":{"href":"https://github.com/juju/juju/pull/606"},"issue":{"href":"https://api.github.com/repos/juju/juju/issues/606"},"comments":{"href":"https://api.github.com/repos/juju/juju/issues/606/comments"},"review_comments":{"href":"https://api.github.com/repos/juju/juju/pulls/606/comments"},"review_comment":{"href":"https://api.github.com/repos/juju/juju/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/juju/juju/pulls/606/commits"},"statuses":{"href":"https://api.github.com/repos/juju/juju/statuses/20a541e296232e1f3e6de0933af91455c11f1101"}}}}