Skip to content

[v11] Spawn gateway CLI client directly#26755

Merged
ravicious merged 4 commits intobranch/v11from
ravicious/v11/backport-db-cli
May 26, 2023
Merged

[v11] Spawn gateway CLI client directly#26755
ravicious merged 4 commits intobranch/v11from
ravicious/v11/backport-db-cli

Conversation

@ravicious
Copy link
Copy Markdown
Member

@ravicious ravicious commented May 23, 2023

Backport #26441, #26705, #26581.

I also had to backport #24445 since DocumentGatewayCliClient depends on connectToDatabase. I removed any references to document origin since it was not backported to v12. I tested the connectivity to all three supported resource kinds but I'd appreciate a double check on that.

Another thing to take care of was theme colors since they weren't backported to v11. Fortunately, as far as I can see only the last commit uses a color and it was trivial to use the old name for it.

gzdunek and others added 4 commits May 24, 2023 15:37
* Create dedicated functions for connecting to resources

* Do not use spread operator

* Rename `connectToNode` -> `connectToServer`

* Remove unused imports
* Return os.exec.Cmd as gateway CLI command

* Remove separate Props type from DocumentTerminal

* Refactor Kind type exported from documentsService

* Export makeRuntimeSettings from MainProcess mock

* PtyProcess: Join args in logger name

* ptyHostService: Pass ptyOptions explicitly instead of using spread

I noticed that we pass both argsList and args to the PtyProcess constructor.
While TypeScript allows that, it is a bit confusing when inspecting the
actual values received in the constructor.

* Add empty DocumentGatewayCliClient

* Start terminal from DocumentGatewayCliClient

* Add waiting state for DocumentGatewayCliClient

* Remove targetSubresourceName from DocumentGatewayCliClient title
* Add onStartError to PTY process

* Add logging to frontend PtyEventsStreamHandler

* Return cleanup functions from pty process onEvent functions

* Extract DocumentReconnect from DocumentTerminal

The Reconnect component will be useful when handling startError.

* Add getPtyId to PtyProcess

This will act as the key for the Terminal component, allowing us to
make sure we mount it only once for any given PTY process.

* Capture startError and display an error state

* Terminal/ctrl: Cleanup ptyProcess onData listener

* Include command name and args in startError error message

* Remove ptyId field from PtyProcess
@ravicious ravicious force-pushed the ravicious/v11/backport-db-cli branch from 3d47d15 to ecf133b Compare May 24, 2023 13:49
@ravicious ravicious marked this pull request as ready for review May 24, 2023 13:50
@github-actions github-actions Bot requested review from avatus, gzdunek and ryanclark May 24, 2023 13:51
Copy link
Copy Markdown
Contributor

@gzdunek gzdunek left a comment

Choose a reason for hiding this comment

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

Tested, everything looks fine.

@ravicious ravicious added this pull request to the merge queue May 25, 2023
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks May 25, 2023
@ravicious ravicious added this pull request to the merge queue May 26, 2023
Merged via the queue into branch/v11 with commit f5ebf2f May 26, 2023
@ravicious ravicious deleted the ravicious/v11/backport-db-cli branch May 26, 2023 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants