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

Sentinel: The log says "snapshot: refs left out of the snapshot: their commits are missing repo=scout/forge refs=…" 3 times #14636

Merged opened this

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

Merged

A snapshot that leaves refs out now logs that line at warn, not error, so the ERROR line from #14611 no longer appears. The missing commits in scout/forge are still there, and I didn't try to repair them.

Notes

shipped production is serving it deploy 4ec2c16

opened this

A snapshot that leaves refs out now logs that line at warn, not error, so the ERROR line from #14611 no longer appears. The missing commits in scout/forge are still there, and I didn't try to repair them.

What changed

  • src/snapshot/snapshot.ts now calls log.warn for "refs left out of the snapshot: their commits are missing".
  • I also added a comment there saying why.

Why a downgrade and not a fix

  • The nightly snapshot still lands. The bundle holds every ref whose commits are present, and brokenRefs goes into the manifest.
  • The forge's admin already sees a backups card naming the repository and the refs, with the way to clear it (docs/features/backup-refs.md). A repository with no bundle at all still logs at error and turns the backups verdict red.
  • The same condition therefore reached the log as an ERROR every night, even though the admin card already covers it.

What I left alone

  • I changed no behaviour: the bundle, the manifest and the card are the same. The warning also keeps logging each night until the broken refs on scout/forge are deleted or re-pushed from a clone that has their objects.
  • I added no test for the log level.

Checks run

  • bun scripts/gate.ts --fix, bun x tsc --noEmit and test/snapshot-repositories.test.ts (13 pass).
  • The gate rewrapped a comment, and I committed that.

To try it: run a snapshot with a repository that has a ref whose commits are missing. The log line should show as WARN, and the backups card should still list the ref.

Closes #14611

2 earlier comments · 1 event
commented

A snapshot that leaves refs out now logs that line at warn, not error, so the ERROR line from #14611 no longer appears. The missing commits in scout/forge are still there, and I didn't try to repair them.

What changed

  • src/snapshot/snapshot.ts now calls log.warn for "refs left out of the snapshot: their commits are missing".
  • I also added a comment there saying why.

Why a downgrade and not a fix

  • The nightly snapshot still lands. The bundle holds every ref whose commits are present, and brokenRefs goes into the manifest.
  • The forge's admin already sees a backups card naming the repository and the refs, with the way to clear it (docs/features/backup-refs.md). A repository with no bundle at all still logs at error and turns the backups verdict red.
  • The same condition therefore reached the log as an ERROR every night, even though the admin card already covers it.

What I left alone

  • I changed no behaviour: the bundle, the manifest and the card are the same. The warning also keeps logging each night until the broken refs on scout/forge are deleted or re-pushed from a clone that has their objects.
  • I added no test for the log level.

Checks run

  • bun scripts/gate.ts --fix, bun x tsc --noEmit and test/snapshot-repositories.test.ts (13 pass).
  • The gate rewrapped a comment, and I committed that.

To try it: run a snapshot with a repository that has a ref whose commits are missing. The log line should show as WARN, and the backups card should still list the ref.

commented

The snapshot's "refs left out of the snapshot: their commits are missing" line is now logged at warn, not error, so it no longer shows up as an ERROR line each night. The gate now passes locally with the test committed, and I pushed.

What changed

  • src/snapshot/snapshot.ts now calls log.warn for that line. The snapshot still lands, it still bundles every ref whose commits are present, and brokenRefs still goes into the manifest.
  • The backups card still names the repository and refs and says how to clear them (docs/features/backup-refs.md).
  • A repository with no bundle at all still logs at error and turns the backups verdict red.

What I did not do

  • I did not repair the missing commits in scout/forge. The warning keeps appearing each night until the broken refs are deleted or re-pushed from a clone that has their objects.

Test

  • The failing check wanted a test, so I extended the broken-refs case in test/snapshot-repositories.test.ts. It spies on console.error and console.warn and expects no error line and one warning line.
  • I confirmed it fails with the line at error and passes at warn.
  • It sets the log level to warn for the duration, then restores it.
  • bun x tsc --noEmit and the 13 tests in that file pass.

To try it: run a snapshot with a repository that has a ref whose commits are missing. The log line should show as WARN and the backups card should still list the ref.

Changes requested — before the latest push

The downgrade is small, does what #14611 asks, and the test would fail without it. One thing to fix: the test's cleanup is not in a finally.

The spies and the log level are restored in the middle of the try, after the assertions. If an expect fails, console.error, console.warn and the log level stay mocked or lowered for every later test in the file. That hides the real failure behind unrelated ones. Move err.mockRestore(), warn.mockRestore() and setLogLevel(level) into the existing finally, or add one.

Second, the loud helper line is over 100 columns. Re-run bun scripts/gate.ts --fix and commit the wrap.

Next after this: delete or re-push the broken refs on scout/forge so the warning stops, and consider logging it once per ref set rather than every night.

commented

Both review points are fixed and pushed. bun x tsc --noEmit is clean and the 13 tests in test/snapshot-repositories.test.ts pass.

  • Restore in finally: the two spies and the log level are now restored in the test's existing finally. A failing expect can no longer leave console.error, console.warn or the log level changed for later tests in the file.
  • Long line: I wrapped the loud helper by hand to fit 100 columns. bun scripts/gate.ts --fix rewraps only comments, so it did not touch it. The file already has other code lines over 100 columns that I left as they were.

The change itself is unchanged: the "refs left out of the snapshot: their commits are missing" line is logged at warn, and the test fails if it goes back to error.

Left for later, as the review suggested:

  • Deleting or re-pushing the broken refs on scout/forge, which needs someone with write access to that repository.
  • Logging the warning once per set of refs instead of every night. That would be a behaviour change, so I did not fold it in here.
Approved

Both earlier asks are met: the spies and the log level are restored in the existing finally, and the long loud helper is wrapped. The change is a one-line downgrade of the log level, with a test that fails if it goes back to error. No page or terminal surface is touched, so there is nothing for a person to try in the preview.

Two things I would do next:

  1. Clear or re-push the broken refs on scout/forge, so the nightly warning stops.
  2. Non-blocking: log the warning once per set of refs instead of every night, as its own small pull.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs