{"action":"created","issue":{"url":"https://api.github.com/repos/alphagov/publishing-api/issues/103","labels_url":"https://api.github.com/repos/alphagov/publishing-api/issues/103/labels{/name}","comments_url":"https://api.github.com/repos/alphagov/publishing-api/issues/103/comments","events_url":"https://api.github.com/repos/alphagov/publishing-api/issues/103/events","html_url":"https://github.com/alphagov/publishing-api/pull/103","id":113028791,"number":103,"title":"Version extract spike","user":{"login":"tuzz","id":892251,"avatar_url":"https://avatars.githubusercontent.com/u/892251?v=3","gravatar_id":"","url":"https://api.github.com/users/tuzz","html_url":"https://github.com/tuzz","followers_url":"https://api.github.com/users/tuzz/followers","following_url":"https://api.github.com/users/tuzz/following{/other_user}","gists_url":"https://api.github.com/users/tuzz/gists{/gist_id}","starred_url":"https://api.github.com/users/tuzz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tuzz/subscriptions","organizations_url":"https://api.github.com/users/tuzz/orgs","repos_url":"https://api.github.com/users/tuzz/repos","events_url":"https://api.github.com/users/tuzz/events{/privacy}","received_events_url":"https://api.github.com/users/tuzz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-10-23T14:18:17Z","updated_at":"2015-10-28T12:30:46Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/alphagov/publishing-api/pulls/103","html_url":"https://github.com/alphagov/publishing-api/pull/103","diff_url":"https://github.com/alphagov/publishing-api/pull/103.diff","patch_url":"https://github.com/alphagov/publishing-api/pull/103.patch"},"body":"This pull request is the conclusion of the Version extraction spike to refactor our application to be more decoupled and extensible. Please review and comment on this and we will discuss next week whether this is the approach we'd like to take going forwards.\r\n\r\nIn summary, this pull request introduces a Version model that externalises the responsibility of \"versioning\" from ContentItems as well as LinkSets. Note how these models no longer contain any reference to a version. We intentionally made the relationship one-sided (i.e. there's no bi-directionality to the association) to keep versioning logic out of these models.\r\n\r\nAt present, we've left the version columns on these models to give this code a grace period before we subsequently remove these columns in a follow-up pull request.\r\n\r\nReminder: **do not merge** until this has been discussed by the team. Thanks.\r\n\r\nNote: We found a potential problem whilst working on this story. Currently, when you push content into the system, the content store receives the payload that was made in the request to our API. This payload has things like `access_limited` removed where appropriate, but it leaves version in as it is.\r\n\r\nWhen we discussed this, we said that this should probably change and the payload that gets sent to the content store should be created from the derived representation models rather than simply forwarding the request payload through. We haven't addressed that issue in this pull request (given this is just a spike), but we should look at this - probably when we deal with the asynchronous content store story."},"comment":{"url":"https://api.github.com/repos/alphagov/publishing-api/issues/comments/151828818","html_url":"https://github.com/alphagov/publishing-api/pull/103#issuecomment-151828818","issue_url":"https://api.github.com/repos/alphagov/publishing-api/issues/103","id":151828818,"user":{"login":"elliotcm","id":109225,"avatar_url":"https://avatars.githubusercontent.com/u/109225?v=3","gravatar_id":"","url":"https://api.github.com/users/elliotcm","html_url":"https://github.com/elliotcm","followers_url":"https://api.github.com/users/elliotcm/followers","following_url":"https://api.github.com/users/elliotcm/following{/other_user}","gists_url":"https://api.github.com/users/elliotcm/gists{/gist_id}","starred_url":"https://api.github.com/users/elliotcm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elliotcm/subscriptions","organizations_url":"https://api.github.com/users/elliotcm/orgs","repos_url":"https://api.github.com/users/elliotcm/repos","events_url":"https://api.github.com/users/elliotcm/events{/privacy}","received_events_url":"https://api.github.com/users/elliotcm/received_events","type":"User","site_admin":false},"created_at":"2015-10-28T12:30:46Z","updated_at":"2015-10-28T12:30:46Z","body":"@tuzz Slightly more real world example, content store rejects pushed documents because of version mismatches (put in place due to async out of order issues), and now I need to go look up a specific document and see what version it's at in the live state.  Probably quite a common check.\r\n\r\nIf version and state were in different tables I've got 2 joins to do every time.\r\n\r\nIt's all about what information we have to work with from our logs and bug reports, and how many steps are required to get from that to a full view of the document."}}