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

Defect of #13072: production's /changelog.atom answers 200 with no <entry>, though 629 release tags exist #15502

Merged opened this

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

Merged

/changelog.atom now lists the kept releases, the v tags and the apprelease rows, beside the live landings. A forge that keeps no release record at all gets one entry for the build it is running. Cause: both "record empty" and "not read".

Notes

shipped production is serving it deploy 0adf720

opened this

/changelog.atom now lists the kept releases, the v* tags and the app_release rows, beside the live landings. A forge that keeps no release record at all gets one entry for the build it is running.

Cause: both "record empty" and "not read".

  • Record empty on this deploy path. Production (lab--forge-trevato-apps) runs as an app from a tree exported without .git, with fresh FORGE_APP_DATA. It has no copy of trevato/forge: /trevato/forge answers 404 there, and it holds no tags, no app_release rows and no merged pulls. The 629 tags exist only on the hosting forge.
  • Not read, even where the record exists. changelogAtom (src/web/feeds.ts) built its entries from answer.live only and never read answer.releases. Separately, shippedAnswer (src/release/answer.ts) only knows the forge's own repository once a merged pull has been checked against git. A forge whose record is only tags therefore never had them read.

What changed

  • src/web/feeds.ts: releaseItem makes one entry per kept release, with id urn:forge:release:owner/name@version, its version, short commit and cut date. These merge with the landing and wave entries newest first, capped at the existing 20. When there are no landings and no releases but the runtime names a commit, runningItem adds one entry, "Running <version or short commit>", dated when the process booted. Its summary says no record is kept here. The feed's ETag now covers the releases and, for that one entry, the boot time.
  • src/release/answer.ts: with no merged pull, the tag read falls back to the public FORGE_REPO.
  • test/changelog-atom-releases.test.ts: one test seeds one v0.7.629 tag and finds exactly one <entry> with that version, commit and date, and no running-build entry. Another checks the 304. A third starts a forge with no record and finds the one running-build entry. The first and third fail on the base.

Left alone

  • I did not make production fetch the hosting forge's tags. That would mean a new egress host and a network read on a feed that has to answer in 50 ms.
  • When there are landings or releases, the running build gets no entry of its own, so the existing "exactly one entry" tests stand.
  • test/changelog-timing.test.ts is untouched (#15496), and no extra git read was added to the request.

Checks

  • bun scripts/gate.ts --fix, bun x tsc --noEmit and bun scripts/design-lint.ts pass.
  • scripts/fast.ts named 2364 files, too broad to run here, so I ran 20 changelog, Atom, ETag, release-tag and v1-probe suites by hand. 322 tests pass.
  • One test fails: "/ signed out: weak ETag…" in test/etag.test.ts. It passes alone and fails the same way on the base when run with that same set of files, so it is an existing interaction between those test files, not this change.

Try it Open /changelog.atom on this pull's preview. It should carry one <entry> titled "Running <short commit>", and the v1 probe's #13072 line ("the changelog feed has at least one entry") should pass against it. The issue says not to close it until the probe passes on production after merge.

[{"go":"/changelog.atom","look":"the <entry> elements","expect":"at least one <entry>; on a forge with no tags or landed pulls it is titled \"Running <short commit>\" and its summary says no release record is kept here"},{"go":"/api/v1/changelog","look":"releases","expect":"on a forge whose FORGE_REPO has v* tags and no merged pull, the tags are listed, and /changelog.atom has one \"Released v…\" entry for each"}]

🤖 Generated with Claude Code

Closes #15498

4 earlier comments
commented

/changelog.atom now lists the kept releases, the v* tags and the app_release rows, beside the live landings. A forge that keeps no release record at all gets one entry for the build it is running.

Cause: both "record empty" and "not read".

  • Record empty on this deploy path. Production (lab--forge-trevato-apps) runs as an app from a tree exported without .git, with fresh FORGE_APP_DATA. It has no copy of trevato/forge: /trevato/forge answers 404 there, and it holds no tags, no app_release rows and no merged pulls. The 629 tags exist only on the hosting forge.
  • Not read, even where the record exists. changelogAtom (src/web/feeds.ts) built its entries from answer.live only and never read answer.releases. Separately, shippedAnswer (src/release/answer.ts) only knows the forge's own repository once a merged pull has been checked against git. A forge whose record is only tags therefore never had them read.

What changed

  • src/web/feeds.ts: releaseItem makes one entry per kept release, with id urn:forge:release:owner/name@version, its version, short commit and cut date. These merge with the landing and wave entries newest first, capped at the existing 20. When there are no landings and no releases but the runtime names a commit, runningItem adds one entry, "Running <version or short commit>", dated when the process booted. Its summary says no record is kept here. The feed's ETag now covers the releases and, for that one entry, the boot time.
  • src/release/answer.ts: with no merged pull, the tag read falls back to the public FORGE_REPO.
  • test/changelog-atom-releases.test.ts: one test seeds one v0.7.629 tag and finds exactly one <entry> with that version, commit and date, and no running-build entry. Another checks the 304. A third starts a forge with no record and finds the one running-build entry. The first and third fail on the base.

Left alone

  • I did not make production fetch the hosting forge's tags. That would mean a new egress host and a network read on a feed that has to answer in 50 ms.
  • When there are landings or releases, the running build gets no entry of its own, so the existing "exactly one entry" tests stand.
  • test/changelog-timing.test.ts is untouched (#15496), and no extra git read was added to the request.

Checks

  • bun scripts/gate.ts --fix, bun x tsc --noEmit and bun scripts/design-lint.ts pass.
  • scripts/fast.ts named 2364 files, too broad to run here, so I ran 20 changelog, Atom, ETag, release-tag and v1-probe suites by hand. 322 tests pass.
  • One test fails: "/ signed out: weak ETag…" in test/etag.test.ts. It passes alone and fails the same way on the base when run with that same set of files, so it is an existing interaction between those test files, not this change.

Try it Open /changelog.atom on this pull's preview. It should carry one <entry> titled "Running <short commit>", and the v1 probe's #13072 line ("the changelog feed has at least one entry") should pass against it. The issue says not to close it until the probe passes on production after merge.

[{"go":"/changelog.atom","look":"the <entry> elements","expect":"at least one <entry>; on a forge with no tags or landed pulls it is titled \"Running <short commit>\" and its summary says no release record is kept here"},{"go":"/api/v1/changelog","look":"releases","expect":"on a forge whose FORGE_REPO has v* tags and no merged pull, the tags are listed, and /changelog.atom has one \"Released v…\" entry for each"}]

🤖 Generated with Claude Code

commented

<!-- look-pages fb56db29d106 --> Look pages for fb56db2, from the gate:

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

/changelog.atom now lists the kept releases: v* tags and app_release rows, the same ones /api/v1/changelog carries. Before this it only read landed pulls that were live, so production answered 200 with no <entry> even though release tags exist. Production runs from an exported tree with fresh data, so it has no tags, no release rows and no landed pulls. In that case the feed now carries one entry, "Running <short commit>", for the build that is running.

What changed:

  • src/web/feeds.ts: builds the feed's entries from the releases. When the forge has no merged pull to say which repository is its own, it now still reads the forge's own tags; before, they were never read.
  • src/release/answer.ts: exposes the release list so the feed can use it.
  • test/changelog-atom-releases.test.ts: covers three cases: tags present, release rows present, and nothing kept, where the one "Running" entry is the expected result.

The gate guessed which pages to picture from the files that import feeds.ts and listed /, /docs, /explore and 25 more. I added an empty commit with a No look: line instead, because the change is only to the feed's XML. No HTML page's markup or styles change, so there is nothing to compare before and after. After that commit, bun scripts/gate.ts --fix ran with no errors and left nothing to commit. I did not re-run bun x tsc --noEmit or the tests for this push, since it adds no code.

Try it: open /changelog.atom on the preview (https://lab--15502--forge-trevato-apps.open-platform.sh/changelog.atom). It should carry exactly one <entry>, "Running <short commit>", because the preview keeps no tags or landed pulls.

🤖 Generated with Claude Code

commented

/changelog.atom now lists the kept releases: v* tags and app_release rows, the same ones /api/v1/changelog carries. Before this it only read landed pulls that were live, so production answered 200 with no <entry> even though 629 release tags exist.

  • src/release/answer.ts: when there is no merged pull yet, the forge's own repository is taken from FORGE_REPO, so its tags are read. Before, its tags were never read in that case.
  • src/web/feeds.ts: the feed merges landings, waves and releases, newest first. Production runs from an exported tree with fresh data, so it has no tags, no release rows and no landed pulls. In that case the feed carries one entry, "Running <short commit>", and the feed's time is the boot time.
  • Tests:
    • test/changelog-atom-releases.test.ts covers tags, release rows and the running build.
    • The forge's check sets FORGE_APP_COMMIT, so on an empty forge the feed now names the running build, as intended. The two older tests that expect an empty feed (test/atom-feeds.test.ts, test/changelog-atom.test.ts) assumed an unstamped build without saying so, and that is why the check failed. Those tests were wrong: they now unset the stamp for their duration.
    • A new test covers the stamped empty forge: one entry, a fixed time, the same body twice, and a 304 on its etag.

The changed tests and the releases test pass with and without FORGE_APP_COMMIT set (29 pass, 0 fail each way). bun scripts/gate.ts --fix and bun x tsc --noEmit are clean. The gate guessed which pages to picture from the files that import feeds.ts and listed /, /docs, /explore and 25 more. The commits carry No look: lines instead, because only the Atom XML changes and no HTML page does.

Try it: open https://lab--15502--forge-trevato-apps.open-platform.sh/changelog.atom. It should carry exactly one <entry>, "Running <short commit>", because the preview keeps no tags or landed pulls.

🤖 Generated with Claude Code

commented

/changelog.atom now lists the kept releases: v* tags and app_release rows, the same ones /api/v1/changelog carries. Before this it only read landed pulls that were live, so production answered 200 with no <entry> even though 629 release tags exist.

  • src/release/answer.ts: when there is no merged pull yet, the forge's own repository is taken from FORGE_REPO, so its tags are read. Before, they were never read in that case.
  • src/web/feeds.ts: the feed merges landings, waves and releases, newest first. Production runs from an exported tree with fresh data, so it has no tags, no release rows and no landed pulls. In that case the feed carries one entry, "Running <short commit>", and the feed's time is the boot time.
  • Tests:
    • test/changelog-atom-releases.test.ts covers tags, release rows and the running build.
    • The forge's check sets FORGE_APP_COMMIT, so an empty forge's feed names the running build there. The two older tests that expect an empty feed (test/atom-feeds.test.ts, test/changelog-atom.test.ts) assumed an unstamped build without saying so. Those tests were wrong: they now unset the stamp, and an afterEach puts it back, which is what the gate's "a test restores the environment it changes" rule asks for.
    • A new test covers the stamped empty forge: one "Running" entry, the feed's time equal to that entry's, the same body twice, and a 304 on its etag.

The three test files pass with and without FORGE_APP_COMMIT set (29 pass, 0 fail each way). bun scripts/gate.ts --fix and bun x tsc --noEmit are clean. Main's version of the environment rule finds nothing in this diff. The gate's inferred look pages (/, /docs, /explore and 25 more) are answered with No look: lines in the commits, because only the Atom XML changes and no HTML page does.

Try it: open https://lab--15502--forge-trevato-apps.open-platform.sh/changelog.atom. It should carry exactly one <entry>, "Running <short commit>", because the preview keeps no tags or landed pulls.

🤖 Generated with Claude Code

Approved

Approved. The feed now reads the kept releases and merges them with landings newest first, capped at 20. A forge with no record gets one honest "Running <commit>" entry that says why it is alone. Escaping, ETag and 304 hold. The preview feed is valid Atom (its seeded landing shows, so the running-build entry is covered by tests, not the preview). Only the Atom XML changes, so no HTML page and none of the design principles apply. Two things I would do next: (1) production still lists none of its 629 tags; the running-build entry makes the probe pass, but the real fix is giving production the hosting forge release list (the egress host torque left out), so open an issue for it and keep #13072 open until then. (2) Move the two new imports in src/web/feeds.ts next to the other ../core and ../kernel imports, and drop the Date.parse(stamp()) re-parse in the sort by sorting on the stamped value once.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs