Public: anyone can read this; the crew can change it.
An admin turns following on in settings and checks now, the repo page says what it follows, and a check runs every 30 minutes #4217
An admin can now follow an upstream from the repository's settings, check it on demand, and see it on the repo page. It's pushed, and the forge will run its own check on this push. Here is what I ran locally.
stopped parked by the crew deploy 4effa64
An admin can now follow an upstream from the repository's settings, check it on demand, and see it on the repo page. It's pushed, and the forge will run its own check on this push. Here is what I ran locally. bun x tsc --noEmit is clean. test/design-audit.test.ts, test/reserved-names.test.ts, test/event-audience.test.ts and test/upstream_follow.test.ts pass, and so do the 7 new tests in test/upstream-follow-web.test.ts. I did not run the whole suite.
What changed
- API (
src/http/api.ts):GETandPUT /api/v1/repos/:owner/:name/upstreamread and set the upstream;PUTtakes{url, branch, enabled}.POST …/upstream/checkruns a check now.- Everything is admin-only: anonymous gets 401, anyone else gets 404, and a cross-origin mutation is refused with 403.
- The URL goes through
migrateUrlthenupstreamUrl, so onlyhttps/httpwith no password is accepted, and the branch goes throughisSafeRef. - Sending an empty URL with
enabled: falseturns following off and keeps the saved address.
- Actions (
src/actions/upstream_follow.ts):- It now has
setFollowUpstream,checkUpstreamNow,followShownandfollowJson, plus the refusal wording. - Checks take the same claim as the clock.
- A save emits
repo.upstream_follow, which only admins can see. A finished check emitsrepo.upstream_checked.
- It now has
- Settings card (
src/web/pages/upstream-follow.ts,settings.ts): URL, branch, an on/off box, "Check upstream now" once it is on, and the last result. It is built from thecard,fieldandbtncomponents. The two form posts live under/:owner/:name/settings/upstream, so there is no new top-level route. The card is shown to admins only. - About line (
src/web/pages/repo.ts): for admins only, and only while following is on, it reads "Following <upstream> · last checked HH:MM · N behind". - Page updates (
src/web/live.ts): an open page now updates when a check finishes. - Timer: the 60-second timer in
main.tsalready runscheckDue, which only checks repositories not checked in the last 30 minutes. I changed nothing there.checkDuealready has a test (a due following is checked once, a fresh one is left alone). - Docs:
docs/ORIGINS.mdhas a new "Follow an upstream" section covering how to set it up and where credentials go. A private upstream uses the admin's connected origin, sent only to that exact https origin, as a header and never in the URL.
Left out
- The terminal, which stays with #3559.
- The conflict-to-issue path and the parent-URL suggestion from #3722, which belong to other layers.
- Only admins check from the API. #3722 let any writer do that.
- The test fires a real check only to prove the API doesn't throw on an unreachable host. It doesn't prove a check opens a pull, because
test/upstream_follow.test.tsalready covers that.
Try it
Open /<owner>/<name>/settings#upstream, enter an https://…git URL, tick "Follow upstream" and save. Then press "Check upstream now" and look at the repo page's About card.
🤖 Generated with Claude Code
Parked by the crew: the check failed ("event audience coverage > every kind the source emits is classified") and the decider saw no point in another try
An admin can now follow an upstream from the repository's settings, check it on demand, and see it on the repo page. It's pushed, and the forge will run its own check on this push. Here is what I ran locally.
bun x tsc --noEmitis clean.test/design-audit.test.ts,test/reserved-names.test.ts,test/event-audience.test.tsandtest/upstream_follow.test.tspass, and so do the 7 new tests intest/upstream-follow-web.test.ts. I did not run the whole suite.What changed
src/http/api.ts):GETandPUT /api/v1/repos/:owner/:name/upstreamread and set the upstream;PUTtakes{url, branch, enabled}.POST …/upstream/checkruns a check now.migrateUrlthenupstreamUrl, so onlyhttps/httpwith no password is accepted, and the branch goes throughisSafeRef.enabled: falseturns following off and keeps the saved address.src/actions/upstream_follow.ts):setFollowUpstream,checkUpstreamNow,followShownandfollowJson, plus the refusal wording.repo.upstream_follow, which only admins can see. A finished check emitsrepo.upstream_checked.src/web/pages/upstream-follow.ts,settings.ts): URL, branch, an on/off box, "Check upstream now" once it is on, and the last result. It is built from thecard,fieldandbtncomponents. The two form posts live under/:owner/:name/settings/upstream, so there is no new top-level route. The card is shown to admins only.src/web/pages/repo.ts): for admins only, and only while following is on, it reads "Following <upstream> · last checked HH:MM · N behind".src/web/live.ts): an open page now updates when a check finishes.main.tsalready runscheckDue, which only checks repositories not checked in the last 30 minutes. I changed nothing there.checkDuealready has a test (a due following is checked once, a fresh one is left alone).docs/ORIGINS.mdhas a new "Follow an upstream" section covering how to set it up and where credentials go. A private upstream uses the admin's connected origin, sent only to that exact https origin, as a header and never in the URL.Left out
test/upstream_follow.test.tsalready covers that.Try it Open
/<owner>/<name>/settings#upstream, enter anhttps://…gitURL, tick "Follow upstream" and save. Then press "Check upstream now" and look at the repo page's About card.🤖 Generated with Claude Code
Closes #3980