-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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(ssh-tunnel): Move SSHManager to extensions pattern #22433
Conversation
superset/extensions/__init__.py
Outdated
local_bind_address = "127.0.0.1" | ||
|
||
@classmethod | ||
def mutator(cls, sqlalchemy_url: str, server: sshtunnel.SSHTunnelForwarder) -> str: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
naming: build_sqlalchemy_url
superset/extensions/__init__.py
Outdated
remote_bind_address: str, | ||
local_bind_address: str, | ||
**kwargs: Dict[str, Any], | ||
) -> sshtunnel.SSHTunnelForwarder: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should just return a ContextManager
superset/extensions/__init__.py
Outdated
@classmethod | ||
def create_tunnel( | ||
cls, | ||
ssh_address_or_host: str, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of breaking these fields out, just pass in the SSHConfig model object
superset/extensions/__init__.py
Outdated
@@ -109,6 +111,31 @@ def init_app(self, app: Flask) -> None: | |||
app.wsgi_app = SupersetProfiler(app.wsgi_app, self.interval) # type: ignore | |||
|
|||
|
|||
class SSHManager: # pylint: disable=too-few-public-methods | |||
local_bind_address = "127.0.0.1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should implement init_app
and should be wired up by the AppInitializer
Codecov Report
@@ Coverage Diff @@
## create-sshtunnelconfig-tbl #22433 +/- ##
===========================================================
Coverage 66.95% 66.96%
===========================================================
Files 1852 1853 +1
Lines 70512 70532 +20
Branches 7689 7689
===========================================================
+ Hits 47213 47232 +19
- Misses 21305 21306 +1
Partials 1994 1994
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
307162a
to
005bd35
Compare
005bd35
to
1d52c1a
Compare
SUMMARY
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION