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(ssh_tunnel): DAO Changes for SSH Tunnel #22120

Merged

Conversation

Antonio-RiveroMartnez
Copy link
Member

SUMMARY

  • New DAO Class for SSH Tunnel
  • Add method to fetch related ssh tunnel in the DatabaseDAO

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

- New DAO Class for SSH Tunnel
- Add method to fetch related ssh tunnel in the DatabaseDAO
@@ -124,3 +125,13 @@ def get_related_objects(cls, database_id: int) -> Dict[str, Any]:
return dict(
charts=charts, dashboards=dashboards, sqllab_tab_states=sqllab_tab_states
)

@classmethod
def get_related_ssh_tunnel(cls, database_id: int) -> Dict[str, Any]:
Copy link
Member

Choose a reason for hiding this comment

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

let's just call the get_ssh_tunnel since it's a 1 to 1 relationship

Copy link
Member Author

Choose a reason for hiding this comment

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

Cool! Renamed to get_ssh_tunnel 👍

- Rename method since it's a 1:1 relationship
@@ -124,3 +125,13 @@ def get_related_objects(cls, database_id: int) -> Dict[str, Any]:
return dict(
charts=charts, dashboards=dashboards, sqllab_tab_states=sqllab_tab_states
)

@classmethod
def get_ssh_tunnel(cls, database_id: int) -> Dict[str, Any]:
Copy link
Member

Choose a reason for hiding this comment

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

also can we write a small unit test for this here's an example

def test_datasource_find_by_id_skip_base_filter_not_found(

Copy link
Member Author

Choose a reason for hiding this comment

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

Added :)

- Add Unit Tests for our new method in the DatabaseDAO
@pull-request-size pull-request-size bot added size/L and removed size/M labels Nov 15, 2022
@Antonio-RiveroMartnez Antonio-RiveroMartnez changed the title feature(ssh_tunnel): DAO Changes for SSH Tunnel feat(ssh_tunnel): DAO Changes for SSH Tunnel Nov 15, 2022
@hughhhh hughhhh merged commit 2777807 into apache:create-sshtunnelconfig-tbl Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants