superset icon indicating copy to clipboard operation
superset copied to clipboard

feat(ssh-tunnel): ssh manager config + feature flag

Open hughhhh opened this issue 2 years ago • 1 comments

SUMMARY

Created a config object class to manage how ssh tunnels can be configured. The main use case for this is to allow mutation and validation on ssh tunnels being created for a given superset instance. For the SSHManager the

class SSHManager:
     def validate(self, ssh_tunnel_params: Dict[str, Any]):
         # validation on CREATE + UPDATE on SSHTunnel Model
         raise NotImplemented()

     def mutator(self, ssh_tunnel_params: Dict[str, Any]):
         # override any ssh tunnel configuration object
         raise NotImplemented()

     @property
     def local_bind_address(self):
         # set the local binding address for the local client
         # the port will be dynamically configured by the sshtunnel.SSHTunnelForwarder
        # `server` return value
        return "127.0.0.1"

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

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

hughhhh avatar Nov 22 '22 22:11 hughhhh

Codecov Report

Merging #22201 (c6a3dee) into create-sshtunnelconfig-tbl (e3ef835) will decrease coverage by 11.16%. The diff coverage is 69.23%.

:exclamation: Current head c6a3dee differs from pull request most recent head 146c476. Consider uploading reports for the commit 146c476 to get more accurate results

@@                       Coverage Diff                       @@
##           create-sshtunnelconfig-tbl   #22201       +/-   ##
===============================================================
- Coverage                       66.95%   55.79%   -11.17%     
===============================================================
  Files                            1852     1852               
  Lines                           70504    70511        +7     
  Branches                         7689     7689               
===============================================================
- Hits                            47206    39341     -7865     
- Misses                          21304    29176     +7872     
  Partials                         1994     1994               
Flag Coverage Δ
hive 52.58% <69.23%> (+<0.01%) :arrow_up:
mysql ?
postgres ?
presto 52.47% <69.23%> (+<0.01%) :arrow_up:
python 57.97% <69.23%> (-23.38%) :arrow_down:
sqlite ?
unit 51.11% <69.23%> (+<0.01%) :arrow_up:

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

Impacted Files Coverage Δ
superset/constants.py 100.00% <ø> (ø)
superset/config.py 90.82% <66.66%> (-1.03%) :arrow_down:
superset/models/core.py 76.73% <66.66%> (-13.05%) :arrow_down:
superset/databases/ssh_tunnel/models.py 75.86% <100.00%> (ø)
superset/utils/dashboard_import_export.py 0.00% <0.00%> (-100.00%) :arrow_down:
superset/tags/core.py 4.54% <0.00%> (-95.46%) :arrow_down:
superset/key_value/commands/update.py 0.00% <0.00%> (-90.91%) :arrow_down:
superset/key_value/commands/delete.py 0.00% <0.00%> (-87.88%) :arrow_down:
superset/key_value/commands/delete_expired.py 0.00% <0.00%> (-84.00%) :arrow_down:
superset/dashboards/commands/importers/v0.py 15.62% <0.00%> (-76.25%) :arrow_down:
... and 288 more

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

codecov[bot] avatar Nov 22 '22 22:11 codecov[bot]