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

#1570. Connect Action #1638

Merged
merged 29 commits into from
May 8, 2023
Merged

Conversation

mike-winberry
Copy link
Contributor

@mike-winberry mike-winberry commented Apr 21, 2023

Description

Ashton should be able to connect to a pre-defined connection within a deployed package.

Related Issue

#1570

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Other (security config, docs update, etc)

Checklist before merging

…false now that the server is nested within src.
@mike-winberry mike-winberry linked an issue Apr 21, 2023 that may be closed by this pull request
@mike-winberry mike-winberry self-assigned this Apr 21, 2023
@netlify
Copy link

netlify bot commented Apr 21, 2023

Deploy Preview for zarf-docs canceled.

Name Link
🔨 Latest commit 4761061
🔍 Latest deploy log https://app.netlify.com/sites/zarf-docs/deploys/6459714eb5beac000840d581

mike-winberry and others added 12 commits April 24, 2023 12:11
…ackage into the RemoveDeployedPackageDialog component.
… that takes in a package name as url param and responds with an APIPackageConnecttions object. Update internal/api/start.go with new packages route /list/connections/{name} where name is the name of the package whose connections are requested. Update types/api.go with the APIPackageConnections struct. Add connect-deployed-package-dialog to UI components. Updateee deployed-package-menu to open the connection selections dialog when clicking on the connect menu list item.
…and DisconnectTunnel methods for opening and closing a tunnel given a zarftunnel name as a url param. Update api/ start.go with the /tunnels /connect and /disconnect routes. Update types/runtime.go with type ZarfTunnels for use in api/cluster/tunnels to hold tunnel references until sigterm or DisconnectTunnel is called. Update ui/lib api.ts with a new Tunnels api object that contains the connect and disconnect enpoint methods.
…. Update types runetime.go by removing ZarfTunnels type to fix import error
… returns the tunnel HttpEndpoint with the tunnel urlSuffix appended. Update api/tunnels tunnels.go to no longer block, to properly return on errors, and to open the FullUrl instead of just the HttpUrl. Update ui/lib store.ts with tunnelStore that has a map of pkgNames with a list of thier open tunnels. Update ui components/ConnectDeployedPackageDialog to show an error message if it fails to connect to the requested resource.
…pdate api/ start.go with the tunnels package.
… selectable connections to disconnect if there are any connections. Update ui DeployedPackageMenu to show disconnect button if there are active tunnels for the package.
…l/api start.go with /tunnels/list route. Update api/tunnels/tunnels with ListTunnels method that returns a list of tunnel names. Create test/ui connect_games e2e test that creates a tunnel to doom and then disconnects the tunnel. Update ui package.json with test:connect test. Update ui api with Tunnels.list. Update zarf-dialog with bound open prop. Update ui ConnectDeployedPackageDialog and DisconnectDeployedPackageDialogs to reset selection when dialog opens. Update ui root page to update the tunnel store when it retrieves new package.
…i 04_connect_doom by removing unused import.
@mike-winberry mike-winberry marked this pull request as ready for review May 1, 2023 23:49
@mike-winberry
Copy link
Contributor Author

Screen.Recording.2023-05-01.at.4.50.07.PM.mov

src/internal/api/packages/list.go Outdated Show resolved Hide resolved
src/internal/api/tunnels/tunnels.go Outdated Show resolved Hide resolved
src/internal/api/tunnels/tunnels.go Outdated Show resolved Hide resolved
src/internal/api/tunnels/tunnels.go Outdated Show resolved Hide resolved
src/internal/api/tunnels/tunnels.go Outdated Show resolved Hide resolved
src/internal/api/tunnels/tunnels.go Outdated Show resolved Hide resolved
src/ui/lib/api.ts Outdated Show resolved Hide resolved
…and fixed the response status for ConnectTunnel. Update test/ui connect_doom to properly handle waiting for asynchronous click acttions for connect and disconnect.
…pdated the routes to take in a pkg and connection name instead of just connection so that tunnels can be created and removed by package. Remove api/packages list.go ListPackageConnections as it is no longer needed. Move api/tunnels/tunnels.go to api/packages/tunnels.go. Update api/packages tunnels.go with new typing and logic to connect, disconnect, and get connections by package, added ListConnections method that returns a map of package names to APIDeployedPackageConnections types, and removed the launch logic from the backend to be handled in the front end. Update packager deploy.go to add the connect strings to the pkg metadata prior to saving the deployed package information to k8s. Update types package.go ZarfMetadata with ConnectStrings field of Type ConnectStrings. Update types api.go with connection types for package connections/tunnels. Update ui api.ts with new endpoints and removed the tunnel endpoints. Update ui store.ts with update logic for the stores that use polling, added PackageTunnels interface. Update deployed-package-table with keys to prevent misrendering after adding a package. Update ui ConnectDeployedPackageDialog to use the new connections logic and api calls as well as opening the connection url in a new tab upon successfull connection. Update DeployedPackageMenu removed unused import. Update DisconnectDeployedPackageDialog to use new endpoints and logic for removing a connection. Update routes +page by extracting the asynchronous store methods into store.ts and added a poll for connections.
@mike-winberry mike-winberry requested review from Madeline-UX and a team as code owners May 3, 2023 00:00
Copy link
Contributor

@Racer159 Racer159 left a comment

Choose a reason for hiding this comment

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

lgtm

@Racer159 Racer159 enabled auto-merge (squash) May 8, 2023 22:28
@Racer159 Racer159 merged commit 5fcdc3c into main May 8, 2023
20 checks passed
@Racer159 Racer159 deleted the 1570-add-connect-action-to-package-actions-menu branch May 8, 2023 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Connect Action to Package actions menu
2 participants