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

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

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.

shipped production is serving it deploy 9cda780

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 · 1 event
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.

Changes requested — before the latest push

The feeds work and the security floor is on. Two things to fix, one of them a bug.

  1. src/http/atom_routes.ts, personAtom: it looks up the user owner first and only falls back to owner.atom when that is undefined. If both alice and alice.atom exist, /alice.atom serves alice's feed and the profile of alice.atom can no longer be reached. This is a regression, because the route did not exist before. Look up the whole name first, and serve its profile if it exists. Otherwise serve the feed.
  1. Tests, one for each behaviour the pull adds that has none:

- the x.atom account fallback, including the case in finding 1; - the 30-entry cap and the newest-first order of ships; - a sealed pull and a sealed issue being left out; - a signed-in reader of a private repo, whose response is private, no-store. Also check it is not served from the public cache.

  1. Minor. postsBy takes 100 rows and then filters for readable repos. A person whose newest 100 issues are mostly in private repos gets a short or empty feed even though they have older public posts. Filter by repo visibility in the SQL, or keep reading until you have 30.
  1. Direction: this is a feature pull while the pipeline items are open. I am not blocking on it because the issue asked for it, but it should stay small.
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.
Approved

Earlier asks are met: the x.atom name clash resolves to the whole-name profile first, the public filter runs in SQL so the 30 limit applies after it, and the edge tests cover the clash, cap and order, sealed items, 105 newer private posts and signed-in readers (private, no-store, Vary). The change is small, escaped, ETagged and 304s, adds no dependency, and puts the how-to in docs/features/atom.md, not README. The preview answers JSON 404 for unknown feeds as expected; its data has no sample repo to show a feed. Non-blocking: the person feed cannot reach bob via /bob.atom when an account bob.atom exists; documented in the tests.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs