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

HJ-5 - Added new RDS Postgres Connector #5380

Merged
merged 24 commits into from
Oct 21, 2024
Merged

Conversation

andres-torres-marroquin
Copy link
Contributor

Closes #HJ-5

Description Of Changes

Added new RDS Postgres Connector, which allows D&D feature to be implemented.

Code Changes

  • Added BaseRDSSchema, RDSMySQLSchema now inherits from it.
  • Added RDSPostgresSchema.
  • Added RDSPostgresConnector.
  • Added tests/fixtures/rds_postgres_fixtures.py

Steps to Confirm

  • Create a Connection with RDS Postgres Credentials.
  • Click on Test connection.

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 Oct 15, 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 Oct 21, 2024 2:03pm

CHANGELOG.md Outdated Show resolved Hide resolved
Copy link

cypress bot commented Oct 15, 2024

fides    Run #10521

Run Properties:  status check passed Passed #10521  •  git commit 9c954d8d3d ℹ️: Merge 8e327f413e4d73564c5089c44215543c7c99c09a into ef1b7895f66fa2a82bb65f15e067...
Project fides
Run status status check passed Passed #10521
Run duration 00m 38s
Commit git commit 9c954d8d3d ℹ️: Merge 8e327f413e4d73564c5089c44215543c7c99c09a into ef1b7895f66fa2a82bb65f15e067...
Committer Andres Torres
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
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.

Copy link

codecov bot commented Oct 15, 2024

Codecov Report

Attention: Patch coverage is 59.78261% with 37 lines in your changes missing coverage. Please review.

Project coverage is 85.48%. Comparing base (7591e3f) to head (7c981a6).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...s/api/service/connectors/rds_postgres_connector.py 51.47% 33 Missing ⚠️
...ides/api/service/connectors/rds_connector_mixin.py 66.66% 2 Missing ⚠️
...ides/api/service/connectors/rds_mysql_connector.py 33.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5380      +/-   ##
==========================================
- Coverage   85.57%   85.48%   -0.10%     
==========================================
  Files         379      382       +3     
  Lines       23985    24067      +82     
  Branches     2623     2624       +1     
==========================================
+ Hits        20526    20573      +47     
- Misses       2907     2942      +35     
  Partials      552      552              

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

@andres-torres-marroquin andres-torres-marroquin added the run unsafe ci checks Runs fides-related CI checks that require sensitive credentials label Oct 16, 2024
@andres-torres-marroquin andres-torres-marroquin marked this pull request as ready for review October 16, 2024 17:00
CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Contributor

@erosselli erosselli left a comment

Choose a reason for hiding this comment

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

nice work! I left some questions, mainly for my own understanding I think.

input_data: Dict[str, List[Any]],
) -> List[Row]:
"""DSR execution not yet supported for RDS Postgres"""
return []
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should probably raise a NotImplemented error here right? we don't w ant our code calling these methods and making it seem like it's actually doing things? or am I missing something?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think that could be a possibility, Adam did the same as I did here on the S3Connector, should we continue the pattern?

Copy link
Contributor

Choose a reason for hiding this comment

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

honestly I'm not too sure if raising NotImplemented will make it so that DSRs fail when the connector is configured -- let's keep existing behavior for now and maybe discuss this more thoroughly another time

Comment on lines +1450 to +1454
rds_postgres_connection_config.secrets["aws_secret_access_key"] = "bad_key"
rds_postgres_connection_config.save(db)
connector = get_connector(rds_postgres_connection_config)
with pytest.raises(ConnectionException):
connector.test_connection()
Copy link
Contributor

Choose a reason for hiding this comment

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

a bit of a nitpick, but maybe we can move this to a separate test ? e.g test_connection_with_bad_key or something, I find it a bit easier to read / maintain when each test only tests for one thing

Copy link
Contributor

@erosselli erosselli left a comment

Choose a reason for hiding this comment

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

Approving! I just left a small suggestion

connector = get_connector(rds_postgres_connection_config)
assert connector.test_connection() == ConnectionTestStatus.succeeded

def test_test_wrong_connection(
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
def test_test_wrong_connection(
def test_wrong_connection_secrets(

@andres-torres-marroquin andres-torres-marroquin merged commit 7247873 into main Oct 21, 2024
40 of 46 checks passed
@andres-torres-marroquin andres-torres-marroquin deleted the andres/HJ-5 branch October 21, 2024 14:58
Copy link

cypress bot commented Oct 21, 2024

fides    Run #10522

Run Properties:  status check passed Passed #10522  •  git commit 7247873f8b: HJ-5 - Added new RDS Postgres Connector (#5380)
Project fides
Run status status check passed Passed #10522
Run duration 00m 38s
Commit git commit 7247873f8b: HJ-5 - Added new RDS Postgres Connector (#5380)
Committer Andres Torres
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
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
run unsafe ci checks Runs fides-related CI checks that require sensitive credentials
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants