feat: environments can inherit the deployment compute and source-control providers for nested Roomote - #2181
feat: environments can inherit the deployment compute and source-control providers for nested Roomote#2181mrubens wants to merge 5 commits into
Conversation
|
2 issues outstanding. See task
Reviewed 1849406 |
Local end-to-end verificationRan Roomote-on-Roomote locally against this branch: outer deployment on the managed provider (Modal backend), an environment definition equal to What the outer sandbox saw:
What the nested Roomote did:
Two fixes came out of the run:
|
|
@roomote-community the last sync review posted "No new code issues found" but the check run ended as "review result unavailable". Please re-review the current head. |
|
I started a PR review task for this request. See task |
| DEFAULT_COMPUTE_PROVIDER: input.provider, | ||
| }; | ||
|
|
||
| for (const field of descriptor.fields) { |
There was a problem hiding this comment.
descriptor.fields is not the full set of runtime values used to launch a provider. For Modal, the nested controller also reads MODAL_ENDPOINT, MODAL_ENVIRONMENT, MODAL_REGISTRY_USERNAME/MODAL_REGISTRY_PASSWORD, and ECR settings directly from Env (see RoomoteController.spawnFreshWorker). None are setup-catalog fields, so an opted-in deployment using a custom endpoint or private/ECR-backed worker image loses required launch configuration in the nested controller. Forward the complete provider launch configuration, including the paired registry/ECR values, rather than only catalog fields.
| ): Record<string, string> | null { | ||
| const env: Record<string, string> = {}; | ||
|
|
||
| for (const descriptor of SETUP_SOURCE_CONTROL_PROVIDER_CATALOG) { |
There was a problem hiding this comment.
This treats Azure DevOps delegated configuration as forwardable, but ADO_LINKED_ACCOUNT_ID only identifies an authAccounts row in the outer deployment database. The nested Roomote has a different database, so resolveAdoDelegatedToken() finds no access/refresh token and createTaskRunAdoCredentials() fails. Skip delegated ADO from this inheritance mode (or pass a scoped credential through a mechanism that can actually be refreshed); copying its env fields cannot make the provider usable.
What changed
Environment definitions gain two opt-in flags:
inherit_compute: trueforwards the deployment's default compute provider and that provider's setup-catalog values.inherit_source_control: trueforwards every fully configured source-control provider's setup-catalog values (for GitHub: App slug, App ID, private key, OAuth client id and secret, webhook secret). Partially configured providers are skipped.Both are resolved at dequeue the way the control plane resolves them (validated
Envfirst, then the encrypted deployment env) and travel under a single launcher-only name,R_NESTED_DEPLOYMENT_ENV. The worker expands that value into the real names for the nested environment env only, and drops the raw value from the worker runtime env, the harness process env, and every shell file, including the snapshot bootstrap path.Local Docker is never forwarded (it needs the host socket).
R_NESTED_DEPLOYMENT_ENVis added to the control-plane reserved set so operators cannot store it by hand, and it is stripped from ordinary repository tasks.The repo's own
.roomote/environments/roomote.yamlopts into both flags and exposes the nested API on an unproxiedapiport (13001). The controller command in that definition already readsROOMOTE_API_HOSTforTRPC_URL, so sandboxes spawned by the nested controller can reach the nested API directly.Docs, the YAML serializer, and the environment preview cover both fields.
Why this change was made
Every compute credential and source-control app secret is in
CONTROL_PLANE_ENV_VAR_NAMES, soredactControlPlaneEnvVarsstrips it before any sandbox sees it, and the controller-side worker env filter drops every*_SECRET. That is the right default, but it means a Roomote instance running inside a Roomote environment (Roomote-on-Roomote) can run Fast sessions yet cannot launch a coding task: its controller boots with no provider credentials, and even once it can spawn a sandbox, it cannot mint a repo token for the nested worker.The GitHub App fields cannot be entered in the nested instance either, short of re-running its setup wizard on every outer task. PR #2154 and #2155 built the equivalent pass-through for model settings; this is the compute and source-control counterpart, made explicit per environment rather than blanket.
Impact
Verification
pnpm lint,pnpm check-types:fast,pnpm knippass.@roomote/types(compute and source-control builders, merge, parser, schema, reserved-name wiring),@roomote/sdk(compute forward, source-control forward with a partial provider skipped, both flags merged, opt-out, non-nestable provider, operator-stored value stripped),@roomote/worker(expansion into the nested env only, runtime-env and harness-env cleanup, shell omission, snapshot bootstrap),@roomote/web(YAML round-trip), and the@roomote/dbdeclarative-environments test that validatesroomote.yaml.inherit_source_controladdresses.