-
Notifications
You must be signed in to change notification settings - Fork 445
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(ec2): dry run connection script to surface errors earlier. #6037
base: master
Are you sure you want to change the base?
Conversation
|
): Promise<void> { | ||
try { | ||
const env = { SESSION_ID: session.SessionId, STREAM_URL: session.StreamUrl, TOKEN: session.TokenValue } | ||
await new ProcessClass(sshPath, ['-T', `${user}@${hostname}`, 'echo connected && exit']).run({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not a blocker: for connecting to a Windows machine would we need a different test command? or does this command work on powershell?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we directly invoke the sshPath I believe this should still work. However, once I add some tests for this function I will hopefully have a better idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome
): Promise<void> { | ||
try { | ||
const env = { SESSION_ID: session.SessionId, STREAM_URL: session.StreamUrl, TOKEN: session.TokenValue } | ||
await new ProcessClass(sshPath, ['-T', `${user}@${hostname}`, 'echo connected && exit']).run({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we capture the output of this process invocation and include it in the logs?
we may even want to use a similar approach as collectSamErrors
(which should probably be lifted into errors.ts
, and generalized a bit) to collect errors, and include them in the user-facing message.
export function collectSamErrors(samOutput: string): string[] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the output is already in the logs because we bind a logger to the process:
aws-toolkit-vscode/packages/core/src/awsService/ec2/model.ts
Lines 248 to 252 in 823a0e3
const SessionProcess = createBoundProcess(envProvider).extend({ | |
onStdout: logger, | |
onStderr: logger, | |
rejectOnErrorCode: true, | |
}) |
Do you think its worth filtering the logs? I agree that
collectSamErrors
method could definitely be generalized and potentially applied here as a filter, but unsure what to filter for.
Co-authored-by: Justin M. Keyes <[email protected]>
Problem
Follow up to #6018 (comment)
Solution
ssh
within the same env as it will be run on real connection.remoteSession.ts
that are general enough to be there.Error msg:
License: I confirm that my contribution is made under the terms of the Apache 2.0 license.