Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data 005 - Part 1 - Fix Past Fixtures (refactor & test fixture migrations) #6572

Merged
merged 1 commit into from
Mar 7, 2016

Conversation

ErisDS
Copy link
Member

@ErisDS ErisDS commented Mar 2, 2016

There are currently 8 commits here, which should be squashed before merging.

Here's a rough outline of what I have done:

Fixtures:

  • Removed all the old 003 fixture upgrades
  • Split the 004 fixture upgrade tasks out, each into their own file
  • Improved the versioning code that figured out which upgrades we should do
  • Added lots of test coverage to make sure all the fixtures are still being run correctly.

Permissions fixtures:

  • Changed the code that was populating permissions fixtures to be more automated & based only on what is in the permissions.json file.
  • Added lots of test coverage to make sure all the permissions are still being created correctly.

Merging the two things:

  • Merged the content of permissions.json and fixtures.json into fixtures.json, but using the new structure from permissions.json.
  • Changed to use the new automated model & relation creation for all fixtures, not just permissions.
  • The only thing that can't be auto-populated just now is the owner creation, I think that's important enough to do separately.
  • There were (so far) never any permission updates, so code for updating fixtures stays the same through the merge.

The result is significantly less code for handling fixture updates and population, and significantly more tests.

Current test coverage on master 😞 :

Test coverage with this PR 🎉 :



refs TryGhost#6301

Fixtures:
- Removed all the old (and now broken) 003 fixture upgrades
- Split the 004 fixture upgrade tasks out, each into their own file
- Improved the versioning code that figured out which upgrades we should do
- Added lots of test coverage to make sure all the fixtures are still being run correctly.

Permissions fixtures:
- Changed the code that was populating permissions fixtures to be more automated & based only on what is in the permissions.json file.
- Added lots of test coverage to make sure all the permissions are still being created correctly.

Merging the two things:
- Merged the content of permissions.json and fixtures.json into fixtures.json, but using the new structure from permissions.json.
- Changed to use the new automated model & relation creation for all fixtures, not just permissions.
- The only thing that can't be auto-populated just now is the owner creation, I think that's important enough to do separately.
- There were (so far) never any permission updates, so code for updating fixtures stays the same through the merge.
- This results in two clear code paths: populate (fill out a brand new DB) and update (make any changes since the last version)

Test coverage is now 100% across both updates and populations.
@ErisDS ErisDS force-pushed the data005-part1-fixpastfixtures branch from 6daef12 to b2659d0 Compare March 3, 2016 09:08
@ErisDS ErisDS changed the title [WIP] Data 005 - Part 1 - Fix Past Fixtures Data 005 - Part 1 - Fix Past Fixtures (refactor & test fixture migrations) Mar 3, 2016
@sebgie sebgie self-assigned this Mar 3, 2016
sebgie added a commit that referenced this pull request Mar 7, 2016
Data 005 - Part 1 - Fix Past Fixtures (refactor & test fixture migrations)
@sebgie sebgie merged commit 21770c5 into TryGhost:master Mar 7, 2016
@sebgie sebgie deleted the data005-part1-fixpastfixtures branch March 7, 2016 10:26
@ErisDS ErisDS mentioned this pull request Mar 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants