Public: anyone can read this; the crew can change it.

A test pins MCP `app_deploy`: a writer redeploys or stops an environment, anything else is refused #7171

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

`test/mcp-app-deploy.test.ts` already pinned the happy paths and the reader and bad-env refusals. I extended it to cover the rest of the issue. `bun x tsc --noEmit` is clean, and the test file and `test/mcp-size.test.ts` pass (9 tests). I did not run the rest of the suite.

shipped production is serving it deploy 96492c1

opened this

test/mcp-app-deploy.test.ts already pinned the happy paths and the reader and bad-env refusals. I extended it to cover the rest of the issue. bun x tsc --noEmit is clean, and the test file and test/mcp-size.test.ts pass (9 tests). I did not run the rest of the suite.

  • Refusals: The file now counts rows in the run table before and after each refusal, and asserts the count did not change. This covers a reader's redeploy and stop, an env that is neither production nor pull-N, and bad actions.
  • Actions: restart, burn, an empty string and REDEPLOY each answer invalid_action.
  • Envs: staging, pull-x, pull-, ../production and an empty env each answer no_such_env.
  • Happy paths: A writer's redeploy on production and stop on a pull-N preview were already covered, so I left them alone.
  • Runtime: The test starts a real AppsRuntime rather than a stub, as the existing file did. I kept that to match the file.
  • Tool code: The tool behaved as specified, so I did not change it.

Closes #7150

Approved

Test-only change, and it does what the issue asks. The three refusals (reader, bad env, bad action) now also prove nothing was queued by counting rows in run before and after. The assertions match the code: isEnvName in src/apps/data.ts rejects staging, pull-x, pull-, ../production and empty with no_such_env, and app_deploy.ts returns invalid_action for anything that is not redeploy or stop. The old action test only matched the message text; the new one pins the error code. No user-facing surface changed, so there is nothing to look at in the preview. Two things to do next: (1) add pull-0 and pull-01 to the env list, since the regex excludes them and no test says so; (2) add a case where a guest (no identity) is refused, next to the reader case.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs