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): Delete command & exceptions #22131

Conversation

Antonio-RiveroMartnez
Copy link
Member

SUMMARY

  • Adding the new DELETE command and its exception to our SSH Tunnel

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

- Add Delete Command and its exceptions
self._model_id = model_id
self._model: Optional[SSHTunnel] = None

def run(self) -> Model:
Copy link
Member

Choose a reason for hiding this comment

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

can we write a small unit test for deleting this the same way as the last PR we have

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh yeah! Let me add those for this and the update one



class SSHTunnelDeleteFailedError(DeleteFailedError):
message = _("SSH Tunnel could not be deleted.")
Copy link
Member

Choose a reason for hiding this comment

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

can you add a status 500 on this one

Copy link
Member Author

Choose a reason for hiding this comment

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

The parent class already has status = 500 so it should be already there.

message = _("SSH Tunnel could not be deleted.")


class SSHTunnelNotFoundError(CommandException):
Copy link
Member

Choose a reason for hiding this comment

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

add a status 404 on this one

Copy link
Member Author

Choose a reason for hiding this comment

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

Will do 👍

- Move our SSH tunnel DAO, commands, model and exceptions to its own folder inside databases directory
- Adjust some imports with the new paths
- Add tests to our Delete command
@hughhhh hughhhh merged commit 6bd32e8 into apache:create-sshtunnelconfig-tbl Nov 16, 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