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

New TCF Purpose Header Field on Translations #5246

Merged
merged 9 commits into from
Aug 30, 2024

Conversation

pattisdr
Copy link
Contributor

@pattisdr pattisdr commented Aug 29, 2024

Closes #PROD-2616

Description Of Changes

Adds/updates TCF translation fields in support of the new minimal TCF banner

Code Changes

  • Adds a new purpose_header field on the ExperienceTranslation and on the historical record, the PrivacyExperienceConfigHistory table
  • Adds a data migration to populate purpose_header fields on all existing TCF translations as well as update the existing description, provided the customer is still on version 1 for that translation, meaning they've made no edits
Screenshot 2024-08-27 at 10 28 39 AM

Steps to Confirm

Pre-Merge Checklist

  • All CI Pipelines Succeeded
  • Documentation:
    • documentation complete, PR opened in fidesdocs
    • documentation issue created in fidesdocs
    • if there are any new client scopes created as part of the pull request, remember to update public-facing documentation that references our scope registry
  • Issue Requirements are Met
  • Relevant Follow-Up Issues Created
  • Update CHANGELOG.md
  • For API changes, the Postman collection has been updated
  • If there are any database migrations:
    • Ensure that your downrev is up to date with the latest revision on main
    • Ensure that your downgrade() migration is correct and works
      • If a downgrade migration is not possible for this change, please call this out in the PR description!

Copy link

vercel bot commented Aug 29, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
fides-plus-nightly ⬜️ Ignored (Inspect) Visit Preview Aug 30, 2024 7:11pm

Copy link

cypress bot commented Aug 29, 2024

fides    Run #9766

Run Properties:  status check passed Passed #9766  •  git commit c12f8fde30 ℹ️: Merge dd9b831055f219dd1e9fcf69378d212e4b634d35 into 87366729a3365e765a3a53e80ef4...
Project fides
Branch Review refs/pull/5246/merge
Run status status check passed Passed #9766
Run duration 00m 36s
Commit git commit c12f8fde30 ℹ️: Merge dd9b831055f219dd1e9fcf69378d212e4b634d35 into 87366729a3365e765a3a53e80ef4...
Committer Dawn Pattison
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 4
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.
View all changes introduced in this branch ↗︎

@pattisdr pattisdr marked this pull request as ready for review August 29, 2024 23:21
@@ -155,6 +155,7 @@ class ExperienceTranslationBase:
privacy_policy_link_label = Column(String)
privacy_policy_url = Column(String)
privacy_preferences_link_label = Column(String)
purpose_header = Column(String)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brand new purpose_header field showing up on the translations, the field is added here, on ExperienceTranslatoin, and on the ExperienceConfigHistory table, which stores every version. We have to keep a record of these changes so we can demonstrate the specifics of what was shown to the customer at a point in time.



def downgrade():
pass
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Considering what to add to downgrade here, maybe clear the purpose header, but I don't want to update descriptions necessarily in case they were updated by the end user too. The purpose header field is also entirely deleted altogether in the previous downgrade on the previous migration.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a situation where we would want/need to downgrade only cc37 and leave 1332 in place? I feel like it's enough to say that if this was reverted both migrations would end up downgraded and the field would be deleted entirely, in which case leaving this downgrade() empty is fine (I think? Not super familiar with alembic). Unless we want to combine the two to make it impossible to downgrade only one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes all good questions, I can probably add the downgrade on just the purpose header just in case. Matter of preference, I like separating schema and data migrations into separate files for their distinct operations!

Copy link
Contributor Author

@pattisdr pattisdr Aug 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm I think it's okay to just rely on the column delete on the previous one, if purpose_header is cleared, there's still an ExperienceConfigHistory record with the purpose_header on it. The downrev could delete the historical record, but it's possible other historical records were added in the interim, we can't assume there's just been one created. I think there's less meddling if we drop the field altogether -

depends_on = None

# fmt: off
updated_translations = {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These translations are normally stored in Fidesplus, but adding a subset of them here to facilitate adding them directly to existing ExperienceTranslations

Copy link
Contributor

@thingscouldbeworse thingscouldbeworse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved as is, we could address the downgrade path in the comment but I think it's fine to say if we needed to revert we would simply downgrade every version in this PR



def downgrade():
pass
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a situation where we would want/need to downgrade only cc37 and leave 1332 in place? I feel like it's enough to say that if this was reverted both migrations would end up downgraded and the field would be deleted entirely, in which case leaving this downgrade() empty is fine (I think? Not super familiar with alembic). Unless we want to combine the two to make it impossible to downgrade only one.

@pattisdr pattisdr merged commit b419256 into main Aug 30, 2024
37 checks passed
@pattisdr pattisdr deleted the PROD-2616_descriptions_purposes branch August 30, 2024 20:33
pattisdr added a commit that referenced this pull request Aug 30, 2024
- Adds a new purpose_header field on the ExperienceTranslation and on the historical record, the PrivacyExperienceConfigHistory table
- Adds a data migration to populate purpose_header fields on all existing TCF translations as well as update the existing description, provided the customer is still on version 1 for that translation, meaning they've made no edits
Copy link

cypress bot commented Aug 30, 2024

fides    Run #9777

Run Properties:  status check passed Passed #9777  •  git commit b419256b02: New TCF Purpose Header Field on Translations (#5246)
Project fides
Branch Review main
Run status status check passed Passed #9777
Run duration 00m 36s
Commit git commit b419256b02: New TCF Purpose Header Field on Translations (#5246)
Committer Dawn Pattison
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 4
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.
View all changes introduced in this branch ↗︎

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