{"action":"created","issue":{"url":"https://api.github.com/repos/juju/juju/issues/7387","repository_url":"https://api.github.com/repos/juju/juju","labels_url":"https://api.github.com/repos/juju/juju/issues/7387/labels{/name}","comments_url":"https://api.github.com/repos/juju/juju/issues/7387/comments","events_url":"https://api.github.com/repos/juju/juju/issues/7387/events","html_url":"https://github.com/juju/juju/pull/7387","id":231233162,"number":7387,"title":"Migrate local charm no resource","user":{"login":"howbazaar","id":1744247,"avatar_url":"https://avatars0.githubusercontent.com/u/1744247?v=3","gravatar_id":"","url":"https://api.github.com/users/howbazaar","html_url":"https://github.com/howbazaar","followers_url":"https://api.github.com/users/howbazaar/followers","following_url":"https://api.github.com/users/howbazaar/following{/other_user}","gists_url":"https://api.github.com/users/howbazaar/gists{/gist_id}","starred_url":"https://api.github.com/users/howbazaar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/howbazaar/subscriptions","organizations_url":"https://api.github.com/users/howbazaar/orgs","repos_url":"https://api.github.com/users/howbazaar/repos","events_url":"https://api.github.com/users/howbazaar/events{/privacy}","received_events_url":"https://api.github.com/users/howbazaar/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":17,"created_at":"2017-05-25T03:48:13Z","updated_at":"2017-05-26T06:41:55Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/juju/juju/pulls/7387","html_url":"https://github.com/juju/juju/pull/7387","diff_url":"https://github.com/juju/juju/pull/7387.diff","patch_url":"https://github.com/juju/juju/pull/7387.patch"},"body":"## Description of change\r\n\r\nIf a model deployed a local charm that has resources defined, but did not define any resources for that application, the model would fail to migrate. Also a local charm with local resources would migrate one time, but fail on subsequent attempts.\r\n\r\nThis branch fixes both of those problems. Firstly, resource definitions for an application where there is no actual resource are now handled by the model import code in the state package, rather in the binary upload process where it attempted to push empty placeholders. Also validation of the resource fingerprint was loosened so it doesn't try to validate an empty string.\r\n\r\n## QA steps\r\n\r\nLong... firstly make sure you have juju-ci-tools charms repo available, as I'm using their local charm. The resource itself is a simple index.html file that contains a string that you can validate came from the resource.\r\n\r\nBootstrap a controller and add two models, one for the local charm with a resource, and one with a local charm without a resource.\r\n```\r\njuju bootstrap lxd source\r\njuju add-model resource\r\njuju deploy ~/canonical/juju-ci-tools/repository/charms/simple-resource-http --resource index=~/sandbox/index.html\r\njuju add-model no-resource\r\njuju deploy ~/canonical/juju-ci-tools/repository/charms/simple-resource-http\r\n```\r\nEnsure that the resource is being used by using a web browser to look at the ip address of the machine that the app is deployed to.\r\n\r\nWait for the models to be fully deployed then bootstrap another controller to migrate the models to.\r\n```\r\njuju bootstrap lxd target\r\njuju switch source\r\njuju migrate resource target\r\njuju migrate no-resource target\r\n```\r\nWait for the migration to complete then ensure they are in the target controller. Add a unit to the resource model to make sure the resource is available. \r\n```\r\njuju models -c target\r\njuju add-unit -m target:resource simple-resource-http\r\n```\r\nEnsure it is used by looking at the IP address of machine-1 from the resource model.\r\nNow migrate the models back\r\n\r\n```\r\njuju switch target\r\njuju migrate resource source\r\njuju migrate no-resource source\r\n```\r\nWait for the migration to complete, then add another unit to the resource model and check again.\r\n```\r\njuju add-unit -m source:resource simple-resource-http\r\n```\r\n\r\n## Documentation changes\r\n\r\nNo docs needed, just fixing migration bugs.\r\n\r\n## Bug reference\r\n\r\nhttps://bugs.launchpad.net/juju/+bug/1692610\r\nhttps://bugs.launchpad.net/juju/+bug/1692646\r\n"},"comment":{"url":"https://api.github.com/repos/juju/juju/issues/comments/304205098","html_url":"https://github.com/juju/juju/pull/7387#issuecomment-304205098","issue_url":"https://api.github.com/repos/juju/juju/issues/7387","id":304205098,"user":{"login":"jujubot","id":7779494,"avatar_url":"https://avatars3.githubusercontent.com/u/7779494?v=3","gravatar_id":"","url":"https://api.github.com/users/jujubot","html_url":"https://github.com/jujubot","followers_url":"https://api.github.com/users/jujubot/followers","following_url":"https://api.github.com/users/jujubot/following{/other_user}","gists_url":"https://api.github.com/users/jujubot/gists{/gist_id}","starred_url":"https://api.github.com/users/jujubot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jujubot/subscriptions","organizations_url":"https://api.github.com/users/jujubot/orgs","repos_url":"https://api.github.com/users/jujubot/repos","events_url":"https://api.github.com/users/jujubot/events{/privacy}","received_events_url":"https://api.github.com/users/jujubot/received_events","type":"User","site_admin":false},"created_at":"2017-05-26T06:41:55Z","updated_at":"2017-05-26T06:41:55Z","body":"Build failed: Tests failed\n        build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/11008\n"}}
{"actor":{"display_login":"jujubot"}}