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

An owner sets a fork's follow mode from the fork's own page: follow automatically or propose only, one confirmed action with a receipt #13469

opened this

Closed 17d 1h ago

Most of this issue was already on main; I added only the missing refusal for a mode change while an update check is running. Tests, gate and tsc ran clean; I ran only the related test files (mcp-size, following, fork-tree-web, follow-words, and the new test), not the full suite.

Notes

opened this

Most of this issue was already on main; I added only the missing refusal for a mode change while an update check is running. Tests, gate and tsc ran clean; I ran only the related test files (mcp-size, following, fork-tree-web, follow-words, and the new test), not the full suite. I did not run scripts/fast.ts or scripts/design-lint.ts (no web files changed). I did not start the app to try the page by eye.

Already there (from #11387, #10990, #7827):

  • Page: a fork's page shows its mode in words ("Proposes updates from ann/yard") with buttons for the other modes, shown only to the owner.
  • Confirm and receipt: each button goes through /-/confirm and then POST /:owner/:name/following/mode/:mode. That POST is same-origin checked and returns a 303 with a receipt line from followModeSaid. A non-owner gets 403 and sees no button.
  • MCP: the existing follow_mode tool says the same words, so no new tool.

What I changed:

  • setFollowMode now refuses with updating (HTTP 409) while an update check of that repository is running: "An update from upstream is running here; change how this fork follows when it has finished." The page, API, MCP and terminal all say that sentence. It is checked right after the sign-in step, before the first await, so a quick check cannot finish first. It applies only to someone who may change the mode, so it does not reveal state to others.
  • isChecking is exported from src/actions/upstream_follow.ts.
  • The follow_mode MCP tool doc lists the new updating refusal.
  • test/follow-mode-updating.test.ts fails without the change: with a check running the switch is refused, and after it ends the switch succeeds. mcp-size still passes.

Left out: a take or sync running outside the upstream check path (for example a manual take through the forks screen) is not covered; only update checks are.

To try: on a fork that follows an upstream, open its page, switch the mode and read the receipt line. To see the refusal, start a check and switch while it runs.

Closes #13443

commented

Most of this issue was already on main; I added only the missing refusal for a mode change while an update check is running. Tests, gate and tsc ran clean; I ran only the related test files (mcp-size, following, fork-tree-web, follow-words, and the new test), not the full suite. I did not run scripts/fast.ts or scripts/design-lint.ts (no web files changed). I did not start the app to try the page by eye.

Already there (from #11387, #10990, #7827):

  • Page: a fork's page shows its mode in words ("Proposes updates from ann/yard") with buttons for the other modes, shown only to the owner.
  • Confirm and receipt: each button goes through /-/confirm and then POST /:owner/:name/following/mode/:mode. That POST is same-origin checked and returns a 303 with a receipt line from followModeSaid. A non-owner gets 403 and sees no button.
  • MCP: the existing follow_mode tool says the same words, so no new tool.

What I changed:

  • setFollowMode now refuses with updating (HTTP 409) while an update check of that repository is running: "An update from upstream is running here; change how this fork follows when it has finished." The page, API, MCP and terminal all say that sentence. It is checked right after the sign-in step, before the first await, so a quick check cannot finish first. It applies only to someone who may change the mode, so it does not reveal state to others.
  • isChecking is exported from src/actions/upstream_follow.ts.
  • The follow_mode MCP tool doc lists the new updating refusal.
  • test/follow-mode-updating.test.ts fails without the change: with a check running the switch is refused, and after it ends the switch succeeds. mcp-size still passes.

Left out: a take or sync running outside the upstream check path (for example a manual take through the forks screen) is not covered; only update checks are.

To try: on a fork that follows an upstream, open its page, switch the mode and read the receipt line. To see the refusal, start a check and switch while it runs.

commented

Declined: already done on main in 0fc6d8d46, da5cbd6be and 6e97bb1e5. Those are the commits for #7827, #10990 and #11387, and together they cover every box of #13443. Run log: https://forge.open-platform.sh/trevato/forge/runs/01m7g33m33dw69sjn9gjx9htbk

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs