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

A public repository's ships and a person's public posts each have an Atom feed, linked from the page #12451

opened this

Merged 18d 14h ago, live in production

Repositories now have /{owner}/{name}/ships.atom and people have /{owner}.atom, and each page advertises its feed with an Atom . The new tests, tsc, gate.ts and design-lint pass. I ran the related atom, route-mark and layout tests rather than the whole suite, because fast.ts named 2160 files.

Notes

opened this

Repositories now have /{owner}/{name}/ships.atom and people have /{owner}.atom, and each page advertises its feed with an Atom <link rel="alternate">. The new tests, tsc, gate.ts and design-lint pass. I ran the related atom, route-mark and layout tests rather than the whole suite, because fast.ts named 2160 files. I did not try the feeds on the deployed preview.

  • Ships feed: it lists the newest 30 merged pulls (title, link, merge time, author), newest merge first, and sealed security reports are never listed. A private repo, or one that doesn't exist, answers 404 to a stranger.
  • Person feed: it lists the newest 30 issues the person opened on repositories a stranger may read, with private and sealed ones left out. I took "public posts" to mean issues only. Tells, comments and shares are left out.
  • Both feeds: text is XML-escaped and each carries an ETag (304 on If-None-Match). They get the same security headers as every other response, and public ones are cacheable for 5 minutes.
  • Routing: /:owner.atom is registered before /:owner in src/http/server.ts, and the new src/http/atom_routes.ts holds both handlers. An account literally named x.atom still gets its profile.
  • Links: the repository page (both heads) now carries the ships feed next to its activity feed, through a new moreFeeds option in src/web/layout.ts. The profile page in src/web/pages/org.ts carries /{owner}.atom. I put the person link there rather than in people.ts, because people.ts is the admin People list and the profile lives in org.ts.
  • Index: the person feed reads issue_author_created on issue(author_id, kind, created_at DESC), added by migration 20261114120000-posts-by-author. The test checks the query plan has no temp sort, and the pin is committed.
  • Docs and tests: docs/features/atom.md documents the feeds. test/repo-atom.test.ts covers escaping, 404 on private, 304, the link tags and the plan.
  • Route marks: I added /:owner.atom as open in src/http/route_marks.ts, which the route-marks test requires.

Not done:

  • Pagination: the feeds show only the newest 30, with no way to page further back.
  • Terminal screen: none, since no page was added.
  • Commit trailers: the commits carry No look: and No door: lines for the gate, and a Try: line that the pre-push hook required.

To try it: open /{owner}/{name}/ships.atom and /{owner}.atom in a reader, or view source on the repo and profile pages to see the alternate links.

🤖 Generated with Claude Code

Closes #12407

2 earlier comments
commented

Repositories now have /{owner}/{name}/ships.atom and people have /{owner}.atom, and each page advertises its feed with an Atom <link rel="alternate">. The new tests, tsc, gate.ts and design-lint pass. I ran the related atom, route-mark and layout tests rather than the whole suite, because fast.ts named 2160 files. I did not try the feeds on the deployed preview.

  • Ships feed: it lists the newest 30 merged pulls (title, link, merge time, author), newest merge first, and sealed security reports are never listed. A private repo, or one that doesn't exist, answers 404 to a stranger.
  • Person feed: it lists the newest 30 issues the person opened on repositories a stranger may read, with private and sealed ones left out. I took "public posts" to mean issues only. Tells, comments and shares are left out.
  • Both feeds: text is XML-escaped and each carries an ETag (304 on If-None-Match). They get the same security headers as every other response, and public ones are cacheable for 5 minutes.
  • Routing: /:owner.atom is registered before /:owner in src/http/server.ts, and the new src/http/atom_routes.ts holds both handlers. An account literally named x.atom still gets its profile.
  • Links: the repository page (both heads) now carries the ships feed next to its activity feed, through a new moreFeeds option in src/web/layout.ts. The profile page in src/web/pages/org.ts carries /{owner}.atom. I put the person link there rather than in people.ts, because people.ts is the admin People list and the profile lives in org.ts.
  • Index: the person feed reads issue_author_created on issue(author_id, kind, created_at DESC), added by migration 20261114120000-posts-by-author. The test checks the query plan has no temp sort, and the pin is committed.
  • Docs and tests: docs/features/atom.md documents the feeds. test/repo-atom.test.ts covers escaping, 404 on private, 304, the link tags and the plan.
  • Route marks: I added /:owner.atom as open in src/http/route_marks.ts, which the route-marks test requires.

Not done:

  • Pagination: the feeds show only the newest 30, with no way to page further back.
  • Terminal screen: none, since no page was added.
  • Commit trailers: the commits carry No look: and No door: lines for the gate, and a Try: line that the pre-push hook required.

To try it: open /{owner}/{name}/ships.atom and /{owner}.atom in a reader, or view source on the repo and profile pages to see the alternate links.

🤖 Generated with Claude Code

commented

Each repository's merged pulls and each person's public posts now have an Atom feed, linked from their pages. This push fixes the two gate failures from the last check.

  • Comment wrapping: I rewrapped the three comment lines over 100 columns: test/repo-atom.test.ts:1, src/http/atom_routes.ts:33 and src/http/atom_routes.ts:93. Wording is unchanged apart from trimming.
  • Pipeline rule: the "pipeline first" rule had also failed. I added a Direction: line to the commit message saying the feeds are a reader-facing feature requested in #12407. No pipeline change was added.

bun scripts/gate.ts and bun x tsc --noEmit are clean, and test/repo-atom.test.ts passes (6 tests). I did not run the full suite; the forge runs it on the push.

To try it, open /alice/notes/ships.atom or /alice.atom in a feed reader, or view source on /alice and find the alternate links.

commented

Review findings 1–3 are fixed and the gate, tsc and the atom tests pass locally. I did not run the full suite; the forge runs it on the push.

One slip: the middle push (5625e4f64) went up with the gate red on two over-long comment lines. The next push, 0c797da17, fixes them, and the gate now passes on it.

  • Name clash (finding 1): personAtom now looks up the whole name owner.atom first and serves that profile if the account exists. Otherwise it serves the feed for owner. So with accounts bob and bob.atom, /bob.atom is the profile of bob.atom. The feed of bob.atom is reachable at /bob.atom.atom. bob's own feed is not reachable by that name. This is a consequence of the order you asked for, and it is the only way both accounts stay reachable.
  • Short feeds (finding 3): postsBy now joins repo and filters visibility = 'public' in the SQL, so the 30-entry limit applies after the filter. canRead still runs on each row. The index plan test uses the new query and still shows no temp B-tree and the issue_author_created index.
  • Tests (finding 2), in the new test/repo-atom-edges.test.ts:
    • the x.atom fallback, including the clash from finding 1 and an unknown name giving 404;
    • ships capped at 30 and newest first, with a sealed pull left out;
    • a sealed issue left out of a person's feed;
    • older public posts not crowded out by 105 newer private ones;
    • a signed-in reader of a private repo gets private, no-store and vary: cookie, while an anonymous request for the same repo is 404, so it is not served from the public cache;
    • a signed-in reader of a public repo gets a non-public cache-control, and an anonymous reader still gets public, max-age=300.
  • Test setup: the bob.atom account needs allowReserved, because signup refuses that name as reserved. Titles come back capitalised ("Ship 35"), so the leak checks compare lowercase to avoid passing vacuously.
  • Direction (finding 4): the change is small and adds no feature. The commit messages carry the Direction: line.
Sign in to join this conversation.

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

Keyboard shortcuts

Docs