Repository navigation
New Bedford: Add migration tools for changing school scope - #2609
Merged
Merged
Conversation
Contributor
Author
|
selfie |
This was referenced Sep 19, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Who is this PR for?
internal team, helping with limiting scope for work related to permissions in New Bedford
What problem does this PR fix?
Folks in New Bedford are focusing training and workshop efforts in particular schools, differently than the previous scope. #2608 updated to match that scope, but this leaves some drift.
We haven't reduced scope like this before, and the
school_scopeconcept in the importers is for supporting incremental deployments, debugging import jobs, or other kinds of partial imports where we only want to update a slice of the db state. So there aren't tools now for migrating previously imported data.What does this PR do?
Adds
SchoolScopeMigratorclass, which has methods for understanding theStudentandEducatorrecords, and which would currently be in scope and which would currently not be, based on the school definition files. This info can be useful for understanding what's happening, and there are specific methods here for migratingStudentandEducatorrecords in response to reducing the scope of the imports. It uses themissing_from_last_exportand#activeinterface on those models.Separately, these could be purged as part of a more rigorous enforcement of retention policies, but that isn't done here. This is the 'mark' but there is no 'sweeping' here.
Example output:
Checklists
Which features or pages does this PR touch?
Does this PR use tests to help verify we can deploy these changes quickly and confidently?