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-24 Add DataHub integration config #5401

Merged
merged 11 commits into from
Oct 24, 2024
Merged

HJ-24 Add DataHub integration config #5401

merged 11 commits into from
Oct 24, 2024

Conversation

erosselli
Copy link
Contributor

@erosselli erosselli commented Oct 22, 2024

Closes HJ-24

Description Of Changes

Adds support for a DataHub integregation.

Code Changes

  • Add new DatahubSchema class that includes all necessary arguments for a Datahub integration
  • Migration for new ConnectionType.datahub
  • Migration to add a last_ran_at nullable column to the ConnectionConfig model
  • Add new DatahubConnector class. For now only implements test_connection method.
  • Update tests

Steps to Confirm

  • Activate your fides virtual environment (source your/venv/path/bin/activate) or create one if you haven't done so already and then activate it.
  • Run pip install -r requirements.txt (with the venv activated)
  • Run DATAHUB_MAPPED_GMS_PORT=8082 datahub docker quickstart (the DATAHUB_MAPPED_GMS_PORT variable is so that datahub doesn't try to run on port 8080, which is already in used by fides)
  • In a different shell, start fides as usual
  • Open the Admin UI, and create a system, or select one that already exists
  • Under the integrations tab for the system, select the Datahub integration
    • In the Datahub server URL field, put http://host.docker.internal:8082
    • The token is ignored for now so just put test
    • Frequency is also ignored for now so you can just leave the default (daily)
  • Click "Save"
  • Click "Test integration" => test should succeed

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 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
fides-plus-nightly ⬜️ Ignored (Inspect) Visit Preview Oct 24, 2024 3:04pm

Copy link

cypress bot commented Oct 22, 2024

fides    Run #10609

Run Properties:  status check passed Passed #10609  •  git commit b01186172f ℹ️: Merge 055286264e5ddb8fc775ed8452e1eedfe20d1b87 into 29c9c46221d53484dfd3819e64db...
Project fides
Branch Review refs/pull/5401/merge
Run status status check passed Passed #10609
Run duration 00m 39s
Commit git commit b01186172f ℹ️: Merge 055286264e5ddb8fc775ed8452e1eedfe20d1b87 into 29c9c46221d53484dfd3819e64db...
Committer erosselli
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.
View all changes introduced in this branch ↗︎

@erosselli erosselli changed the title Add DataHub integration HJ-24 Add DataHub integration Oct 22, 2024
Copy link

codecov bot commented Oct 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.89%. Comparing base (661347a) to head (0552862).
Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5401      +/-   ##
==========================================
+ Coverage   83.86%   83.89%   +0.03%     
==========================================
  Files         382      384       +2     
  Lines       24073    24112      +39     
  Branches     2624     2624              
==========================================
+ Hits        20188    20228      +40     
+ Misses       3303     3302       -1     
  Partials      582      582              

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

@erosselli erosselli force-pushed the HJ-24 branch 2 times, most recently from 9fe7d7c to 87b8c83 Compare October 23, 2024 15:02
@erosselli erosselli changed the title HJ-24 Add DataHub integration HJ-24 Add DataHub integration config Oct 23, 2024
@erosselli erosselli marked this pull request as ready for review October 23, 2024 15:03
Copy link
Contributor Author

@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.

Note to self: add changelog entry after release branch is cut

Comment on lines +18 to +21
# TODO: use token for authentication
self.datahub_client = DataHubGraph(
DataHubGraphConfig(server=str(self.config.datahub_server_url))
)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

right now the datahub we're running doesn't require any token, I'll address this in a separate ticket

Copy link
Contributor

@thingscouldbeworse thingscouldbeworse left a comment

Choose a reason for hiding this comment

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

nice tests, one question and one naming nit


def upgrade():
# Add 'datahub' to ConnectionType enum
op.execute("ALTER TYPE connectiontype RENAME TO connectiontype_old")
Copy link
Contributor

@thingscouldbeworse thingscouldbeworse Oct 24, 2024

Choose a reason for hiding this comment

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

Did you get any answer from other people about why we do the connectiontype_old instead of altering the existing one? Or just better to keep with how it was done before?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

tbh I never asked 🙈 I've just seen it done this way always. I'll ask around in the eng channel

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 "it's just been done this way before" is a 100% valid argument for doing it in the PR that way, for all we know it's catastrophic with the way we do Alembic and we realized in the past or something. But we should also just get an answer if anyone knows whether that's the case or not. I think good to merge as is and ask.

# ### commands auto generated by Alembic - please adjust! ###
op.add_column(
"connectionconfig",
sa.Column("last_ran_at", sa.DateTime(timezone=True), nullable=True),
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry to be annoying, how do we feel about last_run_time? Non blocking.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure. I'll change it to last_run_timestamp so it's consistent with last_test_timestamp

@erosselli erosselli merged commit 4bec008 into main Oct 24, 2024
47 of 48 checks passed
@erosselli erosselli deleted the HJ-24 branch October 24, 2024 17:14
Copy link

cypress bot commented Oct 24, 2024

fides    Run #10620

Run Properties:  status check passed Passed #10620  •  git commit 4bec008315: HJ-24 Add DataHub integration config (#5401)
Project fides
Branch Review main
Run status status check passed Passed #10620
Run duration 00m 36s
Commit git commit 4bec008315: HJ-24 Add DataHub integration config (#5401)
Committer erosselli
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.
View all changes introduced in this branch ↗︎

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