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

fix: SSH Tunnel configuration settings #27186

Merged
merged 37 commits into from
Mar 11, 2024

Conversation

geido
Copy link
Member

@geido geido commented Feb 21, 2024

SUMMARY

This PR fixes several issues with the SSH Tunnel option in the Database Modal which are related to edit the SSH Tunnel config, enable/disable the option, and misc fixes/enhancements. In particular:

  • Removes a duplicate SSHTunnelSwitch component from dynamic forms and merges the logics of both dynamic and SQLAlchemy forms into one overridable component
  • Fixes an issue that made removing the SSH tunnel config impossible when editing a database connection
  • Delegates the deletion of a ssh tunnel to the UpdateDatabaseCommand
  • Fixes an issue with the SSH tunnel config still being included in the request even when toggled off
  • Fixes an issue for which the switch was showing also with SSH_TUNNELING OFF. Saving would cause a "SSH Tunneling is not enabled" error
  • Surfaces to the user a missing port error in the SQLAlchemy uri when enabling SSH Tunnel (the port is required for the tunnel to work)
  • Clean the SSH Tunnel config from unnecessary credentials when switching from password to private key
  • Improves the UX so that toggling ON and OFF the SSH Tunnel config won't clear the form until saved
  • Misc fixes

BEFORE

DEV.Superset.mp4

AFTER

DEV.Superset.1.mp4

TESTING INSTRUCTIONS

  1. Create a new database connection using a SQLAlchemy uri and dynamic forms, make sure SSH Tunnel can be toggled ON and OFF and that configs can be saved successfully
  2. Edit a database connection that has a SSH Tunnel config, make sure the SSH Tunnel can be toggled ON and OFF and that it keeps the config available to the user until toggled OFF and saved
  3. Edit a database connection that has a SSH Tunnel config, make sure any change to the SSH tunnel can be saved successfully
  4. Re-open the database config and make sure the SSH Tunnel has been deleted successfully
  5. Create or edit a database connection using a SQLAlchemy uri without specifying the port, make sure an error is surfaced to the UI informing that specifying a port is necessary

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

Copy link

codecov bot commented Feb 21, 2024

Codecov Report

Attention: Patch coverage is 82.11382% with 22 lines in your changes are missing coverage. Please review.

Project coverage is 69.73%. Comparing base (fde93dc) to head (ec8c5f4).

Files Patch % Lines
...end/src/features/databases/DatabaseModal/index.tsx 61.90% 6 Missing and 2 partials ⚠️
superset/commands/database/update.py 74.07% 7 Missing ⚠️
superset/commands/database/test_connection.py 80.00% 4 Missing ⚠️
superset/commands/database/ssh_tunnel/update.py 85.71% 2 Missing ⚠️
...ses/DatabaseModal/DatabaseConnectionForm/index.tsx 88.88% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #27186      +/-   ##
==========================================
+ Coverage   67.34%   69.73%   +2.38%     
==========================================
  Files        1909     1909              
  Lines       74623    74670      +47     
  Branches     8324     8324              
==========================================
+ Hits        50255    52069    +1814     
+ Misses      22314    20550    -1764     
+ Partials     2054     2051       -3     
Flag Coverage Δ
hive 53.73% <20.77%> (?)
javascript 57.21% <80.43%> (+0.01%) ⬆️
mysql 78.02% <81.81%> (+0.02%) ⬆️
postgres 78.12% <81.81%> (+0.02%) ⬆️
presto 53.68% <20.77%> (?)
python 83.15% <83.11%> (+4.92%) ⬆️
sqlite 77.57% <41.55%> (-0.05%) ⬇️
unit 56.55% <51.94%> (?)

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

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

@geido geido marked this pull request as ready for review February 22, 2024 17:35
Copy link
Member

@kgabryje kgabryje left a comment

Choose a reason for hiding this comment

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

Added a few nonblocking comments but looks great!

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.

a couple of non blocking comments

superset/commands/database/ssh_tunnel/update.py Outdated Show resolved Hide resolved
superset/commands/database/update.py Outdated Show resolved Hide resolved
superset/commands/database/update.py Show resolved Hide resolved
@geido geido merged commit 89e89de into master Mar 11, 2024
36 checks passed
Copy link
Contributor

@geido Ephemeral environment spinning up at http://35.89.241.113:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

Copy link
Contributor

Ephemeral environment shutdown and build artifacts deleted.

@michael-s-molina michael-s-molina added v4.0 Label added by the release manager to track PRs to be included in the 4.0 branch v3.1 Label added by the release manager to track PRs to be included in the 3.1 branch and removed v3.1 Label added by the release manager to track PRs to be included in the 3.1 branch labels Mar 14, 2024
michael-s-molina pushed a commit that referenced this pull request Mar 14, 2024
sfirke pushed a commit to sfirke/superset that referenced this pull request Mar 22, 2024
@rusackas rusackas deleted the diego/ch78628/fix-disabled-ssh-toggle branch April 16, 2024 16:52
@mistercrunch mistercrunch added 🍒 4.0.0 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels labels Apr 17, 2024
qleroy pushed a commit to qleroy/superset that referenced this pull request Apr 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Related to the REST API 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels packages size/XXL v4.0 Label added by the release manager to track PRs to be included in the 4.0 branch 🍒 4.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants