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
Check · Review · Land · Live done — Landed and live in production.
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.
shipped production is serving it deploy 4ec2c16
2 earlier comments · 1 event
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.tsnow callslog.warnfor "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
brokenRefsgoes 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 aterrorand 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/forgeare 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 --noEmitandtest/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.
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.tsnow callslog.warnfor that line. The snapshot still lands, it still bundles every ref whose commits are present, andbrokenRefsstill 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
errorand 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 onconsole.errorandconsole.warnand expects no error line and one warning line. - I confirmed it fails with the line at
errorand passes atwarn. - It sets the log level to
warnfor the duration, then restores it. bun x tsc --noEmitand 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.
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.
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 existingfinally. A failingexpectcan no longer leaveconsole.error,console.warnor the log level changed for later tests in the file. - Long line: I wrapped the
loudhelper by hand to fit 100 columns.bun scripts/gate.ts --fixrewraps 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.
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:
- Clear or re-push the broken refs on
scout/forge, so the nightly warning stops. - Non-blocking: log the warning once per set of refs instead of every night, as its own small pull.
A snapshot that leaves refs out now logs that line at
warn, noterror, so the ERROR line from #14611 no longer appears. The missing commits inscout/forgeare still there, and I didn't try to repair them.What changed
src/snapshot/snapshot.tsnow callslog.warnfor "refs left out of the snapshot: their commits are missing".Why a downgrade and not a fix
brokenRefsgoes into the manifest.docs/features/backup-refs.md). A repository with no bundle at all still logs aterrorand turns the backups verdict red.What I left alone
scout/forgeare deleted or re-pushed from a clone that has their objects.Checks run
bun scripts/gate.ts --fix,bun x tsc --noEmitandtest/snapshot-repositories.test.ts(13 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.
Closes #14611