Skip to content

[v13] v13.2.2 Assist backports#29125

Merged
jakule merged 3 commits intobranch/v13from
jakule/v13/assist-13-2-2
Jul 14, 2023
Merged

[v13] v13.2.2 Assist backports#29125
jakule merged 3 commits intobranch/v13from
jakule/v13/assist-13-2-2

Conversation

@jakule
Copy link
Copy Markdown
Contributor

@jakule jakule commented Jul 14, 2023

No description provided.

ryanclark and others added 3 commits July 14, 2023 10:41
)

* Clear the refresh websocket timeout when closing Assist

* Missing semicolon to please prettier

* Add comment to remove once the new session implementation is done
* Mark nodes as done when command finishes in Assist

* Split Close/CloseWithPayload

* Expect a close message before the summary in test

* Remediate confusing type usage in test

`Envelope` is the outer layer used (in protobuf format)
for execution / terminal sessions.

Meanwhile `outEnvelope` is the inner layer
used (in JSON) spefically with assist (execution),
when outer envelope is of "raw" type

Using `Envelope` where decoding `outEnvelope` in tests
previously worked "by accident" due to matching field names

* Assert that server ID is set in the close message

* Refactor command execution logic and adjust WebSocket handling

This commit changes how command execution and WebSocket handling are performed in the code. Instead of manually managing session close signals and command execution notifications via WebSocket, we have wrapped it into more easily manageable form.

Changed parts: assist and websocket libraries, test and several components of 'teleport'.

Why:
This allows cleaner command management and error handling, leading to more reliable and maintainable application. Also made code more readable and easy to understand. Made WebSocket more precise with its handling to prevent cases where stale or incorrect data might interrupt the session.

Details:
Instead of sending a close signal after all commands have been executed, we now send individual session end updates for each command. Sessions no longer remain active unnecessarily.

Message handling in command execution has been refactored for better error propagation.

All these changes were also adjusted and reflected in the associated test cases.
Also, names and types of various data structures are edited to reflect their actual usage.

* Change ServerID to NodeID to improve code consistency

This commit replaces occurrences of `ServerID` with `NodeID` across several files.
`ServerID` was misleading and causing confusion as it was serving as an identifier for nodes, so to improve comprehension and consistency in the codebase, all instances of `ServerID` have been replaced with `NodeID`. Tests have also been updated to reflect this change.

---------

Co-authored-by: Jakub Nyckowski <jakub.nyckowski@goteleport.com>
@jakule jakule enabled auto-merge July 14, 2023 15:43
@jakule jakule added this pull request to the merge queue Jul 14, 2023
Merged via the queue into branch/v13 with commit e5d644c Jul 14, 2023
@jakule jakule deleted the jakule/v13/assist-13-2-2 branch July 14, 2023 16:11
@r0mant r0mant mentioned this pull request Jul 14, 2023
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.

5 participants