Skip to content

[eas-cli] Add workflow:ssh command - #4032

Open
gwdp wants to merge 7 commits into
gwdp/eng-24547-worker-ssh-phasefrom
gwdp/eng-24550-workflow-ssh-command
Open

[eas-cli] Add workflow:ssh command#4032
gwdp wants to merge 7 commits into
gwdp/eng-24547-worker-ssh-phasefrom
gwdp/eng-24550-workflow-ssh-command

Conversation

@gwdp

@gwdp gwdp commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Why

Lets a developer open a shell on the worker running a workflow job:

eas workflow:ssh <workflow-job-id>

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 ssh to the relay against a generated config.

  • Tokens after the id run as a remote command instead of opening an interactive shell.
  • --show-connect prints the connect commands instead of opening a session — the direct one plus an upterm proxy WebSocket fallback for networks that block it.
  • Not-enabled, ended, still-pending, and unknown-id cases print a clear message and exit non-zero instead of a raw error.

Test Plan

Unit tests cover argv parsing (--show-connect position, passthrough command) and connect-status resolution. Manually opened a session against a live local run and ran a remote command. CI passes.

@linear-code

linear-code Bot commented Jul 16, 2026

Copy link
Copy Markdown

ENG-24550

gwdp commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

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.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.09%. Comparing base (0c6efc0) to head (5e7dc01).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gwdp
gwdp force-pushed the gwdp/eng-24550-workflow-ssh-command branch from dea7d06 to f3f63db Compare July 16, 2026 19:05
@gwdp
gwdp force-pushed the gwdp/eng-24547-worker-ssh-phase branch from 38b2178 to d311a40 Compare July 16, 2026 19:05
@gwdp
gwdp force-pushed the gwdp/eng-24550-workflow-ssh-command branch from f3f63db to b3131bb Compare July 16, 2026 22:18
@gwdp
gwdp force-pushed the gwdp/eng-24547-worker-ssh-phase branch from d311a40 to 1bf156f Compare July 16, 2026 22:18
@gwdp
gwdp force-pushed the gwdp/eng-24550-workflow-ssh-command branch from b3131bb to cc50b51 Compare July 16, 2026 22:20
@gwdp
gwdp force-pushed the gwdp/eng-24547-worker-ssh-phase branch from 1bf156f to c1bfc6f Compare July 16, 2026 22:20
@gwdp
gwdp force-pushed the gwdp/eng-24550-workflow-ssh-command branch from cc50b51 to 4d9be2c Compare July 17, 2026 02:37
@gwdp
gwdp force-pushed the gwdp/eng-24547-worker-ssh-phase branch 2 times, most recently from f7e016d to c590f2f Compare July 21, 2026 02:08
@gwdp
gwdp force-pushed the gwdp/eng-24550-workflow-ssh-command branch from 4d9be2c to 43999d9 Compare July 21, 2026 02:08
@gwdp gwdp changed the title [eas-cli] add workflow:ssh command [eas-cli] Add workflow:ssh command Jul 21, 2026
@gwdp
gwdp force-pushed the gwdp/eng-24547-worker-ssh-phase branch from c590f2f to f04922c Compare July 24, 2026 00:52
@gwdp
gwdp force-pushed the gwdp/eng-24550-workflow-ssh-command branch from 43999d9 to 8202db4 Compare July 24, 2026 00:52
@gwdp
gwdp force-pushed the gwdp/eng-24547-worker-ssh-phase branch from f04922c to 1c89f46 Compare July 24, 2026 00:58
@gwdp
gwdp force-pushed the gwdp/eng-24550-workflow-ssh-command branch from 8202db4 to cfc70cd Compare July 24, 2026 00:59
@gwdp
gwdp force-pushed the gwdp/eng-24547-worker-ssh-phase branch from 1c89f46 to 3e17793 Compare July 24, 2026 03:10
@gwdp
gwdp force-pushed the gwdp/eng-24550-workflow-ssh-command branch from cfc70cd to 89f3fb3 Compare July 24, 2026 03:10
@gwdp
gwdp force-pushed the gwdp/eng-24547-worker-ssh-phase branch from 3e17793 to 1e58c28 Compare July 24, 2026 03:13
@gwdp
gwdp force-pushed the gwdp/eng-24550-workflow-ssh-command branch from 89f3fb3 to f217bca Compare July 24, 2026 03:13
@gwdp
gwdp force-pushed the gwdp/eng-24547-worker-ssh-phase branch from 1e58c28 to aff1e33 Compare July 24, 2026 03:28
@gwdp
gwdp force-pushed the gwdp/eng-24550-workflow-ssh-command branch from f217bca to 7e99ecc Compare July 24, 2026 03:28
@gwdp
gwdp force-pushed the gwdp/eng-24547-worker-ssh-phase branch from aff1e33 to 8fe0c84 Compare July 24, 2026 03:37
@gwdp
gwdp force-pushed the gwdp/eng-24550-workflow-ssh-command branch from 7e99ecc to 1d1d365 Compare July 24, 2026 03:37
@gwdp
gwdp force-pushed the gwdp/eng-24550-workflow-ssh-command branch 2 times, most recently from da84062 to d347f19 Compare July 25, 2026 04:37
@gwdp
gwdp force-pushed the gwdp/eng-24547-worker-ssh-phase branch from 9be7734 to 8688828 Compare July 25, 2026 04:37
@gwdp
gwdp force-pushed the gwdp/eng-24550-workflow-ssh-command branch from d347f19 to fdc8d1d Compare July 25, 2026 04:41
@gwdp
gwdp force-pushed the gwdp/eng-24547-worker-ssh-phase branch from 8688828 to 0297f39 Compare July 25, 2026 04:41
@gwdp
gwdp force-pushed the gwdp/eng-24550-workflow-ssh-command branch from fdc8d1d to 7acc859 Compare July 25, 2026 04:42
@gwdp
gwdp force-pushed the gwdp/eng-24547-worker-ssh-phase branch 2 times, most recently from 0859dec to bb0577f Compare July 27, 2026 00:23
@gwdp
gwdp force-pushed the gwdp/eng-24550-workflow-ssh-command branch 2 times, most recently from 823faef to a0082de Compare July 27, 2026 00:49
@gwdp
gwdp force-pushed the gwdp/eng-24547-worker-ssh-phase branch from bb0577f to 81a5ffa Compare July 27, 2026 00:49
@gwdp
gwdp force-pushed the gwdp/eng-24547-worker-ssh-phase branch from 81a5ffa to 0eabaa0 Compare July 28, 2026 01:05
@gwdp
gwdp force-pushed the gwdp/eng-24550-workflow-ssh-command branch from a0082de to 8285571 Compare July 28, 2026 01:05
@gwdp
gwdp force-pushed the gwdp/eng-24547-worker-ssh-phase branch 3 times, most recently from b9d5e60 to 7149fa3 Compare July 28, 2026 23:49
@gwdp
gwdp force-pushed the gwdp/eng-24550-workflow-ssh-command branch from 8285571 to 3f76494 Compare July 28, 2026 23:50
@gwdp
gwdp force-pushed the gwdp/eng-24547-worker-ssh-phase branch from 7149fa3 to 62efd17 Compare July 28, 2026 23:56
@gwdp
gwdp force-pushed the gwdp/eng-24550-workflow-ssh-command branch from 3f76494 to 30390e1 Compare July 28, 2026 23:56
@gwdp
gwdp force-pushed the gwdp/eng-24547-worker-ssh-phase branch from 62efd17 to 7b94ba2 Compare July 29, 2026 00:22
return jobCompleted ? 'ended' : 'pending';
}

export function parseSshArgv(rawArgv: readonly string[]): {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

oh no does oclif really not support this in a nicer way?

Comment thread packages/eas-cli/src/commands/workflow/ssh.ts Outdated
Comment thread packages/eas-cli/src/commands/workflow/ssh.ts
Comment thread packages/eas-cli/src/commands/workflow/ssh.ts
Comment on lines +148 to +157
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.'
);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 } {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

would new URL give us similar results?

Comment thread packages/eas-cli/src/commands/workflow/ssh.ts Outdated
Comment on lines +56 to +59
sshRequested:
job.type !== WorkflowJobType.GetBuild &&
hasTurtleTarget &&
job.workflowRun.sshSettings != null,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

eh

@github-actions

Copy link
Copy Markdown

✅ Thank you for adding the changelog entry!

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.

2 participants