{"action":"created","comment":{"url":"https://api.github.com/repos/ClusterHQ/flocker/pulls/comments/64417672","id":64417672,"diff_hunk":"@@ -761,11 +768,51 @@ def test_upgrade_configuration_versions(self, versions):\n         \"\"\"\n         source_version, target_version = versions\n         configs_dir = FilePath(__file__).sibling('configurations')\n-        source_json_file = b\"configuration_v%d.json\" % source_version\n-        target_json_file = b\"configuration_v%d.json\" % versions[1]\n+\n+        # Choose the latest configuration number available for the given\n+        # version of the config. The configuration has increased in complexity\n+        # over time, so we have added additional configurations to verify that\n+        # the new fields can be correctly upgraded.\n+        source_json_glob = b\"configuration_*_v%d.json\" % source_version\n+        source_jsons = sorted(configs_dir.globChildren(source_json_glob),\n+                              key=lambda x: x.basename())\n+        config_num = int(source_jsons[-1].basename().split('_')[1])\n+\n+        source_json_file = b\"configuration_%d_v%d.json\" % (config_num,\n+                                                           versions[0])\n+        target_json_file = b\"configuration_%d_v%d.json\" % (config_num,\n+                                                           versions[1])\n         source_json = configs_dir.child(source_json_file).getContent()\n         target_json = configs_dir.child(target_json_file).getContent()\n         upgraded_json = migrate_configuration(\n             source_version, target_version,\n             source_json, ConfigurationMigration)\n         self.assertEqual(json.loads(upgraded_json), json.loads(target_json))\n+\n+\n+class LatestGoldenFilesValid(TestCase):\n+    \"\"\"\n+    Tests for the latest golden files to ensure they have not regressed.\n+    \"\"\"\n+\n+    def test_can_create_latest_golden(self):\n+        \"\"\"\n+        The latest golden files should be identical to ones generated from\n+        HEAD.\n+        \"\"\"\n+        configs_dir = FilePath(__file__).sibling('configurations')\n+        for i, deployment in enumerate(TEST_DEPLOYMENTS, start=1):\n+            encoding = wire_encode(\n+                Configuration(version=_CONFIG_VERSION, deployment=deployment)\n+            )\n+            path = configs_dir.child(\n+                b\"configuration_%d_v%d.json\" % (i, _CONFIG_VERSION)\n+            )\n+            self.assertEqual(\n+                encoding, path.getContent(),\n+                \"Golden test file %s can not be generated from HEAD. Please \"\n+                \"review the python files in that directory to re-generate \"\n+                \"that file if you have intentionally changed the backing test \"\n+                \"data. You might need to rev the model if you are \"\n+                \"intentionally changing the model.\" % path.path","path":"flocker/control/test/test_persistence.py","position":null,"original_position":247,"commit_id":"bd86886b83108bb8b2f4b73d3bb04d625964aef3","original_commit_id":"e005e64ae8924cdc8fbef168510ea4eabadd7396","user":{"login":"sarum90","id":604129,"avatar_url":"https://avatars.githubusercontent.com/u/604129?v=3","gravatar_id":"","url":"https://api.github.com/users/sarum90","html_url":"https://github.com/sarum90","followers_url":"https://api.github.com/users/sarum90/followers","following_url":"https://api.github.com/users/sarum90/following{/other_user}","gists_url":"https://api.github.com/users/sarum90/gists{/gist_id}","starred_url":"https://api.github.com/users/sarum90/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sarum90/subscriptions","organizations_url":"https://api.github.com/users/sarum90/orgs","repos_url":"https://api.github.com/users/sarum90/repos","events_url":"https://api.github.com/users/sarum90/events{/privacy}","received_events_url":"https://api.github.com/users/sarum90/received_events","type":"User","site_admin":false},"body":"yea I mean \"rev\" as in \"increase the version and do whatever special version bump dance you have to do\".\r\n\r\nIn this case, increase the version and write an upgrade script. Reworded to explicitly say that rather than use the word `rev`.","created_at":"2016-05-24T15:44:06Z","updated_at":"2016-05-24T15:44:06Z","html_url":"https://github.com/ClusterHQ/flocker/pull/2794#discussion_r64417672","pull_request_url":"https://api.github.com/repos/ClusterHQ/flocker/pulls/2794","_links":{"self":{"href":"https://api.github.com/repos/ClusterHQ/flocker/pulls/comments/64417672"},"html":{"href":"https://github.com/ClusterHQ/flocker/pull/2794#discussion_r64417672"},"pull_request":{"href":"https://api.github.com/repos/ClusterHQ/flocker/pulls/2794"}}},"pull_request":{"url":"https://api.github.com/repos/ClusterHQ/flocker/pulls/2794","id":70776614,"html_url":"https://github.com/ClusterHQ/flocker/pull/2794","diff_url":"https://github.com/ClusterHQ/flocker/pull/2794.diff","patch_url":"https://github.com/ClusterHQ/flocker/pull/2794.patch","issue_url":"https://api.github.com/repos/ClusterHQ/flocker/issues/2794","number":2794,"state":"open","locked":false,"title":"[FLOC-4413] Fix golden files","user":{"login":"sarum90","id":604129,"avatar_url":"https://avatars.githubusercontent.com/u/604129?v=3","gravatar_id":"","url":"https://api.github.com/users/sarum90","html_url":"https://github.com/sarum90","followers_url":"https://api.github.com/users/sarum90/followers","following_url":"https://api.github.com/users/sarum90/following{/other_user}","gists_url":"https://api.github.com/users/sarum90/gists{/gist_id}","starred_url":"https://api.github.com/users/sarum90/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sarum90/subscriptions","organizations_url":"https://api.github.com/users/sarum90/orgs","repos_url":"https://api.github.com/users/sarum90/repos","events_url":"https://api.github.com/users/sarum90/events{/privacy}","received_events_url":"https://api.github.com/users/sarum90/received_events","type":"User","site_admin":false},"body":"I've done 2 things in this PR.\r\n\r\n1) I've added a regression test to verify that HEAD can always generate the latest golden file. This should fix the problem I encountered where I could no longer generate the golden file from master, and was confused as to why.\r\n\r\n2) I've added additional infrastructure to enable us to generate multiple golden files per config version. This is important because version 4 added some complexity to the config file that should be tested. This complexity does not exist in versions 1 through 3, so it only needs to be tested for versions 4+. Thus when we add version 5 we need to test that it can be upgraded to with 2 different versions:\r\n\r\n- One that is valid to upgrade all the way from version 1 to version 5 (and 2 to 5 and 3 to 5)\r\n- One that tests the new complexity added in version 4, and verifies that we can upgrade from that configuration to version 5.","created_at":"2016-05-19T22:35:03Z","updated_at":"2016-05-24T15:44:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a94aaa4ad6c2ccd6d8c83cbf41b5ff6e3920afd9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ClusterHQ/flocker/pulls/2794/commits","review_comments_url":"https://api.github.com/repos/ClusterHQ/flocker/pulls/2794/comments","review_comment_url":"https://api.github.com/repos/ClusterHQ/flocker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ClusterHQ/flocker/issues/2794/comments","statuses_url":"https://api.github.com/repos/ClusterHQ/flocker/statuses/bd86886b83108bb8b2f4b73d3bb04d625964aef3","head":{"label":"ClusterHQ:FLOC-4413-fix-golden-files","ref":"FLOC-4413-fix-golden-files","sha":"bd86886b83108bb8b2f4b73d3bb04d625964aef3","user":{"login":"ClusterHQ","id":7913449,"avatar_url":"https://avatars.githubusercontent.com/u/7913449?v=3","gravatar_id":"","url":"https://api.github.com/users/ClusterHQ","html_url":"https://github.com/ClusterHQ","followers_url":"https://api.github.com/users/ClusterHQ/followers","following_url":"https://api.github.com/users/ClusterHQ/following{/other_user}","gists_url":"https://api.github.com/users/ClusterHQ/gists{/gist_id}","starred_url":"https://api.github.com/users/ClusterHQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ClusterHQ/subscriptions","organizations_url":"https://api.github.com/users/ClusterHQ/orgs","repos_url":"https://api.github.com/users/ClusterHQ/repos","events_url":"https://api.github.com/users/ClusterHQ/events{/privacy}","received_events_url":"https://api.github.com/users/ClusterHQ/received_events","type":"Organization","site_admin":false},"repo":{"id":19248542,"name":"flocker","full_name":"ClusterHQ/flocker","owner":{"login":"ClusterHQ","id":7913449,"avatar_url":"https://avatars.githubusercontent.com/u/7913449?v=3","gravatar_id":"","url":"https://api.github.com/users/ClusterHQ","html_url":"https://github.com/ClusterHQ","followers_url":"https://api.github.com/users/ClusterHQ/followers","following_url":"https://api.github.com/users/ClusterHQ/following{/other_user}","gists_url":"https://api.github.com/users/ClusterHQ/gists{/gist_id}","starred_url":"https://api.github.com/users/ClusterHQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ClusterHQ/subscriptions","organizations_url":"https://api.github.com/users/ClusterHQ/orgs","repos_url":"https://api.github.com/users/ClusterHQ/repos","events_url":"https://api.github.com/users/ClusterHQ/events{/privacy}","received_events_url":"https://api.github.com/users/ClusterHQ/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ClusterHQ/flocker","description":"Container data volume manager for your Dockerized application","fork":false,"url":"https://api.github.com/repos/ClusterHQ/flocker","forks_url":"https://api.github.com/repos/ClusterHQ/flocker/forks","keys_url":"https://api.github.com/repos/ClusterHQ/flocker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ClusterHQ/flocker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ClusterHQ/flocker/teams","hooks_url":"https://api.github.com/repos/ClusterHQ/flocker/hooks","issue_events_url":"https://api.github.com/repos/ClusterHQ/flocker/issues/events{/number}","events_url":"https://api.github.com/repos/ClusterHQ/flocker/events","assignees_url":"https://api.github.com/repos/ClusterHQ/flocker/assignees{/user}","branches_url":"https://api.github.com/repos/ClusterHQ/flocker/branches{/branch}","tags_url":"https://api.github.com/repos/ClusterHQ/flocker/tags","blobs_url":"https://api.github.com/repos/ClusterHQ/flocker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ClusterHQ/flocker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ClusterHQ/flocker/git/refs{/sha}","trees_url":"https://api.github.com/repos/ClusterHQ/flocker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ClusterHQ/flocker/statuses/{sha}","languages_url":"https://api.github.com/repos/ClusterHQ/flocker/languages","stargazers_url":"https://api.github.com/repos/ClusterHQ/flocker/stargazers","contributors_url":"https://api.github.com/repos/ClusterHQ/flocker/contributors","subscribers_url":"https://api.github.com/repos/ClusterHQ/flocker/subscribers","subscription_url":"https://api.github.com/repos/ClusterHQ/flocker/subscription","commits_url":"https://api.github.com/repos/ClusterHQ/flocker/commits{/sha}","git_commits_url":"https://api.github.com/repos/ClusterHQ/flocker/git/commits{/sha}","comments_url":"https://api.github.com/repos/ClusterHQ/flocker/comments{/number}","issue_comment_url":"https://api.github.com/repos/ClusterHQ/flocker/issues/comments{/number}","contents_url":"https://api.github.com/repos/ClusterHQ/flocker/contents/{+path}","compare_url":"https://api.github.com/repos/ClusterHQ/flocker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ClusterHQ/flocker/merges","archive_url":"https://api.github.com/repos/ClusterHQ/flocker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ClusterHQ/flocker/downloads","issues_url":"https://api.github.com/repos/ClusterHQ/flocker/issues{/number}","pulls_url":"https://api.github.com/repos/ClusterHQ/flocker/pulls{/number}","milestones_url":"https://api.github.com/repos/ClusterHQ/flocker/milestones{/number}","notifications_url":"https://api.github.com/repos/ClusterHQ/flocker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ClusterHQ/flocker/labels{/name}","releases_url":"https://api.github.com/repos/ClusterHQ/flocker/releases{/id}","deployments_url":"https://api.github.com/repos/ClusterHQ/flocker/deployments","created_at":"2014-04-28T18:02:14Z","updated_at":"2016-05-24T01:44:38Z","pushed_at":"2016-05-24T15:43:20Z","git_url":"git://github.com/ClusterHQ/flocker.git","ssh_url":"git@github.com:ClusterHQ/flocker.git","clone_url":"https://github.com/ClusterHQ/flocker.git","svn_url":"https://github.com/ClusterHQ/flocker","homepage":"https://clusterhq.com","size":60254,"stargazers_count":2312,"watchers_count":2312,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":176,"mirror_url":null,"open_issues_count":42,"forks":176,"open_issues":42,"watchers":2312,"default_branch":"master"}},"base":{"label":"ClusterHQ:master","ref":"master","sha":"5e6f9a8ab42c1346ae7bf42f984758330e353891","user":{"login":"ClusterHQ","id":7913449,"avatar_url":"https://avatars.githubusercontent.com/u/7913449?v=3","gravatar_id":"","url":"https://api.github.com/users/ClusterHQ","html_url":"https://github.com/ClusterHQ","followers_url":"https://api.github.com/users/ClusterHQ/followers","following_url":"https://api.github.com/users/ClusterHQ/following{/other_user}","gists_url":"https://api.github.com/users/ClusterHQ/gists{/gist_id}","starred_url":"https://api.github.com/users/ClusterHQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ClusterHQ/subscriptions","organizations_url":"https://api.github.com/users/ClusterHQ/orgs","repos_url":"https://api.github.com/users/ClusterHQ/repos","events_url":"https://api.github.com/users/ClusterHQ/events{/privacy}","received_events_url":"https://api.github.com/users/ClusterHQ/received_events","type":"Organization","site_admin":false},"repo":{"id":19248542,"name":"flocker","full_name":"ClusterHQ/flocker","owner":{"login":"ClusterHQ","id":7913449,"avatar_url":"https://avatars.githubusercontent.com/u/7913449?v=3","gravatar_id":"","url":"https://api.github.com/users/ClusterHQ","html_url":"https://github.com/ClusterHQ","followers_url":"https://api.github.com/users/ClusterHQ/followers","following_url":"https://api.github.com/users/ClusterHQ/following{/other_user}","gists_url":"https://api.github.com/users/ClusterHQ/gists{/gist_id}","starred_url":"https://api.github.com/users/ClusterHQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ClusterHQ/subscriptions","organizations_url":"https://api.github.com/users/ClusterHQ/orgs","repos_url":"https://api.github.com/users/ClusterHQ/repos","events_url":"https://api.github.com/users/ClusterHQ/events{/privacy}","received_events_url":"https://api.github.com/users/ClusterHQ/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ClusterHQ/flocker","description":"Container data volume manager for your Dockerized application","fork":false,"url":"https://api.github.com/repos/ClusterHQ/flocker","forks_url":"https://api.github.com/repos/ClusterHQ/flocker/forks","keys_url":"https://api.github.com/repos/ClusterHQ/flocker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ClusterHQ/flocker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ClusterHQ/flocker/teams","hooks_url":"https://api.github.com/repos/ClusterHQ/flocker/hooks","issue_events_url":"https://api.github.com/repos/ClusterHQ/flocker/issues/events{/number}","events_url":"https://api.github.com/repos/ClusterHQ/flocker/events","assignees_url":"https://api.github.com/repos/ClusterHQ/flocker/assignees{/user}","branches_url":"https://api.github.com/repos/ClusterHQ/flocker/branches{/branch}","tags_url":"https://api.github.com/repos/ClusterHQ/flocker/tags","blobs_url":"https://api.github.com/repos/ClusterHQ/flocker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ClusterHQ/flocker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ClusterHQ/flocker/git/refs{/sha}","trees_url":"https://api.github.com/repos/ClusterHQ/flocker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ClusterHQ/flocker/statuses/{sha}","languages_url":"https://api.github.com/repos/ClusterHQ/flocker/languages","stargazers_url":"https://api.github.com/repos/ClusterHQ/flocker/stargazers","contributors_url":"https://api.github.com/repos/ClusterHQ/flocker/contributors","subscribers_url":"https://api.github.com/repos/ClusterHQ/flocker/subscribers","subscription_url":"https://api.github.com/repos/ClusterHQ/flocker/subscription","commits_url":"https://api.github.com/repos/ClusterHQ/flocker/commits{/sha}","git_commits_url":"https://api.github.com/repos/ClusterHQ/flocker/git/commits{/sha}","comments_url":"https://api.github.com/repos/ClusterHQ/flocker/comments{/number}","issue_comment_url":"https://api.github.com/repos/ClusterHQ/flocker/issues/comments{/number}","contents_url":"https://api.github.com/repos/ClusterHQ/flocker/contents/{+path}","compare_url":"https://api.github.com/repos/ClusterHQ/flocker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ClusterHQ/flocker/merges","archive_url":"https://api.github.com/repos/ClusterHQ/flocker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ClusterHQ/flocker/downloads","issues_url":"https://api.github.com/repos/ClusterHQ/flocker/issues{/number}","pulls_url":"https://api.github.com/repos/ClusterHQ/flocker/pulls{/number}","milestones_url":"https://api.github.com/repos/ClusterHQ/flocker/milestones{/number}","notifications_url":"https://api.github.com/repos/ClusterHQ/flocker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ClusterHQ/flocker/labels{/name}","releases_url":"https://api.github.com/repos/ClusterHQ/flocker/releases{/id}","deployments_url":"https://api.github.com/repos/ClusterHQ/flocker/deployments","created_at":"2014-04-28T18:02:14Z","updated_at":"2016-05-24T01:44:38Z","pushed_at":"2016-05-24T15:43:20Z","git_url":"git://github.com/ClusterHQ/flocker.git","ssh_url":"git@github.com:ClusterHQ/flocker.git","clone_url":"https://github.com/ClusterHQ/flocker.git","svn_url":"https://github.com/ClusterHQ/flocker","homepage":"https://clusterhq.com","size":60254,"stargazers_count":2312,"watchers_count":2312,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":176,"mirror_url":null,"open_issues_count":42,"forks":176,"open_issues":42,"watchers":2312,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ClusterHQ/flocker/pulls/2794"},"html":{"href":"https://github.com/ClusterHQ/flocker/pull/2794"},"issue":{"href":"https://api.github.com/repos/ClusterHQ/flocker/issues/2794"},"comments":{"href":"https://api.github.com/repos/ClusterHQ/flocker/issues/2794/comments"},"review_comments":{"href":"https://api.github.com/repos/ClusterHQ/flocker/pulls/2794/comments"},"review_comment":{"href":"https://api.github.com/repos/ClusterHQ/flocker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ClusterHQ/flocker/pulls/2794/commits"},"statuses":{"href":"https://api.github.com/repos/ClusterHQ/flocker/statuses/bd86886b83108bb8b2f4b73d3bb04d625964aef3"}}}}
{"actor":{"display_login":"sarum90"}}