-
Notifications
You must be signed in to change notification settings - Fork 77
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
Update fides deploy
to use a new database.load_samples
setting to initialize sample Systems, Datasets, and Connections for testing
#3102
Conversation
Passing run #1498 ↗︎
Details:
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. |
Hmm, the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Notes for reviewers!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this @NevilleS good code comments and great tests to protect your code. It's a little duplicative in places but you've motivated it well. Thanks for the self-review.
oof - I think I know why some of the tests are failing. It looks like it's probably specific to the I think I'll need to figure out how to use "futures" or use the sigh |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #3102 +/- ##
==========================================
- Coverage 87.56% 87.52% -0.04%
==========================================
Files 308 309 +1
Lines 17742 17839 +97
Branches 2288 2310 +22
==========================================
+ Hits 15535 15613 +78
- Misses 1792 1802 +10
- Partials 415 424 +9
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
OK, I fixed the problem that was causing failures in Python 3.8 (thanks, CI!) and finished tidying things up. At this point, it's ready to merge, but it has a major caveat- it removes the ability to automatically configure the S3 & Email features. I don't want to break that for testers, so I need to just go back and rethink this. |
Looking.. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great @NevilleS 🏆
...many of these didn't work or used deprecated APIs, sorry!
Added one more tweak to check the installed Python version is one we support, but otherwise this is good to go. I'm going to wait to merge this until I get some more folks to test it out though, especially in it's |
Code Changes
cookie_house
sample app toclients/cookie_house
instead of buried in thesample_project/
dirnox -s cypress_tests
FIDES__DATABASE__LOAD_SAMPLES
config setting to automatically load sample data on startupload_sample_resources_from_project
that parses the resource YMLs (systems, datasets, etc), instead of relying onfides push
load_sample_resources_from_project
that parses a (new) connections YML to configure various database & SaaS connectors , instead of relying onload_examples.py
seed_example_data
step fromfides deploy
, and use the "load samples" config setting instead 👍Steps to Confirm
nox - s "fides_env(test)"
and confirm that sample systems, datasets, and Postgres & Mongo connectors work.env
to include Mailchimp, Stripe, or Hubspot secrets and confirm those connectors are creatednox -s e2e_test
to confirm the Cypress smoke tests still work as expectedsample_project/sample_connectors.yml
to add/remove connectors and confirm they're included in the test envPre-Merge Checklist
CHANGELOG.md
Description Of Changes
While continuing to overhaul the reusability of our test environment, I've found that it's generally unreliable to use Docker commands to run scripts to populate sample resources, connections, etc. It's a slightly long story, but overall the
seed_example_data
function in thefides deploy
command is tightly coupled to thefides
image having all the source code files available, and that's not reliable when we try to reuse this setup with different images (e.g.fidesplus
, or customfides
images, etc.)This is a fairly large refactor of the "sample data" part of the
fides deploy
script that removes the need to run scripts to make API requests against the server to setup sample data, and instead adds a new config setting,FIDES__DATABASE__LOAD_SAMPLES
which will automatically load sample data into the database at startup time. In doing this, I also converted the "sample connectors" part of theload_examples.py
script into asample_connections.yml
file that defines the connectors that should be supported by thefides deploy
command. This makes it very easy to add/remove connectors by editing that YML file and providing the necessary secrets as ENV vars.The messiest part here is the
seed.py
logic that imports & reuses existing API endpoints, but calls them directly instead of as part of HTTP request handling...