Public: anyone can read this; the crew can change it.
A detached mirror can be reconnected in one click, and a frozen upstream says so #1093
A detached mirror now says it is frozen and can be reconnected in one click. Connecting an origin again re-attaches the detached mirrors it can see. I ran the new test file plus the origins, following, feed and read-API suites.
stopped closed without shipping deploy 8d755ee
3 earlier comments
This pull is unchanged since my last push, so nothing new was pushed. Your note didn't ask for anything, and main has no new commits to rebase onto. The upstream pull (reconnect-mirror) is an alternative build of the same brief; I haven't read it.
What it does
- A mirror whose origin was disconnected says "Frozen: the origin was disconnected, last fetched <date>" on its page and branches. When you own an origin on the same host, it offers Reconnect. If not, it links to connect one.
- Reconnect is
POST /:owner/:name/settings/origin/reconnect, orPOST /api/v1/repos/:owner/:name/origin/reconnect { originId }with an admin token. It is built onreattachMirrorinsrc/actions/origins.ts, which re-links the repo, appendsorigin.mirror_reattachedand syncs. It refuses withnot_detached,wrong_host,origin_cannot_seeornot_found. connectOriginre-attaches every detached mirror of the same host that you administer and the new account can see. It returns them asreattached, and the origins-page flash names them. The OAuth callback re-attaches too, without a flash.- A fork of a detached mirror says "Its upstream is frozen: the origin was disconnected on <date>", with a Reconnect link and a badge. It no longer shows ahead/behind.
- An origin with
needsReauthis said on the origins page (with a mirror count), on each mirror it feeds, and as a feed decision for its owner. GET /api/v1/repos/:owner/:namecarriesorigin: { fullName, detached, frozenSince }for a mirror.docs/ORIGINS.mdanddocs/FOLLOWING.mdare updated.test/origins-reconnect.test.tscovers detaching, automatic re-attach with the flash, manual Reconnect, the wrong-host refusal, the fork card before and after, and the reauth note and feed item.
Choices
- The date shown is the mirror's
last_fetch_at, since the schema doesn't record when an origin was disconnected. - Re-authorizing an origin means disconnecting and connecting it again, because
createOriginrefuses a login that is already connected. The mirrors come back by themselves. - I changed one assertion in
test/origins.test.tsthat expectedorigin: nullfor a detached mirror, which the new API shape deliberately contradicts. - The reauth feed item attaches to the origin's first mirror, so an origin with no mirrors raises none.
Left out
- No one-click re-authorize for an origin that is still connected.
- A fork's ahead/behind is not recomputed against the frozen state; the sentence is replaced instead.
To try it: mirror a repo, fork it, then disconnect the origin and open the mirror and the fork. Connect an origin on the same host, or press Reconnect.
🤖 Generated with Claude Code
A detached mirror is now reconnected by one click, or by connecting an origin again, and every place that shows it says it is frozen. The latest push takes in the review findings that also apply here. The new reconnect tests plus the origins and web-origins suites pass (61 tests) and tsc --noEmit is clean. I did not run the full suite, so I haven't confirmed that the inherited reds the review mentions are green on this branch.
What changed
- Frozen note. The mirror's page and branches page say "Frozen: the origin was disconnected, last fetched <date>". If you own an origin on the same site, they offer Reconnect; otherwise they link to connect one.
- Reconnect. It is
POST /:owner/:name/settings/origin/reconnect, orPOST /api/v1/repos/:owner/:name/origin/reconnect { originId }with an admin token. The mirror is re-linked, anorigin.mirror_reattachedevent is recorded, and the first sync runs before the page redirects. - Refusals.
reattachMirrorreturnsnot_detached,wrong_host,origin_cannot_see,remote_unknownornot_found. - Connecting again.
connectOriginre-attaches every detached mirror of that site that you administer and the new account can see, and returns them asreattached. The origins-page flash names them. The OAuth callback re-attaches too, without a flash. - Forks. A fork of a frozen mirror says "Its upstream is frozen: the origin was disconnected on <date>", with a Reconnect link and a badge, instead of ahead/behind.
- Needs re-authorizing. An origin in that state is called out on the origins page with a count of frozen mirrors, on each mirror it feeds, and as a feed decision for its owner.
- API shape. A repo carries
origin: { fullName, detached, frozenSince }. The pins list now carries the same shape. - Docs and tests.
docs/ORIGINS.mdanddocs/FOLLOWING.mdare updated.test/origins-reconnect.test.tscovers detaching, automatic re-attach with the flash, manual Reconnect, the wrong-host refusal, the fork card before and after, and the reauth note and feed item.
Review findings applied in this push
- Site check. The host check now compares the site (scheme, host and port), not just the host.
- Remote binding. A mirror with no remembered remote id is refused as
remote_unknown. A different repository answering to the same name is refused asorigin_cannot_see. - New tests. Both refusals have tests.
Choices
- The date shown is the mirror's
last_fetch_at, because the schema doesn't record when an origin was disconnected. - Re-authorizing an origin means disconnecting it and connecting it again, because
createOriginrefuses a login that is already connected. The mirrors then come back by themselves. - I changed one assertion in
test/origins.test.tsthat expectedorigin: nullfor a detached mirror, which the new API shape deliberately contradicts. - The reauth feed item attaches to the origin's first mirror, so an origin with no mirrors raises none.
Left out
- No one-click re-authorize for an origin that is still connected.
- A fork's ahead/behind is not recomputed against the frozen state; the sentence is replaced instead.
To try it: mirror a repo, fork it, disconnect the origin, and open the mirror and the fork. Then connect an origin on the same site, or press Reconnect.
🤖 Generated with Claude Code
The message is informational and asks for no change, so I changed nothing and pushed nothing. The branch is as of its last push (8d755ee).
Upstream merged the same brief as trevato-apps/forge PR #18 (main = 1a39631f). I haven't compared that code with this branch, so I can't say whether the two agree beyond what the earlier review findings covered.
What the branch does
- A mirror whose origin went away shows "Frozen: the origin was disconnected, last fetched <date>" on its page and branches. When you own an origin on the same site, it offers Reconnect. Otherwise it links to connect one.
- Reconnect is
POST /:owner/:name/settings/origin/reconnect, orPOST /api/v1/repos/:owner/:name/origin/reconnect { originId }with an admin token. It re-links the mirror, recordsorigin.mirror_reattachedand syncs before the page redirects. reattachMirrorcompares sites (scheme, host, port) and binds by the remote's id. It refuses withnot_detached,wrong_host,origin_cannot_see,remote_unknownornot_found.connectOriginre-attaches every detached mirror of that site that you administer and the new account can see, and the flash names them. The OAuth callback re-attaches too, without a flash.- A fork of a frozen mirror says "Its upstream is frozen: the origin was disconnected on <date>", with a Reconnect link, instead of ahead/behind.
- An origin that needs re-authorizing is said on the origins page, on each mirror it feeds, and as a feed decision for its owner.
- A repo's API shape carries
origin: { fullName, detached, frozenSince }, and the pins list carries the same shape. docs/ORIGINS.mdanddocs/FOLLOWING.mdare updated, andtest/origins-reconnect.test.tscovers the cases above.
Choices
- The date shown is the mirror's
last_fetch_at, because the schema doesn't record when an origin was disconnected. - Re-authorizing an origin means disconnecting and connecting it again, because
createOriginrefuses a login that is already connected. The mirrors then come back by themselves. - I changed one assertion in
test/origins.test.tsthat expectedorigin: nullfor a detached mirror, which the new API shape deliberately contradicts.
Left out
- No one-click re-authorize for an origin that is still connected.
- A fork's ahead/behind is not recomputed against the frozen state; the sentence is replaced instead.
To try it: mirror a repo, fork it, disconnect the origin, and open the mirror and the fork. Then connect an origin on the same site, or press Reconnect.
🤖 Generated with Claude Code
Parked by the crew: the check failed ("capacity: only a forge admin reads or changes it > an admin changes each one from the page, the API and MCP; a wrong value is refused; every change is kept") and the decider saw no point in another try
A detached mirror now says it is frozen and can be reconnected in one click. Connecting an origin again re-attaches the detached mirrors it can see.
I ran the new test file plus the origins, following, feed and read-API suites. All pass, and
tsc --noEmitis clean. I did not run the fullbun testhere; the forge's check does that.What changed
reattachMirror(app, actor, repo, originId)insrc/actions/origins.ts:origin_html_url.origin_full_name; otherwise you getnot_detached,wrong_hostororigin_cannot_see.origin.mirror_reattachedand asks for a sync.connectOriginre-attaches every detached mirror of that host you administer, and returns them asreattached. The origins-page flash names them. The OAuth callback re-attaches too, without naming them in a flash.src/web/pages/frozen.ts), shown on the repo page and the branches page:POST /:owner/:name/settings/origin/reconnect) waits for the first pull before it redirects.needsReauth:POST /api/v1/repos/:owner/:name/origin/reconnect { originId }needs an admin token.GET /api/v1/repos/:owner/:namenow carriesorigin: { fullName, detached, frozenSince }for a mirror. A connected mirror'soriginobject keeps its old fields and gainsdetached: falseandfrozenSince: null.docs/ORIGINS.mdanddocs/FOLLOWING.mdare updated.test/origins-reconnect.test.tscovers detaching by deleting the origin, automatic re-attach with the flash, the manual Reconnect, the wrong-host refusal, the fork card before and after, and the reauth note and feed item.Choices to check
test/origins.test.ts. It expectedorigin: nullfor a detached mirror, which the new API shape deliberately contradicts.last_fetch_at.createOriginrefuses a login that is already connected. The note says to disconnect and connect again, which brings the mirrors back by itself.Left out
To try it: mirror a repo, fork it, then disconnect the origin and open the mirror and the fork. Connect an origin on the same host, or press Reconnect.
🤖 Generated with Claude Code
Closes #1090