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

Switch TCF config to env var #4220

Merged
merged 9 commits into from
Oct 4, 2023

Conversation

TheAndrewJackson
Copy link
Contributor

@TheAndrewJackson TheAndrewJackson commented Oct 3, 2023

Closes #3788

Description Of Changes

This PR rips out the consent_settings table and endpoints in favor of using a simpler env var.

Code Changes

  • Remove consent settings model, schema, endpoints, and other consent settings related code
  • Refactor privacy preferences and experiences endpoints and tests to use the config var
  • Add new enable_tcf fixture

Steps to Confirm

  • privacy experience and privacy preferences tests pass

Pre-Merge Checklist

@TheAndrewJackson TheAndrewJackson self-assigned this Oct 3, 2023
@cypress
Copy link

cypress bot commented Oct 3, 2023

Passing run #4466 ↗︎

0 4 0 0 Flakiness 0

Details:

Merge d99ddb0 into 03d26a4...
Project: fides Commit: 57cc5c629d ℹ️
Status: Passed Duration: 00:57 💡
Started: Oct 4, 2023 3:25 PM Ended: Oct 4, 2023 3:26 PM

Review all test suite changes for PR #4220 ↗︎

@codecov
Copy link

codecov bot commented Oct 3, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (7932483) 87.67% compared to head (6c84b23) 87.65%.
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4220      +/-   ##
==========================================
- Coverage   87.67%   87.65%   -0.02%     
==========================================
  Files         333      331       -2     
  Lines       20743    20695      -48     
  Branches     2690     2689       -1     
==========================================
- Hits        18187    18141      -46     
+ Misses       2093     2091       -2     
  Partials      463      463              
Files Coverage Δ
src/fides/api/api/v1/api.py 100.00% <ø> (ø)
...i/api/v1/endpoints/privacy_experience_endpoints.py 93.63% <100.00%> (-0.12%) ⬇️
...i/api/v1/endpoints/privacy_preference_endpoints.py 98.02% <100.00%> (-0.03%) ⬇️
src/fides/api/app_setup.py 68.11% <ø> (-0.81%) ⬇️
src/fides/api/db/base.py 100.00% <ø> (ø)
src/fides/config/__init__.py 96.22% <100.00%> (+0.07%) ⬆️
src/fides/config/consent_settings.py 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@TheAndrewJackson TheAndrewJackson marked this pull request as ready for review October 4, 2023 13:16
@TheAndrewJackson
Copy link
Contributor Author

@pattisdr This is currently merging into a larger TCF feature branch. It might be easier to merge this straight into main since there is a migration. If it's low risk to merge it into main I think it'll be worth it.

Also, it looks like this PR is failing the performance CI check. Do I need to worry about that for this change?

@pattisdr
Copy link
Contributor

pattisdr commented Oct 4, 2023

@TheAndrewJackson to answer your first question, yes I think this should definitely go into main due to the migration as you point out, can you repoint this branch?

@TheAndrewJackson TheAndrewJackson changed the base branch from ajackson/enable-tcf/PROD-1069 to main October 4, 2023 14:20
@TheAndrewJackson
Copy link
Contributor Author

@pattisdr repointed to main 👍

@pattisdr
Copy link
Contributor

pattisdr commented Oct 4, 2023

reviewing now thank you 💯

Copy link
Contributor

@pattisdr pattisdr left a comment

Choose a reason for hiding this comment

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

Nice changes here @TheAndrewJackson I just want to make sure this works for local development -

@@ -28,6 +28,7 @@ services:
FIDES__DEV_MODE: "True"
FIDES__LOGGING__COLORIZE: "True"
FIDES__USER__ANALYTICS_OPT_OUT: "True"
FIDES__CONSENT__TCF_ENABLED: "False"
Copy link
Contributor

@pattisdr pattisdr Oct 4, 2023

Choose a reason for hiding this comment

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

It seems like hardcoding this to false is preventing setting tcf_enabled=true in the fides.toml file for local development from taking effect? Can you look at this and verify you can run fides locally with tcf enabled=true set from the fides.toml file? Maybe we can remove this line altogether

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch. I'll look into that now

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That was causing the issue you described. I removed it from the docker compose file: d99ddb0

I tried updating it to be FIDES__CONSENT__TCF_ENABLED: ${FIDES__CONSENT__TCF_ENABLED-} but that caused validation issues on startup because it would pass in null instead of a boolean value.

@pattisdr
Copy link
Contributor

pattisdr commented Oct 4, 2023

Also, it looks like this PR is failing the performance CI check. Do I need to worry about that for this change?

I can't imagine that this change matters much for performance

Copy link
Contributor

@pattisdr pattisdr left a comment

Choose a reason for hiding this comment

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

Thank you looks good to me!

@TheAndrewJackson TheAndrewJackson merged commit 197355f into main Oct 4, 2023
38 checks passed
@TheAndrewJackson TheAndrewJackson deleted the ajackson/switch-tcf-config-to-env-var branch October 4, 2023 15:53
@allisonking
Copy link
Contributor

oooh very excited for this! @TheAndrewJackson can you do me a favor and update this doc with the deetz of the new env var and remove the section about going through /docs to consent-settings, etc?

@TheAndrewJackson
Copy link
Contributor Author

@allisonking yes! I'll do that now

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.

Add ability to turn TCF on/off
3 participants