{"action":"created","comment":{"url":"https://api.github.com/repos/juju/juju/pulls/comments/227978698","pull_request_review_id":168143250,"id":227978698,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNzk3ODY5OA==","diff_hunk":"@@ -0,0 +1,275 @@\n+// Copyright 2018 Canonical Ltd.\n+// Licensed under the AGPLv3, see LICENCE file for details.\n+\n+package application\n+\n+import (\n+\t\"github.com/juju/bundlechanges\"\n+\t\"github.com/juju/cmd\"\n+\t\"github.com/juju/errors\"\n+\t\"github.com/juju/gnuflag\"\n+\t\"gopkg.in/juju/charm.v6\"\n+\t\"gopkg.in/juju/charmrepo.v3\"\n+\tcsparams \"gopkg.in/juju/charmrepo.v3/csclient/params\"\n+\t\"gopkg.in/yaml.v2\"\n+\n+\t\"github.com/juju/juju/api/annotations\"\n+\t\"github.com/juju/juju/api/application\"\n+\t\"github.com/juju/juju/api/base\"\n+\t\"github.com/juju/juju/api/modelconfig\"\n+\t\"github.com/juju/juju/apiserver/params\"\n+\t\"github.com/juju/juju/cmd/modelcmd\"\n+\t\"github.com/juju/juju/constraints\"\n+)\n+\n+const bundleDiffDoc = `\n+Bundle can be a local bundle file or the name of a bundle in\n+the charm store. The bundle can also be combined with overlays (in the\n+same way as the deploy command) before comparing with the model.\n+\n+The map-machines option works similarly as for the deploy command, but\n+existing is always assumed, so it doesn't need to be specified.\n+\n+Examples:\n+    juju diff-bundle localbundle.yaml\n+    juju diff-bundle canonical-kubernetes\n+    juju diff-bundle mongodb-cluster --channel beta\n+    juju diff-bundle canonical-kubernetes --overlay local-config.yaml --overlay extra.yaml\n+    juju diff-bundle localbundle.yaml --map-machines 3=4\n+\n+See also:\n+    deploy\n+`\n+\n+// NewBundleDiffCommand returns a command to compare a bundle against\n+// the selected model.\n+func NewBundleDiffCommand() cmd.Command {\n+\treturn modelcmd.Wrap(&bundleDiffCommand{})\n+}\n+\n+// bundleDiffCommand compares a bundle to a model.\n+type bundleDiffCommand struct {\n+\tmodelcmd.ModelCommandBase\n+\tbundle         string\n+\tbundleOverlays []string\n+\tchannel        csparams.Channel\n+\tannotations    bool\n+\n+\tbundleMachines map[string]string\n+\tmachineMap     string\n+\n+\t// These are set in tests to enable mocking out the API and the\n+\t// charm store.\n+\t_apiRoot    base.APICallCloser\n+\t_charmStore BundleResolver\n+}\n+\n+// IsSuperCommand is part of cmd.Command.\n+func (c *bundleDiffCommand) IsSuperCommand() bool { return false }\n+\n+// AllowInterspersedFlags is part of cmd.Command.\n+func (c *bundleDiffCommand) AllowInterspersedFlags() bool { return true }\n+\n+// Info is part of cmd.Command.\n+func (c *bundleDiffCommand) Info() *cmd.Info {\n+\treturn &cmd.Info{\n+\t\tName:    \"diff-bundle\",\n+\t\tArgs:    \"<bundle file or name>\",\n+\t\tPurpose: \"Compare a bundle against a model and report any differences.\",","path":"cmd/juju/application/bundlediff.go","position":78,"original_position":78,"commit_id":"7e27b668c3a45d05f9f7f9c7c7257e43a9acdb3a","original_commit_id":"7e27b668c3a45d05f9f7f9c7c7257e43a9acdb3a","user":{"login":"babbageclunk","id":563399,"node_id":"MDQ6VXNlcjU2MzM5OQ==","avatar_url":"https://avatars2.githubusercontent.com/u/563399?v=4","gravatar_id":"","url":"https://api.github.com/users/babbageclunk","html_url":"https://github.com/babbageclunk","followers_url":"https://api.github.com/users/babbageclunk/followers","following_url":"https://api.github.com/users/babbageclunk/following{/other_user}","gists_url":"https://api.github.com/users/babbageclunk/gists{/gist_id}","starred_url":"https://api.github.com/users/babbageclunk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/babbageclunk/subscriptions","organizations_url":"https://api.github.com/users/babbageclunk/orgs","repos_url":"https://api.github.com/users/babbageclunk/repos","events_url":"https://api.github.com/users/babbageclunk/events{/privacy}","received_events_url":"https://api.github.com/users/babbageclunk/received_events","type":"User","site_admin":false},"body":"Removed.","created_at":"2018-10-24T22:16:18Z","updated_at":"2018-10-24T22:16:18Z","html_url":"https://github.com/juju/juju/pull/9366#discussion_r227978698","pull_request_url":"https://api.github.com/repos/juju/juju/pulls/9366","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/juju/juju/pulls/comments/227978698"},"html":{"href":"https://github.com/juju/juju/pull/9366#discussion_r227978698"},"pull_request":{"href":"https://api.github.com/repos/juju/juju/pulls/9366"}},"in_reply_to_id":227842310},"pull_request":{"url":"https://api.github.com/repos/juju/juju/pulls/9366","id":225394212,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI1Mzk0MjEy","html_url":"https://github.com/juju/juju/pull/9366","diff_url":"https://github.com/juju/juju/pull/9366.diff","patch_url":"https://github.com/juju/juju/pull/9366.patch","issue_url":"https://api.github.com/repos/juju/juju/issues/9366","number":9366,"state":"open","locked":false,"title":"diff-bundle: Compare bundle with model and report differences","user":{"login":"babbageclunk","id":563399,"node_id":"MDQ6VXNlcjU2MzM5OQ==","avatar_url":"https://avatars2.githubusercontent.com/u/563399?v=4","gravatar_id":"","url":"https://api.github.com/users/babbageclunk","html_url":"https://github.com/babbageclunk","followers_url":"https://api.github.com/users/babbageclunk/followers","following_url":"https://api.github.com/users/babbageclunk/following{/other_user}","gists_url":"https://api.github.com/users/babbageclunk/gists{/gist_id}","starred_url":"https://api.github.com/users/babbageclunk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/babbageclunk/subscriptions","organizations_url":"https://api.github.com/users/babbageclunk/orgs","repos_url":"https://api.github.com/users/babbageclunk/repos","events_url":"https://api.github.com/users/babbageclunk/events{/privacy}","received_events_url":"https://api.github.com/users/babbageclunk/received_events","type":"User","site_admin":false},"body":"## Description of change\r\n\r\nThis adds a new command, `diff-bundle` that compares a local or charmstore bundle and reports differences between them. It supports includes and overlays in the same way as the deploy command, and uses the same code to extract model information to compare it to the bundle.\r\n\r\nMore information about the command including options and output is in the discourse post: https://discourse.jujucharms.com/t/new-diff-bundle-command/247\r\n\r\n## QA steps\r\n\r\n* Deploy a bundle to a model, and then compare the bundle to the model. Edit the bundle to change details like number of units or exposure and add machines, applications and relations, and make different changes to the model. See that they're reflected in the diff output.\r\n* Remove units and machines deployed to the model from the bundle, and deploy it again (so those units get recreated with different IDs from the ones in the bundle). Run a diff and see that the different machines are reported. Use the --map-machines options to indicate which bundle machines correspond to the new machines and the differences should be removed.\r\n\r\n## Documentation changes\r\n\r\nYes, this will need documentation. I'll do some more narrative/task-oriented documentation in discourse to help with this.\r\n\r\n","created_at":"2018-10-24T13:03:05Z","updated_at":"2018-10-24T22:16:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"68792b6ade2fe4893ed1318c0acdd5d17026d961","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/juju/juju/pulls/9366/commits","review_comments_url":"https://api.github.com/repos/juju/juju/pulls/9366/comments","review_comment_url":"https://api.github.com/repos/juju/juju/pulls/comments{/number}","comments_url":"https://api.github.com/repos/juju/juju/issues/9366/comments","statuses_url":"https://api.github.com/repos/juju/juju/statuses/7e27b668c3a45d05f9f7f9c7c7257e43a9acdb3a","head":{"label":"babbageclunk:bundle-diff","ref":"bundle-diff","sha":"7e27b668c3a45d05f9f7f9c7c7257e43a9acdb3a","user":{"login":"babbageclunk","id":563399,"node_id":"MDQ6VXNlcjU2MzM5OQ==","avatar_url":"https://avatars2.githubusercontent.com/u/563399?v=4","gravatar_id":"","url":"https://api.github.com/users/babbageclunk","html_url":"https://github.com/babbageclunk","followers_url":"https://api.github.com/users/babbageclunk/followers","following_url":"https://api.github.com/users/babbageclunk/following{/other_user}","gists_url":"https://api.github.com/users/babbageclunk/gists{/gist_id}","starred_url":"https://api.github.com/users/babbageclunk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/babbageclunk/subscriptions","organizations_url":"https://api.github.com/users/babbageclunk/orgs","repos_url":"https://api.github.com/users/babbageclunk/repos","events_url":"https://api.github.com/users/babbageclunk/events{/privacy}","received_events_url":"https://api.github.com/users/babbageclunk/received_events","type":"User","site_admin":false},"repo":{"id":54490872,"node_id":"MDEwOlJlcG9zaXRvcnk1NDQ5MDg3Mg==","name":"juju","full_name":"babbageclunk/juju","private":false,"owner":{"login":"babbageclunk","id":563399,"node_id":"MDQ6VXNlcjU2MzM5OQ==","avatar_url":"https://avatars2.githubusercontent.com/u/563399?v=4","gravatar_id":"","url":"https://api.github.com/users/babbageclunk","html_url":"https://github.com/babbageclunk","followers_url":"https://api.github.com/users/babbageclunk/followers","following_url":"https://api.github.com/users/babbageclunk/following{/other_user}","gists_url":"https://api.github.com/users/babbageclunk/gists{/gist_id}","starred_url":"https://api.github.com/users/babbageclunk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/babbageclunk/subscriptions","organizations_url":"https://api.github.com/users/babbageclunk/orgs","repos_url":"https://api.github.com/users/babbageclunk/repos","events_url":"https://api.github.com/users/babbageclunk/events{/privacy}","received_events_url":"https://api.github.com/users/babbageclunk/received_events","type":"User","site_admin":false},"html_url":"https://github.com/babbageclunk/juju","description":"juju is devops distilled","fork":true,"url":"https://api.github.com/repos/babbageclunk/juju","forks_url":"https://api.github.com/repos/babbageclunk/juju/forks","keys_url":"https://api.github.com/repos/babbageclunk/juju/keys{/key_id}","collaborators_url":"https://api.github.com/repos/babbageclunk/juju/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/babbageclunk/juju/teams","hooks_url":"https://api.github.com/repos/babbageclunk/juju/hooks","issue_events_url":"https://api.github.com/repos/babbageclunk/juju/issues/events{/number}","events_url":"https://api.github.com/repos/babbageclunk/juju/events","assignees_url":"https://api.github.com/repos/babbageclunk/juju/assignees{/user}","branches_url":"https://api.github.com/repos/babbageclunk/juju/branches{/branch}","tags_url":"https://api.github.com/repos/babbageclunk/juju/tags","blobs_url":"https://api.github.com/repos/babbageclunk/juju/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/babbageclunk/juju/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/babbageclunk/juju/git/refs{/sha}","trees_url":"https://api.github.com/repos/babbageclunk/juju/git/trees{/sha}","statuses_url":"https://api.github.com/repos/babbageclunk/juju/statuses/{sha}","languages_url":"https://api.github.com/repos/babbageclunk/juju/languages","stargazers_url":"https://api.github.com/repos/babbageclunk/juju/stargazers","contributors_url":"https://api.github.com/repos/babbageclunk/juju/contributors","subscribers_url":"https://api.github.com/repos/babbageclunk/juju/subscribers","subscription_url":"https://api.github.com/repos/babbageclunk/juju/subscription","commits_url":"https://api.github.com/repos/babbageclunk/juju/commits{/sha}","git_commits_url":"https://api.github.com/repos/babbageclunk/juju/git/commits{/sha}","comments_url":"https://api.github.com/repos/babbageclunk/juju/comments{/number}","issue_comment_url":"https://api.github.com/repos/babbageclunk/juju/issues/comments{/number}","contents_url":"https://api.github.com/repos/babbageclunk/juju/contents/{+path}","compare_url":"https://api.github.com/repos/babbageclunk/juju/compare/{base}...{head}","merges_url":"https://api.github.com/repos/babbageclunk/juju/merges","archive_url":"https://api.github.com/repos/babbageclunk/juju/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/babbageclunk/juju/downloads","issues_url":"https://api.github.com/repos/babbageclunk/juju/issues{/number}","pulls_url":"https://api.github.com/repos/babbageclunk/juju/pulls{/number}","milestones_url":"https://api.github.com/repos/babbageclunk/juju/milestones{/number}","notifications_url":"https://api.github.com/repos/babbageclunk/juju/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/babbageclunk/juju/labels{/name}","releases_url":"https://api.github.com/repos/babbageclunk/juju/releases{/id}","deployments_url":"https://api.github.com/repos/babbageclunk/juju/deployments","created_at":"2016-03-22T16:26:25Z","updated_at":"2016-03-22T16:26:34Z","pushed_at":"2018-10-24T12:43:44Z","git_url":"git://github.com/babbageclunk/juju.git","ssh_url":"git@github.com:babbageclunk/juju.git","clone_url":"https://github.com/babbageclunk/juju.git","svn_url":"https://github.com/babbageclunk/juju","homepage":"juju.ubuntu.com","size":229365,"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":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"juju:develop","ref":"develop","sha":"ccaf9e1717d0396c99ca7d21cabf5b3a3f440d9d","user":{"login":"juju","id":4604548,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ2MDQ1NDg=","avatar_url":"https://avatars0.githubusercontent.com/u/4604548?v=4","gravatar_id":"","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,"node_id":"MDEwOlJlcG9zaXRvcnkyMDQ0NTk0Nw==","name":"juju","full_name":"juju/juju","private":false,"owner":{"login":"juju","id":4604548,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ2MDQ1NDg=","avatar_url":"https://avatars0.githubusercontent.com/u/4604548?v=4","gravatar_id":"","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},"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}","deployments_url":"https://api.github.com/repos/juju/juju/deployments","created_at":"2014-06-03T14:28:10Z","updated_at":"2018-10-24T21:27:03Z","pushed_at":"2018-10-24T21:26:59Z","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":230329,"stargazers_count":1257,"watchers_count":1257,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":292,"mirror_url":null,"archived":false,"open_issues_count":15,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":292,"open_issues":15,"watchers":1257,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/juju/juju/pulls/9366"},"html":{"href":"https://github.com/juju/juju/pull/9366"},"issue":{"href":"https://api.github.com/repos/juju/juju/issues/9366"},"comments":{"href":"https://api.github.com/repos/juju/juju/issues/9366/comments"},"review_comments":{"href":"https://api.github.com/repos/juju/juju/pulls/9366/comments"},"review_comment":{"href":"https://api.github.com/repos/juju/juju/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/juju/juju/pulls/9366/commits"},"statuses":{"href":"https://api.github.com/repos/juju/juju/statuses/7e27b668c3a45d05f9f7f9c7c7257e43a9acdb3a"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"babbageclunk"}}