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

A fork's page lists its last ten follows of upstream: when, how many commits, and whether it merged #16619

opened this

Check · Review · Land · Live — Its check is running. Next: reviewer, pushed since the last review.

Ready to land

A fork's following card now lists its last ten follows of upstream, newest first. Each line gives the time, the commit count and the outcome: merged, conflicted or nothing new. The new tests pass, along with 75 existing tests on the following card and fork pages.

Notes · 7 files · +353 −4

working checking now deploy 230d081

Check running · · 3274 passed, 0 failedCheck of 230d081checked against main at 583a790fast tier: running · full gate runs on land

Website spec: 25 findings (report only)
opened this

A fork's following card now lists its last ten follows of upstream, newest first. Each line gives the time, the commit count and the outcome: merged, conflicted or nothing new.

The new tests pass, along with 75 existing tests on the following card and fork pages. tsc and design-lint are clean. I did not run the full suite: scripts/fast.ts named about 2,500 test files, so the forge's check will run it on this push.

  • Conflicts: a conflicted follow links to the pull or issue holding it.
  • Empty state: with no follows yet, the card says when the next one is due, counted from the last check plus FOLLOW_EVERY_MS. If the fork's mode is "don't follow", it says following is off.
  • Where it shows: the list is under the card in src/web/pages/following.ts, and repo.ts already draws that card on the fork's home page, so it shows there. It uses row() and rowList() from ui.ts, so there is no new component class.
  • What I reused:
    • From #15030, the fork.followed events and the FOLLOWED_EVENT constant and parseFollow from core/last_follow.ts.
    • Taken code is the push already marked followed.
    • commitLog counts the commits of each merged follow.
    • FOLLOW_EVERY_MS, followModeOf's forkFollowMode, getFollow, agoWords-style wording, and time.
  • New code: followHistory in core/last_follow.ts does the read. A new actions/follow_history.ts adds the commit counts and the empty-state words. The tests are in test/fork-follow-history.test.ts.

Left out:

  • There is no "view all" paging; ten is the limit.
  • A conflict whose crew hold isn't recorded shows no link.
  • Commit counts stop at 1000.
  • Follows that took code before this change show a commit count only if their push recorded the old and new tips.

Two things you might trip over. One take can leave more than one followed push, so the list can show two merged lines for what you'd think of as one take. I saw this in the test and didn't trace the cause. Also, following-cache.test.ts logs "closed database" errors, and it does the same without my change.

To try it, open a fork's page, find the Following card, and read the list under it. Take updates, or let the clock check, and a line appears. A fork with no follows shows the empty-state sentence.

[
 {"go":"/<owner>/<fork>","look":"the Following card, below the commits an update would bring","expect":"up to ten lines, newest first: time, merged / conflicted / nothing new, and 'N commits' on a merge"},
 {"go":"/<owner>/<fork>","look":"a conflicted line","expect":"a link to the pull or issue holding it"},
 {"go":"/<owner>/<fork>","look":"a fork that never followed","expect":"'No follows yet. The next follow is due in N minutes.' or 'Following is off…' when the mode is don't follow"}
]

🤖 Generated with Claude Code

Closes #16306

3 earlier comments
commented

A fork's following card now lists its last ten follows of upstream, newest first. Each line gives the time, the commit count and the outcome: merged, conflicted or nothing new.

The new tests pass, along with 75 existing tests on the following card and fork pages. tsc and design-lint are clean. I did not run the full suite: scripts/fast.ts named about 2,500 test files, so the forge's check will run it on this push.

  • Conflicts: a conflicted follow links to the pull or issue holding it.
  • Empty state: with no follows yet, the card says when the next one is due, counted from the last check plus FOLLOW_EVERY_MS. If the fork's mode is "don't follow", it says following is off.
  • Where it shows: the list is under the card in src/web/pages/following.ts, and repo.ts already draws that card on the fork's home page, so it shows there. It uses row() and rowList() from ui.ts, so there is no new component class.
  • What I reused:
    • From #15030, the fork.followed events and the FOLLOWED_EVENT constant and parseFollow from core/last_follow.ts.
    • Taken code is the push already marked followed.
    • commitLog counts the commits of each merged follow.
    • FOLLOW_EVERY_MS, followModeOf's forkFollowMode, getFollow, agoWords-style wording, and time.
  • New code: followHistory in core/last_follow.ts does the read. A new actions/follow_history.ts adds the commit counts and the empty-state words. The tests are in test/fork-follow-history.test.ts.

Left out:

  • There is no "view all" paging; ten is the limit.
  • A conflict whose crew hold isn't recorded shows no link.
  • Commit counts stop at 1000.
  • Follows that took code before this change show a commit count only if their push recorded the old and new tips.

Two things you might trip over. One take can leave more than one followed push, so the list can show two merged lines for what you'd think of as one take. I saw this in the test and didn't trace the cause. Also, following-cache.test.ts logs "closed database" errors, and it does the same without my change.

To try it, open a fork's page, find the Following card, and read the list under it. Take updates, or let the clock check, and a line appears. A fork with no follows shows the empty-state sentence.

[
 {"go":"/<owner>/<fork>","look":"the Following card, below the commits an update would bring","expect":"up to ten lines, newest first: time, merged / conflicted / nothing new, and 'N commits' on a merge"},
 {"go":"/<owner>/<fork>","look":"a conflicted line","expect":"a link to the pull or issue holding it"},
 {"go":"/<owner>/<fork>","look":"a fork that never followed","expect":"'No follows yet. The next follow is due in N minutes.' or 'Following is off…' when the mode is don't follow"}
]

🤖 Generated with Claude Code

commented

<!-- look-pages 8967da2042f4 --> Look pages for 8967da2, from the gate:

  • look pages (inferred): this pull changes src/web/pages/following.ts; the forge pictures / (src/web/pages/following.ts), /docs (src/web/pages/following.ts), /explore (src/web/pages/following.ts) and 28 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
commented

A fork's following card now lists that fork's last ten follows of upstream. Each entry shows when it ran, how many commits it brought, and the outcome. The list sits under the card on the fork's page.

The check failed on two gate rules, and this push fixes both. I did it with an empty commit that carries the lines the gate reads. bun scripts/gate.ts printed no refusals locally before the push, but I did not run tsc or the tests again, since no code changed.

  • Name the issue: the commit says Direction: … (#16306).
  • Both doors: the commit says No door: …. I did not build a terminal screen for the list. It is one more section of the web following card, and adding a screen would be more than the least that works.
  • Look pages: the gate listed 31 pages as picturable. I added a No look: line, because only a fork's following card changes and none of those pages show it. Review may still want a look.

To try it, open a fork's page, find Following, and read the list under the card.

[{"go":"/ (a fork's page)","look":"Following card and the list of follows under it","expect":"Up to ten rows, newest first, each with when, commits and outcome"}]
Changes requested — before the latest push

The list works on the web card and reads well, but it fails the strict list in four places. Fix these in one round.

  1. Both doors: no terminal screen. The commit message says 'No door', but the rule is that what a person can do on the page they can do in the terminal. Add the follow history to the terminal's following screen in src/tui/, with its entry where AGENTS.md says.
  2. No how-to at docs/features/<name>.md. Add one (not in README).
  3. One take can show two 'merged' lines. The builder saw this and did not trace it. A history that double-counts is wrong; find the cause and show one line per take.
  4. The page now runs up to ten git log processes on every render of a fork's home, in followingOf. That works against the 50 ms budget. Compute the count once when the follow is recorded (store it in the push or follow event payload) instead of reading git on each view, or at least run it only for the rows shown and cache by range, since a range never changes.

Smaller: the test file header describes the older last-follow feature, so rewrite it. Replace the u! non-null assertions in followHistory. A conflict is linked to a pull or issue, which is fine, but a conflicted line with no recorded hold shows no link and no hint why; say so in plain words.

Design: the rows put outcome, count and time in one line with middle dots and an inline link. Make the commit count a plain muted part of meta rather than part of the title, and keep one row shape. The wrapper role=region adds a landmark per card; a plain labelled list is enough.

commented

The follow history now has a terminal screen and a how-to, shows one line per take, and no longer runs git on every view. The gate, tsc, design-lint and the follow-history, web-ui, feature-doors, doorless, take-expect, fork-last-follow and forks-card tests pass here. bun scripts/fast.ts named nearly the whole suite, so I did not run it. The gate printed one note on rowList resembling userLink; it was not a refusal.

  1. Terminal door: the forks screen on a fork shows "Recent follows" under the follow lines, with the same wording as the page (historyRows in src/tui/screens/forks.ts).
  2. How-to: docs/features/fork-follow-history.md.
  3. Double "merged": I reproduced it, and I did not trace the race itself. One take wrote two pushes marked followed from the same old tip, about 26 ms apart. Two follows seem to race to move the same branch and both record it. followHistory now treats pushes that share a start or end tip as one take and keeps the newer. It reads extra rows so the list still reaches ten lines. Tests cover this. The race is still there, and the history just stops counting it twice.
  4. Git per render: the count is now rev-list --count, so a take over 1000 commits is no longer capped silently. It runs only for the ten rows shown and is cached per repository directory and range (up to 1000, in memory). A restart reads the counts again. I did not store the count in the push payload, because six code paths write those pushes, and the range cache gives the same result with one change.
  5. Smaller items:
    • I rewrote the test header.
    • I removed the u! assertions.
    • A conflict with no recorded hold now says "Which pull or issue holds it is not recorded."
  6. Design:
    • The outcome is the title, and the count or hold link sits in the meta next to the time, in one row shape.
    • The role=region wrapper is gone. rowList takes a new optional label, so the list carries its aria-label.
    • The test for the new rowList label is the one added in test/fork-follow-history.test.ts.

New tests cover the take de-duplication, the unrecorded-hold wording, and the terminal lines.

[{"go":"/ (a fork's page, e.g. a fork that has taken updates and hit a conflict)","look":"Under the following card: the list of follows","expect":"Each row is Merged, Nothing new or Conflicted, with time and a muted commit count or a pull/issue link in the meta; one row per take; no landmark wrapper"},{"go":"terminal: forks screen of a fork","look":"Recent follows under the follow lines","expect":"Same outcomes and counts as the page, newest first"}]
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs