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

chore: Remove database ID dependency for SSH Tunnel creation #26989

Merged
merged 14 commits into from
Feb 7, 2024

Conversation

geido
Copy link
Member

@geido geido commented Feb 2, 2024

SUMMARY

This PR removes the requirement to pass a database ID to the SSHTunnel command. It also removes the premature call of SQLAlchemy ORM listeners, such as after_insert, caused by the use of flush and begin_nested.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N.A.

TESTING INSTRUCTIONS

  • Create an SSH server.
  • Make sure that this server is accessible from the Preset IPs.
  • Create a DB connection.
  • Restrict access to the DB so that only traffic from the SSH server is accepted.
  • Try setting up the connection via SSH on a Preset Workspace.
  • All tests should pass

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

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (8a2f7d3) 67.31% compared to head (9a93efa) 69.66%.
Report is 65 commits behind head on master.

Files Patch % Lines
superset/commands/database/create.py 92.85% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #26989      +/-   ##
==========================================
+ Coverage   67.31%   69.66%   +2.34%     
==========================================
  Files        1895     1895              
  Lines       74202    74224      +22     
  Branches     8219     8219              
==========================================
+ Hits        49949    51705    +1756     
+ Misses      22204    20470    -1734     
  Partials     2049     2049              
Flag Coverage Δ
hive 53.80% <23.80%> (?)
mysql 78.00% <95.23%> (+0.02%) ⬆️
postgres 78.10% <95.23%> (+0.02%) ⬆️
presto 53.75% <23.80%> (?)
python 83.06% <95.23%> (+4.85%) ⬆️
sqlite 77.62% <23.80%> (-0.04%) ⬇️
unit 56.48% <66.66%> (?)

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.

@pull-request-size pull-request-size bot added size/M and removed size/S labels Feb 2, 2024
@pull-request-size pull-request-size bot added size/L and removed size/M labels Feb 2, 2024
@geido geido marked this pull request as draft February 2, 2024 14:13
@geido geido marked this pull request as ready for review February 2, 2024 18:55
Copy link
Member

@eschutho eschutho left a comment

Choose a reason for hiding this comment

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

I think this looks really good. Thanks @geido. My only question is around whether we need the add param on the db dao.

superset/daos/base.py Outdated Show resolved Hide resolved
@geido geido changed the title chore: Change order of operations for SSH tunnel creation chore: Remove database ID dependency for SSH Tunnel creation Feb 6, 2024
@geido geido requested a review from eschutho February 6, 2024 17:06
Copy link
Member

@betodealmeida betodealmeida left a comment

Choose a reason for hiding this comment

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

Looks good, I just left a few comments.

superset/commands/database/create.py Outdated Show resolved Hide resolved
tests/integration_tests/databases/api_tests.py Outdated Show resolved Hide resolved
@geido geido merged commit d8e26cf into master Feb 7, 2024
40 checks passed
sadpandajoe pushed a commit to preset-io/superset that referenced this pull request Feb 12, 2024
sfirke pushed a commit to sfirke/superset that referenced this pull request Mar 22, 2024
@rusackas rusackas deleted the diego/ch78526/ssh-tunnel-db-id-dep branch April 16, 2024 16:53
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 4.0.0 labels Apr 17, 2024
vinothkumar66 pushed a commit to vinothkumar66/superset that referenced this pull request Nov 11, 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 🚢 4.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants