[eas-cli] Add workflow:ssh command - #4032
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## gwdp/eng-24547-worker-ssh-phase #4032 +/- ##
===================================================================
+ Coverage 63.97% 64.09% +0.13%
===================================================================
Files 1034 1036 +2
Lines 47778 47939 +161
Branches 10046 10086 +40
===================================================================
+ Hits 30561 30722 +161
Misses 17116 17116
Partials 101 101 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
dea7d06 to
f3f63db
Compare
38b2178 to
d311a40
Compare
f3f63db to
b3131bb
Compare
d311a40 to
1bf156f
Compare
b3131bb to
cc50b51
Compare
1bf156f to
c1bfc6f
Compare
cc50b51 to
4d9be2c
Compare
f7e016d to
c590f2f
Compare
4d9be2c to
43999d9
Compare
c590f2f to
f04922c
Compare
43999d9 to
8202db4
Compare
f04922c to
1c89f46
Compare
8202db4 to
cfc70cd
Compare
1c89f46 to
3e17793
Compare
cfc70cd to
89f3fb3
Compare
3e17793 to
1e58c28
Compare
89f3fb3 to
f217bca
Compare
1e58c28 to
aff1e33
Compare
f217bca to
7e99ecc
Compare
aff1e33 to
8fe0c84
Compare
7e99ecc to
1d1d365
Compare
da84062 to
d347f19
Compare
9be7734 to
8688828
Compare
d347f19 to
fdc8d1d
Compare
8688828 to
0297f39
Compare
fdc8d1d to
7acc859
Compare
0859dec to
bb0577f
Compare
823faef to
a0082de
Compare
bb0577f to
81a5ffa
Compare
81a5ffa to
0eabaa0
Compare
a0082de to
8285571
Compare
b9d5e60 to
7149fa3
Compare
8285571 to
3f76494
Compare
7149fa3 to
62efd17
Compare
3f76494 to
30390e1
Compare
62efd17 to
7b94ba2
Compare
| return jobCompleted ? 'ended' : 'pending'; | ||
| } | ||
|
|
||
| export function parseSshArgv(rawArgv: readonly string[]): { |
There was a problem hiding this comment.
oh no does oclif really not support this in a nicer way?
| if (!CONNECTION_HOST_REGEX.test(connectionHost)) { | ||
| throw new Error( | ||
| 'Unexpected connection host reported for this ssh session. Update eas-cli and try again, or contact support if it persists.' | ||
| ); | ||
| } | ||
| if (!CONNECTION_SECRET_REGEX.test(secret)) { | ||
| throw new Error( | ||
| 'Unexpected connection token reported for this ssh session. Update eas-cli and try again, or contact support if it persists.' | ||
| ); | ||
| } |
There was a problem hiding this comment.
why are we validating what www receives? shouldn't www validate inputs instead?
| export const CONNECTION_HOST_REGEX = /^[A-Za-z0-9.-]+(?::\d+)?$/; | ||
| export const CONNECTION_SECRET_REGEX = /^[A-Za-z0-9._~:/+=-]+$/; | ||
|
|
||
| export function splitConnectionHost(connectionHost: string): { host: string; port?: number } { |
There was a problem hiding this comment.
would new URL give us similar results?
| sshRequested: | ||
| job.type !== WorkflowJobType.GetBuild && | ||
| hasTurtleTarget && | ||
| job.workflowRun.sshSettings != null, |
Avoids a needless wait when the first connect-info fetch is already ready.
The wait loop now polls first, so keep one pending poll before ready.
|
✅ Thank you for adding the changelog entry! |

Why
Lets a developer open a shell on the worker running a workflow job:
How
Resolves the job's SSH session over the EAS API, waits for the worker to come online (spinner, up to ~5 min), then opens a direct
sshto the relay against a generated config.--show-connectprints the connect commands instead of opening a session — the direct one plus anupterm proxyWebSocket fallback for networks that block it.Test Plan
Unit tests cover argv parsing (
--show-connectposition, passthrough command) and connect-status resolution. Manually opened a session against a live local run and ran a remote command. CI passes.