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

Removing the connector template properties #4128

Merged
merged 7 commits into from
Sep 27, 2023

Conversation

galvana
Copy link
Contributor

@galvana galvana commented Sep 21, 2023

Closes #4123

Description Of Changes

Removing the authorization_required and user_guide properties from ConnectorTemplate. Calculating these values on the fly required the parsing of the SaaS config YAML and caused other threads to block.

Code Changes

  • Refactored the ConnectorTemplate model

Steps to Confirm

  • Pull up the Salesforce Classic connector in the System Integration tab, this connector has authorization_required and user_guide, The page should show an Authorize integration button and have a link to external documentation.

Pre-Merge Checklist

@cypress
Copy link

cypress bot commented Sep 21, 2023

Passing run #4327 ↗︎

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 4f3005f into 85dc387...
Project: fides Commit: be3d576c21 ℹ️
Status: Passed Duration: 00:53 💡
Started: Sep 25, 2023 6:20 PM Ended: Sep 25, 2023 6:21 PM

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings.

config = SaaSConfig(**load_config_from_string(template.config))
authentication = config.client_config.authentication
authorization_required = (
authentication.strategy
Copy link
Contributor

@ThomasLaPiana ThomasLaPiana Sep 21, 2023

Choose a reason for hiding this comment

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

This was a bit hard for me to read because it's doing a nested comparison instead of using and, I think something like this might be a bit more readable:

In [1]: foo = None

In [2]: bar = True if foo and foo.test else False

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 call!

@@ -71,6 +74,14 @@ def _load_connector_templates(self) -> None:
config_dict = load_config(config_file)
connector_type = config_dict["type"]
human_readable = config_dict["name"]
user_guide = config_dict.get("user_guide")
authentication = config_dict["client_config"].get("authentication")
authorization_required = (
Copy link
Contributor

@ThomasLaPiana ThomasLaPiana Sep 21, 2023

Choose a reason for hiding this comment

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

same note as below

@galvana galvana marked this pull request as ready for review September 22, 2023 19:50
@codecov
Copy link

codecov bot commented Sep 25, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (85dc387) 87.50% compared to head (4f3005f) 87.51%.
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4128      +/-   ##
==========================================
+ Coverage   87.50%   87.51%   +0.01%     
==========================================
  Files         326      326              
  Lines       20324    20323       -1     
  Branches     2640     2640              
==========================================
+ Hits        17784    17786       +2     
+ Misses       2081     2078       -3     
  Partials      459      459              
Files Coverage Δ
src/fides/api/schemas/saas/connector_template.py 83.33% <100.00%> (-4.17%) ⬇️
...vice/connectors/saas/connector_registry_service.py 94.11% <100.00%> (+1.47%) ⬆️

... and 1 file with indirect coverage changes

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

Copy link
Contributor

@ThomasLaPiana ThomasLaPiana left a comment

Choose a reason for hiding this comment

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

LGTM, not sure if external/unsafe checks need to be run though

@galvana galvana merged commit d8b9af1 into main Sep 27, 2023
12 checks passed
@galvana galvana deleted the 4123-fix-connection-model-slowness branch September 27, 2023 22:34
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.

GET /connection endpoint seems slow to respond with many connections present
2 participants