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

[Backend] Privacy Experiences Tables and GET List #3146

Merged
merged 6 commits into from
Apr 26, 2023

Conversation

pattisdr
Copy link
Contributor

@pattisdr pattisdr commented Apr 24, 2023

Closes #3019
❗ Contains migration

Code Changes

  • Add three new tables, PrivacyExperience, PrivacyExperienceTemplate, and PrivacyExperienceHistory
  • Add an endpoint to GET privacy experiences with relevant notices attached
  • Add model methods for creating and updating privacy experiences (which likewise version these experiences) but don't surface endpoints yet.

Steps to Confirm

  • This is really a behind-the-scenes change, I'm not yet exposing ways to create experiences in the first place. I think making sure the migration works as expected, the columns are reasonable is a good step here.

Pre-Merge Checklist

Description Of Changes

Add the backend starting foundation experiences, tables, create/update methods and an initial GET list endpoint.

… and PrivacyExperienceHistories.

- Same as privacy notices, when we create an Experience, preserve the history in the history table.
- When we update privacy experiences, bump the version, and similarly save off the historical record.
- Add an API endpoint to get privacy experiences with associated notices and various filters.
@cypress
Copy link

cypress bot commented Apr 24, 2023

Passing run #1606 ↗︎

0 3 0 0 Flakiness 0
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.

Details:

Merge 871bfff into f3f7a2a...
Project: fides Commit: a779f79707 ℹ️
Status: Passed Duration: 00:45 💡
Started: Apr 26, 2023 7:17 PM Ended: Apr 26, 2023 7:18 PM

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings.

@pattisdr pattisdr changed the title [WIP][Privacy Experiences Backend] [WIP][Backend] Privacy Experiences Tables and GET List Apr 25, 2023
@pattisdr pattisdr changed the title [WIP][Backend] Privacy Experiences Tables and GET List [Backend] Privacy Experiences Tables and GET List Apr 25, 2023
@pattisdr pattisdr marked this pull request as ready for review April 25, 2023 21:27
@codecov
Copy link

codecov bot commented Apr 25, 2023

Codecov Report

Patch coverage: 99.36% and project coverage change: +0.10 🎉

Comparison is base (c350a5e) 87.51% compared to head (871bfff) 87.62%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3146      +/-   ##
==========================================
+ Coverage   87.51%   87.62%   +0.10%     
==========================================
  Files         309      313       +4     
  Lines       18010    18178     +168     
  Branches     2341     2347       +6     
==========================================
+ Hits        15762    15929     +167     
  Misses       1822     1822              
- Partials      426      427       +1     
Impacted Files Coverage Δ
src/fides/lib/oauth/roles.py 100.00% <ø> (ø)
src/fides/api/ops/models/privacy_experience.py 98.59% <98.59%> (ø)
src/fides/api/ctl/sql_models.py 98.30% <100.00%> (+<0.01%) ⬆️
src/fides/api/ops/api/v1/api.py 100.00% <100.00%> (ø)
...s/api/v1/endpoints/privacy_experience_endpoints.py 100.00% <100.00%> (ø)
src/fides/api/ops/api/v1/scope_registry.py 100.00% <100.00%> (ø)
src/fides/api/ops/api/v1/urn_registry.py 100.00% <100.00%> (ø)
src/fides/api/ops/db/base.py 100.00% <100.00%> (ø)
src/fides/api/ops/models/policy.py 87.27% <100.00%> (ø)
src/fides/api/ops/schemas/privacy_experience.py 100.00% <100.00%> (ø)

... and 4 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@pattisdr
Copy link
Contributor Author

@allisonking when you get a chance could you review this privacy experiences foundation? It's getting large so I'm trying to just add the tables and GET List endpoint here. I'll add the create/update/detail endpoints/update postman collection in the follow up. The main thing to review are if the fields are sufficient to capture what is needed for experiences.

The logic itself is almost identical to the work we already did for privacy notices.

Copy link
Contributor

@allisonking allisonking left a comment

Choose a reason for hiding this comment

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

this is looking good @pattisdr ! left some comments as I'm trying to form a clearer picture in my head, but they might just be me not fully understanding things yet 😄

Copy link
Contributor

@allisonking allisonking left a comment

Choose a reason for hiding this comment

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

💥

@pattisdr
Copy link
Contributor Author

Thank you for reviewing and your helpful comments @allisonking I'll start next on trying to get endpoints for these to create/update so this is more easily tested!

@pattisdr pattisdr merged commit ff18619 into main Apr 26, 2023
@pattisdr pattisdr deleted the fides_3019_privacy_experiences_backend branch April 26, 2023 19:57
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.

Backend Tables and API Endpoints for Privacy Experiences
2 participants