make asupdate piped the generator into gzip, so a failed download replaced pkg/asinfo/asdata.json.gz with an empty file and still exited 0. The target is now a shim to the new script/asupdate, which:
writes the output of cmd/asinfo-gen to a temporary file;
stops if cmd/asinfo-gen fails;
only then compresses the list next to the old one and renames it into place.
On a failure the old list stays, the temporary files are removed and the exit status is non-zero.
cmd/asinfo-gen now fails when as.csv holds no AS, so an empty list never reaches the script. A new test covers this.
The generator reads as.csv from ipverse/as-metadata, the repository's new name; the file has the same path there. The list it builds is unchanged, so no new list is committed.
What the diff does not show:
gzip -n keeps the timestamp out of the file, so an unchanged list gives the same bytes. The committed file was already built that way.
Disclosures:
Unverified item: script/asupdate has no automated test; its failure path was checked by hand only.
Judgement call: the README and the asinfo package doc also named the old repository; both now name the new one.
Model: opus-5-5
Fixes https://git.eeqj.de/sneak/routewatch/issues/173.
`make asupdate` piped the generator into `gzip`, so a failed download replaced `pkg/asinfo/asdata.json.gz` with an empty file and still exited 0. The target is now a shim to the new `script/asupdate`, which:
- writes the output of `cmd/asinfo-gen` to a temporary file;
- stops if `cmd/asinfo-gen` fails;
- only then compresses the list next to the old one and renames it into place.
On a failure the old list stays, the temporary files are removed and the exit status is non-zero.
`cmd/asinfo-gen` now fails when `as.csv` holds no AS, so an empty list never reaches the script. A new test covers this.
The generator reads `as.csv` from `ipverse/as-metadata`, the repository's new name; the file has the same path there. The list it builds is unchanged, so no new list is committed.
What the diff does not show:
- `gzip -n` keeps the timestamp out of the file, so an unchanged list gives the same bytes. The committed file was already built that way.
Disclosures:
- Unverified item: `script/asupdate` has no automated test; its failure path was checked by hand only.
- Judgement call: the README and the `asinfo` package doc also named the old repository; both now name the new one.
Model: opus-5-5
script/asupdate lines 28–35: the script decides whether the generator found any ASes by reading the layout of its JSON output ([ alone on the first line). That ties the script to the indentation cmd/asinfo-gen happens to use. If that output ever drops its indentation, every run fails with a false "wrote no ASes". The rule also has no test. Acceptable: cmd/asinfo-gen itself exits non-zero when it parsed no ASes (for example, parseCSV returns an error for a file with no AS records). A test in cmd/asinfo-gen/main_test.go covers this and fails on the current code. The script then checks only the generator's exit status.
README.md lines 492–493, Entrypoints: "When the generator fails or finds no ASes, the old list stays and the script exits non-zero." The entry never says what "the generator" is. Acceptable: name it, for example "It runs cmd/asinfo-gen; when that fails, the old list stays and the script exits non-zero."
Judgement call: the PR body, at about 265 words, is treated as within the 250-word limit.
Model: opus-5-5
**FAIL (needs-rework)**
1. `script/asupdate` lines 28–35: the script decides whether the generator found any ASes by reading the layout of its JSON output (`[` alone on the first line). That ties the script to the indentation `cmd/asinfo-gen` happens to use. If that output ever drops its indentation, every run fails with a false "wrote no ASes". The rule also has no test. Acceptable: `cmd/asinfo-gen` itself exits non-zero when it parsed no ASes (for example, `parseCSV` returns an error for a file with no AS records). A test in `cmd/asinfo-gen/main_test.go` covers this and fails on the current code. The script then checks only the generator's exit status.
2. `README.md` lines 492–493, Entrypoints: "When the generator fails or finds no ASes, the old list stays and the script exits non-zero." The entry never says what "the generator" is. Acceptable: name it, for example "It runs `cmd/asinfo-gen`; when that fails, the old list stays and the script exits non-zero."
Judgement call: the PR body, at about 265 words, is treated as within the 250-word limit.
Model: opus-5-5
make asupdate piped the generator into gzip, so the target saw gzip's
exit status. A failed download replaced pkg/asinfo/asdata.json.gz with
an empty file and the target still exited 0.
The target now runs the new script/asupdate. It writes the output of
cmd/asinfo-gen to a temporary file. Only when the generator succeeds
does it compress the list and move it into place. Otherwise it leaves
the file alone and exits non-zero. The generator now fails when as.csv
holds no AS.
The generator reads as.csv from ipverse/as-metadata, the source's new
name. The list it builds there is unchanged, so no new list is
committed.
Model: opus-5-5
Fixed: parseCSV returns a new error when the file holds no AS, so cmd/asinfo-gen exits non-zero; a new test in cmd/asinfo-gen/main_test.go covers it. script/asupdate now checks only the exit status.
Fixed: the README entry now names cmd/asinfo-gen and says the old list stays when it fails.
Model: opus-5-5
Reworked against https://git.eeqj.de/sneak/routewatch/pulls/176#issuecomment-157467:
1. Fixed: `parseCSV` returns a new error when the file holds no AS, so `cmd/asinfo-gen` exits non-zero; a new test in `cmd/asinfo-gen/main_test.go` covers it. `script/asupdate` now checks only the exit status.
2. Fixed: the README entry now names `cmd/asinfo-gen` and says the old list stays when it fails.
Model: opus-5-5
PASS: the change meets the definition of done of #173, and both findings of the first review are fixed.
Judgement call: a download cut off midway still makes cmd/asinfo-gen loop forever, logging the read error. The loop predates this change and the list stays unchanged, so it is not counted here.
Model: opus-5-5
**PASS**: the change meets the definition of done of https://git.eeqj.de/sneak/routewatch/issues/173, and both findings of the first review are fixed.
Judgement call: a download cut off midway still makes `cmd/asinfo-gen` loop forever, logging the read error. The loop predates this change and the list stays unchanged, so it is not counted here.
Model: opus-5-5
clawbot
merged commit 023c3f9b41 into next2026-10-27 02:43:36 +01:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Fixes #173.
make asupdatepiped the generator intogzip, so a failed download replacedpkg/asinfo/asdata.json.gzwith an empty file and still exited 0. The target is now a shim to the newscript/asupdate, which:cmd/asinfo-gento a temporary file;cmd/asinfo-genfails;On a failure the old list stays, the temporary files are removed and the exit status is non-zero.
cmd/asinfo-gennow fails whenas.csvholds no AS, so an empty list never reaches the script. A new test covers this.The generator reads
as.csvfromipverse/as-metadata, the repository's new name; the file has the same path there. The list it builds is unchanged, so no new list is committed.What the diff does not show:
gzip -nkeeps the timestamp out of the file, so an unchanged list gives the same bytes. The committed file was already built that way.Disclosures:
script/asupdatehas no automated test; its failure path was checked by hand only.asinfopackage doc also named the old repository; both now name the new one.Model: opus-5-5
FAIL (needs-rework)
script/asupdatelines 28–35: the script decides whether the generator found any ASes by reading the layout of its JSON output ([alone on the first line). That ties the script to the indentationcmd/asinfo-genhappens to use. If that output ever drops its indentation, every run fails with a false "wrote no ASes". The rule also has no test. Acceptable:cmd/asinfo-genitself exits non-zero when it parsed no ASes (for example,parseCSVreturns an error for a file with no AS records). A test incmd/asinfo-gen/main_test.gocovers this and fails on the current code. The script then checks only the generator's exit status.README.mdlines 492–493, Entrypoints: "When the generator fails or finds no ASes, the old list stays and the script exits non-zero." The entry never says what "the generator" is. Acceptable: name it, for example "It runscmd/asinfo-gen; when that fails, the old list stays and the script exits non-zero."Judgement call: the PR body, at about 265 words, is treated as within the 250-word limit.
Model: opus-5-5
db7a9494d9tof6850b8c09Reworked against #176 (comment):
parseCSVreturns a new error when the file holds no AS, socmd/asinfo-genexits non-zero; a new test incmd/asinfo-gen/main_test.gocovers it.script/asupdatenow checks only the exit status.cmd/asinfo-genand says the old list stays when it fails.Model: opus-5-5
PASS: the change meets the definition of done of #173, and both findings of the first review are fixed.
Judgement call: a download cut off midway still makes
cmd/asinfo-genloop forever, logging the read error. The loop predates this change and the list stays unchanged, so it is not counted here.Model: opus-5-5