-
Notifications
You must be signed in to change notification settings - Fork 74
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
Change taxonomy upsert behavior on server start #1007
Comments
From what I can tell, this will require changes to:
does this sound like what you were thinking @ThomasLaPiana ? if so, then I suppose this ticket would be about just handling when new default fields are added, since updates would be left to alembic and whatever new feature is being introduced |
@allisonking I see this and I'm chewing on it |
Sounds good! I made a PR for handling the new default fields that should be ready to go while we figure out what to do about data migrations #1040 |
hmmm I see, this is tricky. I agree that alembic migrations are a logical solution here (fidesops does include data migrations already in theirs), but like you said they can be difficult to test and verify... I still feel like somehow we should be able to fit this into the existing function, but my brain is still trying to figure out exactly how...definitely through some leveraging of the |
one more use case to add to this issue: do we want to be able to delete a user's default taxonomy fields? Users cannot create or delete their own default taxonomy fields (at least via the API). If so, this could also fall in the data migration category, or we could add some logic to |
Is there any way we could solve all of this by doing a per-object comparison? With this string of events...
If we can get a clear per-object diff, it seems like we should be able to write the logic in a way that would handle updates |
Let's consider the recent use case where we added an
Does that sound right to you? If so, I think this would be more complicated than just getting a diff |
Status of this ticket:
|
Thanks for the breakdown! My brain is finally tracking now. Agreed this is as complicated as you thought it was. As for when we removed those fields, I don't think we did anything actually, which isn't good. Our tests/checks ran on a fresh database, so nothing would've been flagged. Any user that came from an older version would still have those in their database The right thing would've been to add a section to an alembic migration to check for those values and remove them if they existed (fidesops did implement data migrations, not just schema migrations, for the big fideslang change) |
Here's my proposal for now:
|
That sounds good to me! Also might be time to refactor that function a bit, as |
Actually it just occurred to me that perhaps we don't want to delete like this in case the user is using one of the to-be-deleted taxonomy fields. Maybe we can first check if the field to be deleted is being used in any of the user's specs. If it isn't, then maybe it's safe to delete? Otherwise... log out a deprecation warning? Or maybe just change that field to |
I think its actually ok to break here. If the user bumps fides version, and it causes a break because that default item no longer exists, that seems reasonable to me? Then they would be "forced" to stay up-to-date with the current fideslang spec. Not sure how valuable that is though? Is it more valuable not to break their stuff? idk |
maybe we can let @mfbrown decide :) |
As a user, when the Fidesctl server restarts I don't want the taxonomy upsert to update existing default taxonomy elements, so that any field level additions I've made to the taxonomy are preserved.
This means that should we add new properties with default values to the existing taxonomy in future updates, a migration script will be needed so that the new properties are applied alongside the existing, user edited, elements.
Taking a look at this case with regard to the data use element, I should be able to provide values for the properties of name, description, legal_basis, special_category, recipient, etc which by default don't have values. If a new fideslang update is released which adds a property to data_use, then when that version is included in Fidesctl, a migration script is created to add the value and it's default to the data_use element.
Any other time the server restarts and the language is not updated, only new language elements should be added. Existing elements should not be overwritten.
Acceptance Criteria
This is meant to address this issue: #858 (comment) which is introduced by the fact that the taxonomy will be updated in the future and the state persisted potentially only in a database and not in YAML manifests which could be re-posted to the server after the default taxonomy is loaded.
The text was updated successfully, but these errors were encountered: