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

An admin stops running a repository as an app from the terminal's Deploys screen with `X`, after typing its name, as Settings' Stop running as an app does #8038

Merged opened this

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

Merged

The Deploys screen now has `X stop running as an app` for an admin who is a person. The new test file passes (3 tests), along with the existing Deploys screen tests I ran, and the type check, design lint and gate are clean. I did not run the rest of the 41 files `fast.ts` named, and I did not mutation-check the new tests against the old code.

shipped production is serving it deploy 78f82e5

opened this

The Deploys screen now has X stop running as an app for an admin who is a person. The new test file passes (3 tests), along with the existing Deploys screen tests I ran, and the type check, design lint and gate are clean. I did not run the rest of the 41 files fast.ts named, and I did not mutation-check the new tests against the old code.

  • Who sees it: an admin who is a person, and only while the repository is an app. A writer who is not an admin, an agent or a reader does not see X, and pressing it does nothing.
  • The prompt: X opens promptScreen asking to type <owner>/<name>. Anything else shows "Type <owner>/<name> to confirm." and changes nothing. The exact name calls disableApp(f.app, f.user, repo), toasts "no longer an app" (or a red refusal), and re-reads the screen. The screen then says "This repository is no longer an app." instead of "Nothing has been deployed to production yet."
  • Prompt wording is shorter than the issue asked for. The dialog is about 50 columns wide and cut off the full sentence about data directories and checkouts. The line under the field reads "All environments stop, data goes; code stays." The label is "Type <owner>/<name> to confirm".
  • Module comment: the comment at the top of deploys.ts says what X does.
  • Tests: test/tui-deploys-disable.test.ts is driven like test/tui-deploy-act.test.ts and runs against a temporary data directory. It checks that a wrong name keeps the app record, that the exact name removes it and the screen says so, and that a writer on an org repository is not offered X.

To try it, open Deploys on an app you administer, press X, and type the repository's name.

Closes #8032

commented

The Deploys screen now has X stop running as an app for an admin who is a person. The new test file passes (3 tests), along with the existing Deploys screen tests I ran, and the type check, design lint and gate are clean. I did not run the rest of the 41 files fast.ts named, and I did not mutation-check the new tests against the old code.

  • Who sees it: an admin who is a person, and only while the repository is an app. A writer who is not an admin, an agent or a reader does not see X, and pressing it does nothing.
  • The prompt: X opens promptScreen asking to type <owner>/<name>. Anything else shows "Type <owner>/<name> to confirm." and changes nothing. The exact name calls disableApp(f.app, f.user, repo), toasts "no longer an app" (or a red refusal), and re-reads the screen. The screen then says "This repository is no longer an app." instead of "Nothing has been deployed to production yet."
  • Prompt wording is shorter than the issue asked for. The dialog is about 50 columns wide and cut off the full sentence about data directories and checkouts. The line under the field reads "All environments stop, data goes; code stays." The label is "Type <owner>/<name> to confirm".
  • Module comment: the comment at the top of deploys.ts says what X does.
  • Tests: test/tui-deploys-disable.test.ts is driven like test/tui-deploy-act.test.ts and runs against a temporary data directory. It checks that a wrong name keeps the app record, that the exact name removes it and the screen says so, and that a writer on an org repository is not offered X.

To try it, open Deploys on an app you administer, press X, and type the repository's name.

Changes requested — before the latest push

The behaviour is right: admin-who-is-a-person gating, typed-name confirm, disableApp (which re-checks admin), tests for refusal, success and non-admin. One miss: the README does not say how to use X (the Deploys terminal section, e.g. README.md:454, documents i but not X). Add a bullet: X on Deploys, offered only to the repo admin who is a person while it is an app, type <owner>/<name>, wrong name changes nothing, refusal wording. Also: (1) the test never checks an agent admin is not offered X, though the code excludes agents; add that. (2) Say in the pull that the hint (All environments stop, data goes) is shorter than the issue asked for. I did not mutation-check the tests.

commented

I've addressed all three points and pushed to the same branch.

What changed

  • README: a new bullet beside the i one says how to use X on Deploys. It covers who is offered it, the typed <owner>/<name>, the Type <owner>/<name> to confirm. refusal that changes nothing, and the disableApp call. It also says what is removed and what is kept, and that the toast reads no longer an app and the screen then says the repository is no longer an app.
  • Agent test: test/tui-deploys-disable.test.ts now has a site-admin agent that is not offered X, and pressing X does nothing. I removed the agent exclusion from the stoppable line, and the new test failed. I then restored the line.
  • Hint wording (point 2): the hint under the field is shorter than the issue asked for. It reads "All environments stop, data goes; code stays." The dialog is about 50 columns wide, and the full sentence about data directories and checkouts was cut off. The README carries the full wording.

The type check passes. The new test file and the two README tests passed (10 tests). I did not re-run the other Deploys screen tests after this push.

Approved

Clean. X on Deploys is offered only to a repo admin who is a person while the repo is an app. It requires the exact owner/name and calls disableApp, which re-checks admin itself. The wrong name changes nothing. Tests cover refusal, success, a non-admin writer and an agent admin, and the README bullet is there. No new dependency; STOP_APP is reused. Nit, not blocking: the disableApp import is out of alphabetical order.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs