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

ScyllaDB Connector #4946

Merged
merged 17 commits into from
Jun 13, 2024
Merged

ScyllaDB Connector #4946

merged 17 commits into from
Jun 13, 2024

Conversation

pattisdr
Copy link
Contributor

@pattisdr pattisdr commented Jun 3, 2024

Closes #PROD-2148

❗ Contains connection type migration. Bump downrev before merge.
πŸ‘‰ Supports https://github.com/ethyca/fidesplus/pull/1447

Description Of Changes

Adds the infrastructure to run a local scylla db instance in Docker, and a simple integration to connect to it. Access and erasure requests are not yet supported for scylla. This first step is just supporting scylla detection and discovery in Fidesplus.

Code Changes

  • Installs scylla-driver
  • Adds a new scylla ConnectionType
  • Adds support for bringing up a test scylla db in Docker: Adds a new docker-compose integration file for scylla db which uses the bitnami image, which allows you to put initialization scripts in the docker entrypoint directory, which doesn't seem to be supported in the regular cassandra/scylla db images.
  • Adds sample cql file to populate database with fake data - creates two keyspaces, a couple of tables, and populates
  • Adds the start of a Scylla Connector. Retrieve data and mask data are not currently supported, just testing a connection.

Steps to Confirm

  • Run nox -s dev -- shell scylladb
  • In fides/clients, turbo run dev
  • Go to System > Add system, add name: Scylla, click save
  • Click on integration tab, search for scylla:
    Screenshot 2024-06-11 at 12 03 00β€―PM
  • Add creds (these are not secret, these are test credentials to the scylla instance you're running in your own docker container locally) - scylla_user,scylla_pass
  • Click test connection, verify this is green
    Screenshot 2024-06-11 at 12 04 16β€―PM

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 Jun 3, 2024

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
fides-plus-nightly ⬜️ Ignored (Inspect) Visit Preview Jun 13, 2024 4:12pm

@pattisdr pattisdr changed the title ScyllaDB Connector Draft ScyllaDB Integration Draft Jun 3, 2024
Copy link

cypress bot commented Jun 3, 2024

Passing run #8300 β†—οΈŽ

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

Details:

Merge d35eed5 into 4fde412...
Project: fides Commit: 301034403e ℹ️
Status: Passed Duration: 00:34 πŸ’‘
Started: Jun 13, 2024 4:24 PM Ended: Jun 13, 2024 4:24 PM

Review all test suite changes for PR #4946 β†—οΈŽ

- Still using default username/password.
- Update replication_factor to 3 instead of 1 for example keyspaces
- Increase number of vendor records in example data
- Bump downrev
- Make keyspace optional for Integration
- Throw some more specific errors when testing the scylla connection around keyspace issues and password issues.
…s in the docker entrypoint directory.

- Write tests for scylla connector > test connection
@pattisdr pattisdr marked this pull request as ready for review June 11, 2024 17:05
@pattisdr pattisdr changed the title ScyllaDB Integration Draft ScyllaDB Integration Starter Jun 11, 2024
@pattisdr pattisdr changed the title ScyllaDB Integration Starter ScyllaDB Connector Jun 12, 2024
Copy link

codecov bot commented Jun 12, 2024

Codecov Report

Attention: Patch coverage is 87.50000% with 8 lines in your changes missing coverage. Please review.

Project coverage is 86.59%. Comparing base (0f4ea85) to head (d35eed5).
Report is 1 commits behind head on main.

Files Patch % Lines
...c/fides/api/service/connectors/scylla_connector.py 83.33% 7 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4946      +/-   ##
==========================================
- Coverage   86.82%   86.59%   -0.24%     
==========================================
  Files         346      348       +2     
  Lines       21481    21611     +130     
  Branches     2843     2867      +24     
==========================================
+ Hits        18650    18713      +63     
- Misses       2328     2394      +66     
- Partials      503      504       +1     

β˜” View full report in Codecov by Sentry.
πŸ“’ Have feedback on the report? Share it here.

Copy link
Contributor

@adamsachs adamsachs left a comment

Choose a reason for hiding this comment

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

@pattisdr this side all looks solid to me! very thorough, nice job with everything.

as you said, let's just keep an eye on merge conflicts since we've got similar codepaths being updated from a few spots - thanks for calling that out πŸ‘

noxfiles/run_infrastructure.py Show resolved Hide resolved
request_task: RequestTask,
input_data: Dict[str, List[Any]],
) -> List[Row]:
"""Retrieve scylla data - not yet implemented"""
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: worth raising a NotImplementedError here? that always feels like the most proper thing, just to make it transparent to anyone who somehow hits the codepath at runtime without reading the codebase, but maybe i'm overthinking it :)

Copy link
Contributor

Choose a reason for hiding this comment

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

now i'm wondering whether raising the error may unexpectedly impact other DSR workflows and i shouldn't be doing that... πŸ€”

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If there are datasets for the connection config this could get picked up in a DSR I believe!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yep confirmed a NotImplementedError will break DSR's if a dataset is also attached to the ConnectionConfig .

@pattisdr pattisdr merged commit 958ff68 into main Jun 13, 2024
47 of 48 checks passed
@pattisdr pattisdr deleted the PROD-2106_scylladb branch June 13, 2024 17:13
Copy link

cypress bot commented Jun 13, 2024

Passing run #8304 β†—οΈŽ

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

Details:

ScyllaDB Connector (#4946)
Project: fides Commit: 958ff68ec0
Status: Passed Duration: 00:35 πŸ’‘
Started: Jun 13, 2024 5:24 PM Ended: Jun 13, 2024 5:25 PM

Review all test suite changes for PR #4946 β†—οΈŽ

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