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

Rename Privacy Notice Properties #5259

Merged
merged 8 commits into from
Sep 7, 2024

Conversation

pattisdr
Copy link
Contributor

@pattisdr pattisdr commented Sep 5, 2024

Closes #PROD-2708

Description Of Changes

Rename some properties on PrivacyNotice models that have the same name as fields exposed in the API. We want to intentionally choose when these properties are used in the API instead of having them be used automatically. Further, refactor these properties to be slightly more performant when they are called directly.

Code Changes

  • PrivacyNotice.systems_applicable property renamed to calculated_systems_applicable. Refactored to be slightly more performant, and will typically be used now for serializing a single notice, not multiple notices.
  • PrivacyNotice.configured_regions property renamed to configured_regions_for_notice and refactored to be slightly more performant by using raw sql. This will generally just be used for serializing a single privacy notice - when serializing bulk notices, Plus will typically do the regions calculation separately and share among multiple notices.
  • Regenerates FE types - picks up changes from multiple features

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!

…regions" to something that doesn't overlap the fields on the PrivacyNotice schemas in Fidesplus. This way these properties won't automatically be called when trying to serialize a list of Privacy Notices via the API.

- Make the new properties more efficient so they can still be used when serializing a single Privacy Notice.
Copy link

vercel bot commented Sep 5, 2024

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

Name Status Preview Comments Updated (UTC)
fides-plus-nightly ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 5, 2024 5:48pm

Copy link

cypress bot commented Sep 5, 2024

fides    Run #9810

Run Properties:  status check passed Passed #9810  •  git commit d3e48037b2 ℹ️: Merge 914b5f2f49370e512766fb22e70c6cfc1ae50601 into 9744bf9fe65fbe5dd034d3371a24...
Project fides
Branch Review refs/pull/5259/merge
Run status status check passed Passed #9810
Run duration 00m 37s
Commit git commit d3e48037b2 ℹ️: Merge 914b5f2f49370e512766fb22e70c6cfc1ae50601 into 9744bf9fe65fbe5dd034d3371a24...
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
View all changes introduced in this branch ↗︎

@pattisdr pattisdr marked this pull request as ready for review September 5, 2024 14:35
…onfig secrets, and keep privacy notice response configured_regions and systems_applicable to using the aliases -
@pattisdr
Copy link
Contributor Author

pattisdr commented Sep 5, 2024

@galvana I regenerated types as a last step and broke something here -- trying to see what went wrong

…cessarily supply on PrivacyNoticeResponseWithRegions to improve performance.
Copy link
Contributor

@galvana galvana left a comment

Choose a reason for hiding this comment

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

Thanks for updating the front-end types 🙏

.group_by(PrivacyExperience.region)
.order_by(PrivacyExperience.region.asc())

# Raw sql for performance
Copy link
Contributor

Choose a reason for hiding this comment

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

@pattisdr pattisdr merged commit 8350397 into main Sep 7, 2024
43 checks passed
@pattisdr pattisdr deleted the PROD-2708_privacy_notice_performance_improvements branch September 7, 2024 12:08
Copy link

cypress bot commented Sep 7, 2024

fides    Run #9844

Run Properties:  status check passed Passed #9844  •  git commit 8350397d80: Rename Privacy Notice Properties (#5259)
Project fides
Branch Review main
Run status status check passed Passed #9844
Run duration 00m 38s
Commit git commit 8350397d80: Rename Privacy Notice Properties (#5259)
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
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