Skip to content

[Refactor] Complete R_ prefix for remaining Roomote-owned env vars#274

Draft
roomote-roomote[bot] wants to merge 1 commit into
developfrom
roomote/r-env-var-completion
Draft

[Refactor] Complete R_ prefix for remaining Roomote-owned env vars#274
roomote-roomote[bot] wants to merge 1 commit into
developfrom
roomote/r-env-var-completion

Conversation

@roomote-roomote

Copy link
Copy Markdown
Contributor

Opened on behalf of Bruno Bergher. Follow up by mentioning @roomote-roomote, in the web UI, or in Slack.

Important

Roomote does not generally accept unsolicited community pull requests. Unless a maintainer invited this PR in an issue or discussion, it will likely be closed without review. A well-written issue is the best way to contribute.

Related issue

N/A — maintainer follow-up to complete the earlier R_* env-var consolidation.

Why this PR exists

  • A maintainer explicitly invited this PR in the linked issue or discussion
  • I am a maintainer / this is internal Roomote work

What changed

Finished aligning remaining Roomote-owned operator env vars with the R_* naming contract after the earlier consolidation left compute, preview, and non-GitHub source-control app settings on older names.

  • Renamed compute selection / Docker-and-Blaxel worker policy knobs: R_DEFAULT_COMPUTE_PROVIDER, R_EXCLUDED_COMPUTE_PROVIDERS, R_DOCKER_*, R_BLAXEL_STANDBY_*
  • Renamed core Roomote URLs and preview settings: R_TRPC_URL, R_PREVIEW_*
  • Renamed leftover Slack app / API-base / debug settings and the mock Telegram API base URL
  • Renamed non-token GitLab / Gitea / ADO / Bitbucket setup fields (base URL, OAuth, webhooks); left access tokens (GITLAB_TOKEN, etc.) unprefixed for sandbox tooling
  • Renamed GitHub automation skip + MCP server URL knobs, API timeout/retention knobs, and R_WORKER_RELEASE_*
  • Added 0010_more_canonical_r_env_vars.sql to rename stored deployment env-var rows (no dual-read aliases)
  • Updated setup catalogs, runtime consumers, deploy templates, docs, and tests

Left conventional infra (DATABASE_URL, S3_*, signing secrets), local-dev knobs (WEB_DEV_LOGIN_*), third-party compute SDK credentials (MODAL_*, E2B_*, …), and model API keys unprefixed.

Operators upgrading must switch platform/export env names to the new R_* forms; product behavior and third-party credential contracts are unchanged.

How it was tested

  • pnpm lint:fast
  • pnpm check-types:fast
  • pnpm knip (via pre-push)
  • Targeted Vitest: @roomote/env, @roomote/types compute/source-control/control-plane, @roomote/db compute-runtime-config, @roomote/slack api-base-url/web-client, @roomote/compute-providers factory, @roomote/gitlab + @roomote/gitea API tests

Checklist

  • The PR title follows the repo convention: [Fix], [Feat], [Improve], [Refactor], [Docs], or [Chore] followed by a user-facing description
  • This PR is small and scoped to one change
  • pnpm lint and pnpm check-types pass locally
  • I added tests or included a clear manual validation note above
  • I removed secrets, tokens, private keys, and customer data from code, logs, and screenshots
  • If this change should appear in the changelog, I ran pnpm changeset

Rename leftover operator-facing Roomote config (compute selection/Docker
worker policy, preview/tRPC URLs, Slack/source-control app settings, API
thresholds) to R_*, with a DB migration for stored deployment env vars.
@roomote-roomote

roomote-roomote Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

2 issues outstanding. See task

Reviewed the R_* env-var completion. The mechanical rename is consistent across the env schema, DB migration (safe — environment_variables.name is globally unique so the 1:1 renames can't collide), setup catalogs, runtime consumers, deploy files, docs, and tests. Two backward-compatibility gaps stand out on the upgrade/resume paths:

  • Highpackages/compute-providers/src/worker-env/base.ts:127: buildBaseWorkerEnv now injects only R_TRPC_URL and drops the legacy TRPC_URL, but it still keeps the ROOMOTE_APP_URL/ROOMOTE_APP_ENV legacy aliases for "sandboxes resumed from snapshots created before the R_* rename." Pre-rename worker builds require TRPC_URL at startup (old requiredVars = ['AUTH_TOKEN', 'TRPC_URL', 'R_APP_URL']), so a standby/snapshot worker created before this deploy will hard-fail on resume with the new launcher. Consider injecting TRPC_URL: Env.R_TRPC_URL (and optionally PREVIEW_PROXY_BASE_URL, though that one is only optional) alongside R_TRPC_URL until pre-rename snapshots age out, mirroring the ROOMOTE_APP_URL handling.
  • Mediumdeploy/scripts/upgrade.sh:123: previous_worker_image="$(read_env_value R_DOCKER_WORKER_IMAGE)" reads the new name, but a pre-rename .env only has DOCKER_WORKER_IMAGE, so previous_worker_image is empty on the first upgrade. The MODAL_BASE_IMAGE_REF auto-sync heuristic ([ "$modal_base_image_ref" = "$previous_worker_image" ]) then mis-detects the previously-synced ref as an operator override and leaves it pinned to the stale worker image. Additionally, the awk block no longer matches the old-named lines, so orphaned DOCKER_WORKER_IMAGE=, TRPC_URL=, and DOCKER_WORKER_RELEASE_PATH= entries are left behind in .env. Consider falling back to the old name when reading previous_worker_image (and stripping the old-named lines) for the transition upgrade.

Reviewed a049d54

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Before we can merge this pull request, we need you to sign our Contributor License Agreement. You can sign it by posting the comment below.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

Comment thread packages/env/src/index.ts
if (!env.SLACK_AUTH_URI && env.R_APP_URL) {
env.SLACK_AUTH_URI = `${env.R_APP_URL.replace(/\/+$/, '')}/api/slack/auth`;
if (!env.R_SLACK_AUTH_URI && env.R_APP_URL) {
env.R_SLACK_AUTH_URI = `${env.R_APP_URL.replace(/\/+$/, '')}/api/slack/auth`;
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