{"action":"created","comment":{"url":"https://api.github.com/repos/juju/juju/pulls/comments/201552944","pull_request_review_id":136075983,"id":201552944,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMTU1Mjk0NA==","diff_hunk":"@@ -684,6 +684,86 @@ func (s *unitSuite) TestWatchActionNotificationsMoreResults(c *gc.C) {\n \tc.Assert(err.Error(), gc.Equals, \"expected 1 result, got 2\")\n }\n \n+func (s *unitSuite) TestWatchUpgradeSeriesNotifications(c *gc.C) {\n+\twatcher, err := s.apiUnit.WatchUpgradeSeriesNotifications()\n+\tc.Assert(err, jc.ErrorIsNil)\n+\n+\tnotifyWatcher := watchertest.NewNotifyWatcherC(c, watcher, s.BackingState.StartSync)\n+\tdefer notifyWatcher.AssertStops()\n+\n+\t// Why do I have two initial events?!?\n+\t_, ok := <-notifyWatcher.Watcher.Changes()\n+\tnotifyWatcher.Assert(ok, jc.IsTrue)\n+\n+\tnotifyWatcher.AssertOneChange()\n+\n+\ts.CreateUpgradeSeriesLock(c)\n+\n+\t// Expect a notification that the document was created (i.e. a lock was placed)\n+\tnotifyWatcher.AssertOneChange()\n+\n+\terr = s.wordpressMachine.RemoveUpgradeSeriesLock()\n+\tc.Assert(err, jc.ErrorIsNil)\n+\n+\t// A notification that the document was removed (i.e. the lock was released)\n+\tnotifyWatcher.AssertOneChange()\n+}\n+\n+func (s *unitSuite) TestUpgradeSeriesStatus(c *gc.C) {\n+\t// First we create the prepare lock\n+\ts.CreateUpgradeSeriesLock(c)\n+\n+\t// Then we check to see the status of our upgrade. We note that creating\n+\t// the lock essentially kicks off an upgrade for the perspective of\n+\t// assigned units.\n+\tstatus, err := s.apiUnit.UpgradeSeriesStatus()\n+\tc.Assert(err, jc.ErrorIsNil)\n+\tc.Assert(status, gc.Equals, params.UnitStarted)\n+}\n+\n+func (s *unitSuite) TestSetUpgradeSeriesStatus(c *gc.C) {\n+\t// First we create the prepare lock or the required state will not exists\n+\ts.CreateUpgradeSeriesLock(c)\n+\n+\terr := s.apiUnit.SetUpgradeSeriesStatus(params.UnitStarted)\n+\tc.Assert(err, jc.ErrorIsNil)\n+\n+\t// Check to see that the upgrade status has been set appropriately\n+\tstatus, err := s.apiUnit.UpgradeSeriesStatus()\n+\tc.Assert(err, jc.ErrorIsNil)\n+\tc.Assert(status, gc.Equals, params.UnitStarted)\n+}\n+\n+func (s *unitSuite) TestSetUpgradeSeriesStatusShouldOnlySetSpecifiedUnit(c *gc.C) {\n+\t// add another unit\n+\tunit2, err := s.wordpressApplication.AddUnit(state.AddUnitParams{})\n+\tc.Assert(err, jc.ErrorIsNil)\n+\n+\terr = unit2.AssignToMachine(s.wordpressMachine)\n+\tc.Assert(err, jc.ErrorIsNil)\n+\n+\t// Creating a lock for the machine transitions all units to started state\n+\ts.CreateUpgradeSeriesLock(c, unit2.Name())\n+\n+\t// Complete one unit\n+\t_, err = unit2.SetUpgradeSeriesStatus(params.UnitCompleted)\n+\tc.Assert(err, jc.ErrorIsNil)\n+\n+\t// The other unit should still be in the started state\n+\tstatus, err := s.wordpressUnit.UpgradeSeriesStatus()\n+\tc.Assert(err, jc.ErrorIsNil)\n+\tc.Assert(status, gc.Equals, params.UnitStarted)\n+}\n+\n+func (s *unitSuite) CreateUpgradeSeriesLock(c *gc.C, additionalUnits ...string) {\n+\tunitNames := additionalUnits\n+\tunitNames = append(unitNames, s.wordpressUnit.Name())\n+\tseries := \"trust\"","path":"api/uniter/unit_test.go","position":80,"original_position":78,"commit_id":"aa6dcfffe1fa10935c1006361654986beed12e74","original_commit_id":"93b5a64dc6341b1e431462b70a6725182aeb4b38","user":{"login":"howbazaar","id":1744247,"node_id":"MDQ6VXNlcjE3NDQyNDc=","avatar_url":"https://avatars3.githubusercontent.com/u/1744247?v=4","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},"body":"Are we going to add validation that the series mentioned is one that juju knows about?","created_at":"2018-07-11T03:02:29Z","updated_at":"2018-07-11T03:23:30Z","html_url":"https://github.com/juju/juju/pull/8864#discussion_r201552944","pull_request_url":"https://api.github.com/repos/juju/juju/pulls/8864","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/juju/juju/pulls/comments/201552944"},"html":{"href":"https://github.com/juju/juju/pull/8864#discussion_r201552944"},"pull_request":{"href":"https://api.github.com/repos/juju/juju/pulls/8864"}},"in_reply_to_id":201108504},"pull_request":{"url":"https://api.github.com/repos/juju/juju/pulls/8864","id":197849158,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk3ODQ5MTU4","html_url":"https://github.com/juju/juju/pull/8864","diff_url":"https://github.com/juju/juju/pull/8864.diff","patch_url":"https://github.com/juju/juju/pull/8864.patch","issue_url":"https://api.github.com/repos/juju/juju/issues/8864","number":8864,"state":"open","locked":false,"title":"Trigger upgrade-series-prepare hook.","user":{"login":"ExternalReality","id":1026081,"node_id":"MDQ6VXNlcjEwMjYwODE=","avatar_url":"https://avatars3.githubusercontent.com/u/1026081?v=4","gravatar_id":"","url":"https://api.github.com/users/ExternalReality","html_url":"https://github.com/ExternalReality","followers_url":"https://api.github.com/users/ExternalReality/followers","following_url":"https://api.github.com/users/ExternalReality/following{/other_user}","gists_url":"https://api.github.com/users/ExternalReality/gists{/gist_id}","starred_url":"https://api.github.com/users/ExternalReality/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ExternalReality/subscriptions","organizations_url":"https://api.github.com/users/ExternalReality/orgs","repos_url":"https://api.github.com/users/ExternalReality/repos","events_url":"https://api.github.com/users/ExternalReality/events{/privacy}","received_events_url":"https://api.github.com/users/ExternalReality/received_events","type":"User","site_admin":false},"body":"## Description of change\r\n\r\nWhen a `upgrade-series prepare` is initiated hooks need to be run.\r\n","created_at":"2018-06-27T20:48:13Z","updated_at":"2018-07-11T03:23:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"687add103a58fcb0203b7fc5482c3dfed9bc60fc","assignee":null,"assignees":[],"requested_reviewers":[{"login":"jameinel","id":202877,"node_id":"MDQ6VXNlcjIwMjg3Nw==","avatar_url":"https://avatars0.githubusercontent.com/u/202877?v=4","gravatar_id":"","url":"https://api.github.com/users/jameinel","html_url":"https://github.com/jameinel","followers_url":"https://api.github.com/users/jameinel/followers","following_url":"https://api.github.com/users/jameinel/following{/other_user}","gists_url":"https://api.github.com/users/jameinel/gists{/gist_id}","starred_url":"https://api.github.com/users/jameinel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jameinel/subscriptions","organizations_url":"https://api.github.com/users/jameinel/orgs","repos_url":"https://api.github.com/users/jameinel/repos","events_url":"https://api.github.com/users/jameinel/events{/privacy}","received_events_url":"https://api.github.com/users/jameinel/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/juju/juju/pulls/8864/commits","review_comments_url":"https://api.github.com/repos/juju/juju/pulls/8864/comments","review_comment_url":"https://api.github.com/repos/juju/juju/pulls/comments{/number}","comments_url":"https://api.github.com/repos/juju/juju/issues/8864/comments","statuses_url":"https://api.github.com/repos/juju/juju/statuses/aa6dcfffe1fa10935c1006361654986beed12e74","head":{"label":"ExternalReality:ensure_upgrade_series_hooks_run","ref":"ensure_upgrade_series_hooks_run","sha":"aa6dcfffe1fa10935c1006361654986beed12e74","user":{"login":"ExternalReality","id":1026081,"node_id":"MDQ6VXNlcjEwMjYwODE=","avatar_url":"https://avatars3.githubusercontent.com/u/1026081?v=4","gravatar_id":"","url":"https://api.github.com/users/ExternalReality","html_url":"https://github.com/ExternalReality","followers_url":"https://api.github.com/users/ExternalReality/followers","following_url":"https://api.github.com/users/ExternalReality/following{/other_user}","gists_url":"https://api.github.com/users/ExternalReality/gists{/gist_id}","starred_url":"https://api.github.com/users/ExternalReality/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ExternalReality/subscriptions","organizations_url":"https://api.github.com/users/ExternalReality/orgs","repos_url":"https://api.github.com/users/ExternalReality/repos","events_url":"https://api.github.com/users/ExternalReality/events{/privacy}","received_events_url":"https://api.github.com/users/ExternalReality/received_events","type":"User","site_admin":false},"repo":{"id":82218532,"node_id":"MDEwOlJlcG9zaXRvcnk4MjIxODUzMg==","name":"juju","full_name":"ExternalReality/juju","owner":{"login":"ExternalReality","id":1026081,"node_id":"MDQ6VXNlcjEwMjYwODE=","avatar_url":"https://avatars3.githubusercontent.com/u/1026081?v=4","gravatar_id":"","url":"https://api.github.com/users/ExternalReality","html_url":"https://github.com/ExternalReality","followers_url":"https://api.github.com/users/ExternalReality/followers","following_url":"https://api.github.com/users/ExternalReality/following{/other_user}","gists_url":"https://api.github.com/users/ExternalReality/gists{/gist_id}","starred_url":"https://api.github.com/users/ExternalReality/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ExternalReality/subscriptions","organizations_url":"https://api.github.com/users/ExternalReality/orgs","repos_url":"https://api.github.com/users/ExternalReality/repos","events_url":"https://api.github.com/users/ExternalReality/events{/privacy}","received_events_url":"https://api.github.com/users/ExternalReality/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ExternalReality/juju","description":"juju is devops distilled","fork":true,"url":"https://api.github.com/repos/ExternalReality/juju","forks_url":"https://api.github.com/repos/ExternalReality/juju/forks","keys_url":"https://api.github.com/repos/ExternalReality/juju/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ExternalReality/juju/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ExternalReality/juju/teams","hooks_url":"https://api.github.com/repos/ExternalReality/juju/hooks","issue_events_url":"https://api.github.com/repos/ExternalReality/juju/issues/events{/number}","events_url":"https://api.github.com/repos/ExternalReality/juju/events","assignees_url":"https://api.github.com/repos/ExternalReality/juju/assignees{/user}","branches_url":"https://api.github.com/repos/ExternalReality/juju/branches{/branch}","tags_url":"https://api.github.com/repos/ExternalReality/juju/tags","blobs_url":"https://api.github.com/repos/ExternalReality/juju/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ExternalReality/juju/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ExternalReality/juju/git/refs{/sha}","trees_url":"https://api.github.com/repos/ExternalReality/juju/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ExternalReality/juju/statuses/{sha}","languages_url":"https://api.github.com/repos/ExternalReality/juju/languages","stargazers_url":"https://api.github.com/repos/ExternalReality/juju/stargazers","contributors_url":"https://api.github.com/repos/ExternalReality/juju/contributors","subscribers_url":"https://api.github.com/repos/ExternalReality/juju/subscribers","subscription_url":"https://api.github.com/repos/ExternalReality/juju/subscription","commits_url":"https://api.github.com/repos/ExternalReality/juju/commits{/sha}","git_commits_url":"https://api.github.com/repos/ExternalReality/juju/git/commits{/sha}","comments_url":"https://api.github.com/repos/ExternalReality/juju/comments{/number}","issue_comment_url":"https://api.github.com/repos/ExternalReality/juju/issues/comments{/number}","contents_url":"https://api.github.com/repos/ExternalReality/juju/contents/{+path}","compare_url":"https://api.github.com/repos/ExternalReality/juju/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ExternalReality/juju/merges","archive_url":"https://api.github.com/repos/ExternalReality/juju/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ExternalReality/juju/downloads","issues_url":"https://api.github.com/repos/ExternalReality/juju/issues{/number}","pulls_url":"https://api.github.com/repos/ExternalReality/juju/pulls{/number}","milestones_url":"https://api.github.com/repos/ExternalReality/juju/milestones{/number}","notifications_url":"https://api.github.com/repos/ExternalReality/juju/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ExternalReality/juju/labels{/name}","releases_url":"https://api.github.com/repos/ExternalReality/juju/releases{/id}","deployments_url":"https://api.github.com/repos/ExternalReality/juju/deployments","created_at":"2017-02-16T19:36:01Z","updated_at":"2017-02-16T19:36:14Z","pushed_at":"2018-07-10T23:22:28Z","git_url":"git://github.com/ExternalReality/juju.git","ssh_url":"git@github.com:ExternalReality/juju.git","clone_url":"https://github.com/ExternalReality/juju.git","svn_url":"https://github.com/ExternalReality/juju","homepage":"juju.ubuntu.com","size":213896,"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":1,"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":1,"watchers":0,"default_branch":"staging"}},"base":{"label":"juju:develop","ref":"develop","sha":"f5e4b275ee48a77a9c7825a2f2929acf4a15011c","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","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},"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}","deployments_url":"https://api.github.com/repos/juju/juju/deployments","created_at":"2014-06-03T14:28:10Z","updated_at":"2018-07-11T02:50:10Z","pushed_at":"2018-07-11T03:09:34Z","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":213996,"stargazers_count":1180,"watchers_count":1180,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":274,"mirror_url":null,"archived":false,"open_issues_count":16,"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":274,"open_issues":16,"watchers":1180,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/juju/juju/pulls/8864"},"html":{"href":"https://github.com/juju/juju/pull/8864"},"issue":{"href":"https://api.github.com/repos/juju/juju/issues/8864"},"comments":{"href":"https://api.github.com/repos/juju/juju/issues/8864/comments"},"review_comments":{"href":"https://api.github.com/repos/juju/juju/pulls/8864/comments"},"review_comment":{"href":"https://api.github.com/repos/juju/juju/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/juju/juju/pulls/8864/commits"},"statuses":{"href":"https://api.github.com/repos/juju/juju/statuses/aa6dcfffe1fa10935c1006361654986beed12e74"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"howbazaar"}}