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

feat(db-engine-specs): add support for Postgres root cert #11720

Merged
merged 4 commits into from
Jan 13, 2021

Conversation

villebro
Copy link
Member

@villebro villebro commented Nov 16, 2020

SUMMARY

Add support for SSL root cert verification to Postgres. Also add proper error message for incorrect test request if e.g. extra is not parseable (see screenshot below).

BEFORE

With the following unparseable database extra object, the following toast is raised (does not actually show on some versions of Chrome):
image
image

AFTER

The new error toast shows the marshmallow error:
image

When also specifying an incorrect connection string, the following error is displayed (both errors are displayed):
image

TEST PLAN

CI + new tests. Also added missing tests to Druid connector.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Changes UI
  • Requires DB Migration.
  • Confirm DB Migration upgrade and downgrade tested.
  • Introduces new feature or API
  • Removes existing feature or API

@@ -148,7 +148,6 @@ def test_create_database(self):
database_data = {
"database_name": "test-create-database",
"sqlalchemy_uri": example_db.sqlalchemy_uri_decrypted,
"server_cert": ssl_certificate,
Copy link
Member Author

Choose a reason for hiding this comment

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

Enabling the ssl_certificate fixture raises an error when trying to access the example database on Postgres (as it should), therefore this needs to be removed.

@codecov-io
Copy link

codecov-io commented Nov 17, 2020

Codecov Report

Merging #11720 (69e38c3) into master (0f731f2) will increase coverage by 4.70%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #11720      +/-   ##
==========================================
+ Coverage   65.97%   70.67%   +4.70%     
==========================================
  Files        1015      529     -486     
  Lines       49548    19779   -29769     
  Branches     5080     5129      +49     
==========================================
- Hits        32687    13978   -18709     
+ Misses      16714     5671   -11043     
+ Partials      147      130      -17     
Flag Coverage Δ
cypress 50.99% <0.00%> (+5.43%) ⬆️
javascript 60.75% <0.00%> (-0.01%) ⬇️
python ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...end/src/views/CRUD/data/database/DatabaseModal.tsx 71.69% <0.00%> (+15.36%) ⬆️
...nd/src/explore/components/ExploreViewContainer.jsx 54.97% <0.00%> (-21.46%) ⬇️
...ntend/src/explore/components/ExploreChartPanel.jsx 56.84% <0.00%> (-17.36%) ⬇️
...rontend/src/explore/components/DatasourcePanel.tsx 83.92% <0.00%> (-6.55%) ⬇️
.../src/components/dataViewCommon/TableCollection.tsx 100.00% <0.00%> (ø)
superset/databases/filters.py
...erset/migrations/versions/ab8c66efdd01_resample.py
superset/db_engine_specs/kylin.py
.../migrations/versions/1a1d627ebd8e_position_json.py
...tions/versions/27ae655e4247_make_creator_owners.py
... and 536 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0f731f2...69e38c3. Read the comment docs.

Copy link
Member

@dpgaspar dpgaspar left a comment

Choose a reason for hiding this comment

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

LGTM, minor comment

superset/db_engine_specs/postgres.py Outdated Show resolved Hide resolved
@villebro villebro merged commit 40a334a into apache:master Jan 13, 2021
@villebro villebro deleted the villebro/postgres-ssl branch January 13, 2021 11:39
amitmiran137 pushed a commit to nielsen-oss/superset that referenced this pull request Jan 14, 2021
* feat(db-engine-specs): add support for Postgres root cert

* remove logging of json decode exception message

* fix error message

* fix error message
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.2.0 labels Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/L 🚢 1.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants