Repository navigation
fix(instances): stop unmapped transports rendering as SSH - #13337
koenvincent wants to merge 2 commits into
Conversation
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
2 similar comments
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
ef2c960 to
134a0b3
Compare
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
6 similar comments
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
134a0b3 to
77e8e21
Compare
77e8e21 to
7822b8d
Compare
7822b8d to
74fc8b7
Compare
|
|
|
|
|
|
|
|
|
|
Answer to the PASS-lane ask on
|
|
HOLD at Your dispositions for The lanes re-ran on this head after those dispositions, and these items have no reply yet:
UX Watch 1 and First Principles items 5-6 pull in opposite directions, and the GPT 6.1/Opus fix sits between them. A maintainer needs to decide which surface carries the unsupported-method message (the hint, the notice, or both), and to rule on the Goal as r115 asked. To clear this hold: post one disposition per item above for this head, and get that ruling. Our earlier CHANGES_REQUESTED stays until then. I read the source and CI. I did not run tests. — crew-pr-reviewer (r116) |
|
|
|
|
|
|
|
@iamwhatever thanks for r116. All six items now have a disposition for On which surface carries the unsupported-method message: I took First Principles' subtraction, so there is now only one. The inline hint and the pane's unmapped branches are gone. The badge's hover title explains the method, and a pressed Connect or Retry shows the gateway's refusal once, through So the open question for a maintainer is only the Goal ruling r115 asked for: is "never render an unrecognised method as SSH" the whole Goal? If it should be wider, the hint and the suffix can come back as a separate PR. |
|
HOLD at 6a010f4. The code is sound, but a maintainer ruling is still open and three lane notes on this head have no reply. The narrowed version reads well. One normalised table drives every surface, and an unrecognised method shows its own name with no address, never SSH (remoteCrew.ts#L65-L108). The gateway's refusal shows once through What blocks approval:
Our earlier CHANGES_REQUESTED stays until then. Reviewed head: 6a010f4 — crew-pr-reviewer (r121) |
|
@iamwhatever thanks for r121. One disposition per open note:
So the open question is still the one from r115: is "never render an unrecognised method as SSH" the whole Goal? |
|
Hold at The fix is sound. One normalised table drives the badge, address line and both failure reports, so an unrecognised method shows its own name and never SSH. Your r121 dispositions landed, and CI and every lane are green. What would clear this:
— crew-pr-reviewer (r124) |
|
@iamwhatever thanks for r124. One disposition per open note, all on 025a40e (no new push):
So only the r115 question is left: is "never render an unrecognised method as SSH" the whole Goal? |
|
Still holding at 025a40e, now for one item only. Your replies to the three r124 notes hold. What would clear this: a maintainer rules on the r115 question, whether 'never render an unrecognised method as SSH' is the whole Goal. Our earlier change request stays until then. — crew-pr-reviewer (r125) |
The Remote Crew surfaces decided a crew's badge, its hover hint, its address line and its diagnostics transport with four independent chains of conditionals whose last arm was `ssh`. Every method those chains did not name therefore rendered as SSH, silently -- and the surfaces disagreed with each other, because one tested the shared `usesSsmTransport` helper while the other compared `=== 'ssm'` inline. That is not hypothetical: a `fargate` crew's failure report says `transport: ssh` in InstancesViewport and `transport: ssm` in RemoteCrewPanel today, for the same failure. The report's repair steps are keyed by that name, so a fargate crew is handed SSH's repair ladder. Introduce one mapping in `utils/remoteCrew.ts` keyed by connection method, carrying which field addresses the crew and which transport name the failure report should use, and route all five branch sites through it. An unrecognised method is now visibly unmapped: no badge copy (the surface prints the method's own name), no hover hint, no address field, and a report that names itself instead of inheriting a sibling's repair steps. An ABSENT method still means ssh -- `normalizeConnectionMethod` mirrors the gateway's `(inst.connection_method or "ssh").strip().lower()`. Conflating absent with unrecognised was the defect; only the second half changes. The badge copy lives in `pages/settings/transportCopy.ts` with LITERAL i18n keys rather than keys read off the mapping: the key-reference gate can only check a statically resolvable key, and its dynamic-site baseline is ratchet-down only. The table is typed `Record<PresentedConnectionMethod, ...>`, so adding a transport without its copy is a typecheck failure rather than a missing label at runtime. Implements RFC section 3.9 and the phase 2 dashboard items of docs/request-for-change/plans/2026-09-23-outbound-instance-transport.md The gateway-side PeerTransport seam is the phase 2 Python half and follows separately.
|
@dwu96 one ruling clears this PR, per r125: is "never render an unrecognised transport method as SSH" the whole Goal? If yes, the PR is done as is. One table drives every surface, every lane was green on If you want more in scope, for example a gateway-side refusal for unmapped methods, say which and I will open a linked issue for it rather than grow this PR. |
|
@dwu96 friendly ping on the one ruling r125 asks for: is "never render an unrecognised transport method as SSH" the whole Goal? On a yes I will rebase once onto main (it has drifted since 11-05) and the PR is done. If you want more in scope, name it and I will track it in a linked issue. |
Problem / Motivation
Goal: Stop the dashboard from rendering a crew whose
connection_methodit does not recognise as an SSH crew.The Remote Crew surfaces decide a crew's badge, hover hint, address line and
diagnostics transport with conditionals whose last arm is
ssh. Any methodthe chain does not name is silently treated as SSH, and the two surfaces disagree
about the same failure on
maintoday:fargatecrew reportscomponents/InstancesViewport.tsxinst?.connection_method === 'ssm' ? 'ssm' : 'ssh'transport: sshpages/settings/RemoteCrewPanel.tsxusesSsmTransport(inst) ? 'ssm' : 'ssh'transport: ssmThe failure report's repair ladder is selected by that name, so a fargate crew is
handed SSH's remediation steps. The card's address line has the same shape:
usesSsmTransport(inst) ? inst.ssm_target : inst.ssh_hostprints an empty SSHhost for any unrecognised method, which reads as a configured-but-blank SSH crew
rather than as something unsupported.
Why it matters
CONNECTION_METHODShas already grown once, from("ssh", "ssm")to("ssh", "ssm", "fargate"), and the fargate mislabelling above is what thatgrowth cost. The failure mode is silence: nothing throws, nothing logs, the badge
says SSH and the repair steps are the wrong ones.
Not a goal
PeerTransportregistry that used to be the second commit is out of this PR (see Scope below). It waits on a maintainer scope call on RFC docs(rfc): outbound instance transport without SSH or SSM #13031.ssh,ssmorfargateconnect.InstancesPanel.tsxbadge,InstanceFormFields.tsxselector) are named below, not converted here: neither mislabels a known method today.hasDashboardPaneis converted: it compares the normalised method.What changed (motivation → approach → change)
Scope since the last review. This PR is now dashboard only: one commit, about 240 production lines. The
gateway
PeerTransportrefactor that used to be the second commit has been takenout. It was over the size limit, and whether to land groundwork for the draft
outbound RFC (#13031) is a maintainer scope call that should not hold this
defect fix. It will come back as its own PR once that call is made.
Review follow-up 4 (2026-10-21, crew-pr-reviewer r116 on df8cf0f), head 085483f, same base. The PR is cut down to its Goal. First Principles items 5-7 judged the visible hint, the pane's unmapped branches and the secondary Connect/Retry oversized, and UX Watch 1 found the hint and the Retry notice saying the same thing twice. Both point at the same subtraction, so it is done: the inline
transport_hint_unmapped_richhint and its key in all 12 locales are gone, the pane is the ordinary disconnected pane with a primary Retry, and the Settings row keeps a primary Connect. The badge's hover title (transport_hint_unmapped) still explains the method, and pressing Connect or Retry shows the gateway's own refusal once, throughErrorNotice.hasDashboardPanenow compares the normalised method (Design). The PR is 122 lines smaller.Review follow-up 3 (2026-10-21, GPT 6.1 / Opus 5.5 / First Principles on 8c4c216), head df8cf0f, same base. The "not supported" state is gone. Every round on it moved the same finding between lanes: the status notice broke errors-use-error-notice, hiding the refusal left Retry looking dead, and the StatusBadge arm bypassed the shared Badge. First Principles had it right: the Goal ("never render as SSH") is met by items 1-3 alone. Removed:
StatusBadge notSupported, the chip, readout androwStateLabelarms,HostTab.unsupportedand its relay, andpanelRefusedUnsupported, along with bothnot_supportedi18n keys. Each crew surface now shows the tunnel's own state ("disconnected"), and the method's name plus the visible hint say why. Pressing Retry or Connect now shows the gateway's 409 through the panel's ordinaryErrorNotice, so the press visibly does something. The hint now ends "then try again" in all 12 locales, which fits both Retry and Connect. Net change this round: -146 lines.Follow-ups 2 and earlier below describe the removed state and are kept for the review trail.
Review follow-up 2 (2026-10-19, crew-pr-reviewer r112 on dafb9c3), on main d8ff9e7. The tab chip and the tunnel readout now say
not supportedfor an unmapped crew, as the switcher row and the pane hint already did. The pane uses a neutralInfoicon instead of the redAlertTriangle, and Retry stays but as a secondary (bordered) button: the gateway is the authority on what it can dial and this SPA's table can lag it (a tab left open across an update, the remedy the hint names), so pressing Retry lets the gateway answer, and its 409connection_method_unsupportedtext shows in the pane's notice, unwrapped.buildModelFornow relaysunsupported: trueand the same detail the host row shows, so an embedded pane's own switcher agrees with the window;parseHostModelaccepts only an explicittrue, so an older host changes nothing.PRESENTED_CONNECTION_METHODS(and the test-only export ofTRANSPORT_COPY) are gone: the exhaustiveness test resolves every gateway method throughtransportPresentationandtransportCopy. The viewport cases moved to a newInstancesViewportUnmappedTransport.test.tsx, so the baselinedInstancesViewport.test.tsxno longer grows.Review follow-up (2026-10-20, UX Watch relayed in r115), head 5878963, same base. The Settings row's "Not supported" is drawn by the shared
StatusBadge(newnotSupportedprop) in the same dot-plus-word shape as the other rows' "Disconnected", with a muted dot, instead of a second muted chip under the method chip; it is still the shared component, which the GPT 6.1 finding asked for. After Retry, the gateway's own refusal (409connection_method_unsupported, read from the typed code, never the text) is not repeated in any notice: it restates the hint, which stays and says what to do (a neutral notice was refused by theerrors-use-error-noticerule on5878963045, and a red one read as broken). Any other Retry failure on that crew still renders as the redErrorNoticewith its hand-off. Tests pin both, plus the non-refusal error case; reverting each change turns its test red. Screenshots re-taken with the committed capture script, which now also checks the muted dot and that no red notice follows Retry.Review follow-up (2026-10-20, GPT 6.1 on fed5c9d), head 145c698, same base. The Settings row's "Not supported" is now the shared
<Badge variant="muted">instead of hand-built status markup, as the upheld finding asked; the test asserts it renders through that badge, and the Settings frames are re-captured.Review follow-up (2026-10-20, r114), head fed5c9d, same base. The Settings row's status uses its own sentence-case key (
pages.settings.remoteCrewPanel.status_not_supported, "Not supported") to match the "Disconnected" StatusBadge beside it; the switcher keeps its lowercase inline suffix. "Settings → About" in the visible hint, on the Settings row and in the pane, is aSettingsLinkto/settings/about(a newtransport_hint_unmapped_richkey in all 12 locales; the hover titles keep the plain hint), and the pane's link returns to Local first like its existing Settings link. Two new capture frames show the pane after Retry. Tests: the PR's 4 frontend files (55 tests),tsc, ESLint,i18n-check, the i18n suite, the line cap, docs-lint and the feature-map gate pass; reverting each of the three changes turns its new assertion red. The Goal amendment for First Principles 5-6 is left to a maintainer.Review follow-up (2026-10-20, r113). The Settings row now agrees with the switcher and the pane: an unmapped crew reads
not supported(muted dot) instead of its tunnel state, and its Connect is a secondary button, like the pane's Retry, still clickable so the gateway's refusal is what the user reads. The hint names where to update (Settings → About, the path the update notices already use) in all locales. Thenot supportedstate, the pane restyle and theHostTab.unsupportedrelay stay: without them the surfaces contradict each other, which is what the UX lane flagged.Review follow-up (2026-10-19), on main d8ff9e7. The dashboard connect guards are removed again. Their premise ("the gateway dials an unmapped method over SSH") stopped being true when the gateway-side refusal tracked in #20250 landed as #20668:
_resolve_transportnow raisesUnsupportedConnectionMethodError,POST /api/instances/{id}/connectanswers 409connection_method_unsupported, and Settings -> Diagnose returns that verdict without a probe. SouseSelectInstanceandselectAutoConnectTargetsare back to main's code, Settings Connect is no longer disabled (it keepsaria-describedbyon the visible hint), and the pane keeps its Retry. What stays is the presentation: the badge, hint, address line, switcher subtitle andnot supportedstate word, the pane hint in place of the status word, and both failure reports reading one mapping. The feature-map row now says the gateway refuses the connect and Diagnose runs no probe (the First Principles and GPT 6.1 blockers on fb59ca0). Also new on this head: the two unmapped Settings cases moved toRemoteCrewPanelUnmappedTransport.test.tsx, because they putRemoteCrewPanel.test.tsxone line over the 2,000-line cap; the change to the Settings code moved toRemoteCrewPanelCrewRow.tsxwith main's split (#21592); and the capture script now also shoots the pane frames, with the connect stubbed as the gateway's 409.At head dafb9c3: the gateway's code is named correctly as
connection_method_unsupportedin the feature map, the capture stub and the comments (GPT 6.1 blocker on 7d1dbf0); themappeddocstring and the Settings hint comment no longer describe the removed guards; and the test-onlyTRANSPORT_COPY_METHODSexport and its drift test are gone, because theRecord<PresentedConnectionMethod, TransportCopy>type already fails the typecheck on a missing copy (First Principles CONCERNS items 9 and 10). 183 tests, tsc, eslint, the line cap, docs-lint, the feature-map gate and all six capture frames pass.Earlier follow-ups, kept for the review trail; where they describe guards, those are gone as above.
Review follow-up (2026-10-14). No dashboard connect path dials an unmapped crew any more. The gateway's
_resolve_transporttreats any method that is notfargateorssmasssh, so every dashboard path that connects now checkstransportPresentation(inst).mappedfirst:useSelectInstance(the switcher click, the keyboard chord, the command palette and the sidebar) activates the pane but does not connect;selectAutoConnectTargetsskips the crew; the in-pane panel shows thetransport_hint_unmappedhint in place of the "Disconnected" status and renders no Retry. Enabling or disabling such a crew needs no dashboard guard:PATCH /api/instances/{id}validates the edited record and refuses an unknown method with a 400 (instance_invalid), so the toggle never reaches a connect. The switcher row's subtitle names the method (outbound) instead of being blank, and its state word readsnot supportedinstead ofdisconnected, so the row says why picking it will not connect before you pick it.reportTransportis gone (it was alwaysmethod), andmappednow has those production consumers plus the Settings row. One new string,components.instanceTabBar.not_supported, in every locale.(Superseded: the gateway-side refusal tracked in #20250 landed as #20668, and Diagnose runs no probe for such a crew. See the 2026-10-19 follow-up.)
Review follow-up (2026-10-07). The description now names the real surface: one new i18n string in every locale and a disabled-Connect state. The unmapped hint says what to do next (update, then connect again), not only what is wrong. The unused protocol surface was the gateway half, which is no longer in this PR. A second commit records the behaviour on the
instancesrow ofdocs/feature-map/README.md.One mapping in
website/src/utils/remoteCrew.ts, keyed by method, carryingwhich field addresses the crew and whether the method is mapped. Both failure
reports key their repair steps by the method's own name.
It closes the two mismatched sites above and the crew switcher's row subtitle,
which had the same fallback.
An unmapped method renders as its own name, with the new
transport_hint_unmappedhint as the badge's hover title. Nothing else on therow or the pane changes: Connect and Retry stay as for any disconnected crew,
and the gateway refuses the connect itself (409
connection_method_unsupported,#20668), which the error notice shows.
Absent is not unrecognised.
normalizeConnectionMethodmirrors the gateway's(inst.connection_method or "ssh").strip().lower(), so a record with no methodstill means ssh.
Copy lives at the call site. The badge copy is in
pages/settings/transportCopy.tswith literal i18n keys, typedRecord<PresentedConnectionMethod, TransportCopy>. The key-reference gate(
website/scripts/check-i18n-keys.mjs) can only check a key it resolvesstatically and its dynamic-site baseline is ratchet-down only, so keys are not
read off the mapping. Adding a method without its copy is a typecheck failure.
One new i18n string,
transport_hint_unmapped("This version of{{productName}} doesn't support the {{method}} connection method, so it can't
connect to this crew. Update {{productName}}, then connect again."), in
en, the11 translated locales and the regenerated
en-XA. The existingtype_*/transport_hint_*keys forssh,ssmandfargateare reused verbatim.Not yet exhaustive, named rather than implied closed:
InstancesPanel.tsx(badge) andInstanceFormFields.tsx(method selector)still branch on the method string.
hasDashboardPanenow reads the normalisedmethod.
None regresses the three known methods.
Backwards compatibility
No change for a valid
ssh,ssmorfargaterecord, with one intendedcorrection: a
fargatecrew's failure report now saystransport: fargatewhere it said
ssh(viewport) orssm(settings panel). No API, config oron-disk change; no new dependency.
Tests
website/src/test/remoteCrewTransportPresentation.test.ts(new) readsregistry.pyas text with an anchored regex, so a backend rename fails loudlyinstead of passing vacuously. It covers the mapping's exactness against
CONNECTION_METHODS, the copy table, absent-means-ssh, case and spacenormalisation, the regression test of record (a
fargateinstance reportsfargate), per-method addressing, and that an unknown method acquires nosibling's badge, hint, address field or repair steps.
RemoteCrewPanelUnmappedTransport.test.tsx(new, split fromRemoteCrewPanel.test.tsxat its line cap) covers the badge hint, and the row keeping itsDisconnectedstate and a primary Connect with no inline hint.InstanceTabBar.test.tsxgains an unmapped case: the switcher row names the method, never the record'sssh_host.InstancesViewportUnmappedTransport.test.tsx(new) covers the ordinary disconnected pane with a primary Retry, Retry showing the gateway's 409 once through the panel'sErrorNotice, and the relayed detail (no new model field).remoteCrewTransportPresentation.test.tsalso pinshasDashboardPaneonFargateandFARGATE.At head 085483f: the 4 touched test files, the
src/i18nsuites,tsc, ESLint,check-i18n-keys, the line-cap, comment-history, feature-map and docs gates, and the capture script for all eight frames pass. Putting back the old pane, the old row, or the rawhasDashboardPanecomparison each turns a test red.At head df8cf0f: the 5 touched test files (98 tests), the
src/i18nsuites withI18N_BASE_REF(1022 tests),tsc -p tsconfig.app.json, ESLint on the touched files,check-i18n-keys,check_file_line_cap.py, the comment-history and feature-map gates, docs-lint, and the capture script for all eight frames pass.At head 7e715ec on main d8ff9e7: 8 test files (255 tests),
tsc, ESLint,i18n-check,check_file_line_cap.py, docs-lint and the feature-map gate pass, and the capture script passes for all six frames; mutations dropping the relayed flag, the chip branch, or the secondary Retry styling each turn a new test red. At head 7d1dbf0 on main d8ff9e7: the 7 touched test files (198 tests),tsc -p tsconfig.app.json, ESLint on the touched files,i18n-check,check_file_line_cap.py, docs-lint and the feature-map gate pass, and the capture script passes for all six frames. Earlier, onmaine4270cf at head 3f08700: the four directly touched test files (183 tests) pass, as do the i18n gates (lint:i18n,i18n:check);npm run typecheckand ESLint on the touched files are clean; the feature-map gate (FEATURE_MAP_BASE_REF=origin/main) passes. Mutation checks: removing the guard inuseSelectInstance, inselectAutoConnectTargets, orpanelUnmappedfrom Retry'sdisabledeach turns its new test red; droppingunmappedfrom the Settings Connect button'sdisabledturns "disables Connect on an unmapped method and says why in visible text" red. Dropping theunsupportedarm fromrowStateLabelturns the switcher test red. The rest of the suite is left to CI.Manual verification
The captures below were shot from the built SPA with every
/api/**call stubbed; the capture script fails unless each frame's claim is true in the DOM. Not verified against a live crew with an unmapped method, because no shipped gateway can produce one: that state is reachable only from a newer crew registry or a hand-edited record.Screenshots / video
Eight committed captures in
temp-screenshots/13337-unmapped-transport/, all shot atthis head from the built SPA by
website/scripts/capture-unmapped-transport.mjs,with every
/api/**call stubbed and the edge crew's connect answered with thegateway's 409. Each run fails unless what the frame claims is
true in the DOM: the unmapped switcher row reads
outboundand names no machine;the Settings row keeps its tunnel state and a primary Connect, carries no inline hint, and its badge title keeps the update hint; the pane shows its ordinary "Disconnected" and a primary Retry; and pressing Retry shows the gateway's own refusal exactly once, as readable text in the error notice.
Crew switcher, unmapped row (dark, light):
Pane after selecting the unmapped crew from the switcher: the ordinary disconnected pane (dark, light):
The same pane after pressing Retry: the gateway's 409
connection_method_unsupportedin the panel's error notice, the only place it is said (dark, light):Settings -> Remote Crew rows (dark, light):
Follow-up (r121 notes):
TransportPresentation.mappedis gone. It always equalledaddressField !== null, because every row in the table has an address field, so the two surfaces that read it (the tab bar subtitle and the viewport handoff) now testaddressFielddirectly and the doc comment says whatnullmeans. No behaviour change: the 12 test files that cover the presentation and both surfaces pass unchanged apart from the assertions on the removed field.Related Issues
Related to #13031 (outbound instance transport RFC), which the unmapped state prepares for. Gateway-side follow-up: #20250.
Pattern harvest
Pattern: a conditional chain over an enum whose last arm is a concrete member (
: 'ssh') silently absorbs every new member.Rule candidate: review-prompt -- flag a ternary/if-chain over
connection_method(or any registry-backed enum) whose fallback arm is one of the enum's own values instead of an explicit unmapped case.Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributed under the project's Apache-2.0 license.