Repository navigation
fork-ci: ci-demand follow-ups (cache write failure shown, BOM, NaN date, tests) - #141
Draft
scuttletoby wants to merge 1 commit into
Draft
scuttletoby wants to merge 1 commit into
scuttletoby wants to merge 1 commit into
Conversation
…te, tests) - A cache that cannot be written is in the result: `cache_write_failed` in --json and in the first line; a stop then does not say "run again with the same --cache" (nothing was saved) but "fix --cache first". - The config file is read as utf-8-sig, so a BOM is fine. - A cache date that is NaN or -Infinity counts as damaged and the page is fetched again (json.load reads both). - New tests for four lines no test caught: the "cannot be made private" refusal, the 1000 reserve when X-RateLimit-Limit is missing, and UTF-8 for gh output and the config file (the script run in the C locale with UTF-8 mode off). The fake gh now writes UTF-8 bytes, like the real one, and can leave a header out. - README: the cache folder must allow private permissions on Linux and macOS (FAT, WSL /mnt/c are refused), and the new result field. Fixes #120 Fixes #121 Fixes #122 Fixes #123 Fixes #124 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #120
Fixes #121
Fixes #122
Fixes #123
Fixes #124
Follow-ups from the quick-check review of #113 (#113 (comment)), all in
fork-ci/actions/ci-demand/.What changes
--jsonhascache_write_failed(the error, ornull), and the first line of the text output sayscache not written (...). When the run also stopped early, it no longer says "run again with the same --cache" (nothing was saved, so a rerun would fetch the same pages and a big range could never finish); it says "so a run again asks for the same pages: fix --cache first".X-RateLimit-Limitis missing, and UTF-8 forghoutput and for the config file. The UTF-8 test runs the script itself in the C locale with UTF-8 mode off (ASCII), with a non-ASCII workflow file name and config text. The fakeghnow writes its body as UTF-8 bytes like the realgh, and can leave a header out.utf-8-sig, so a UTF-8 BOM (some Windows editors) is accepted.NaNor-Infinity(json.loadreads both) counts as damaged and the page is fetched again (math.isfinite)./mnt/cor some network mounts is refused (exit 2); pick a folder on a normal disk. Also documents the new--jsonfield and that UTF-8 (with or without BOM) is read whatever the locale.Tests
python3 -I -B fork-ci/actions/ci-demand/ci_demand.test.py(GitHub faked, no token, empty gh config): 41 tests, all pass (36 before). Red first: before the fix, the new or extended tests for #120, #122 and #123 failed (2 failures, 2 errors).Mutation check (each change applied alone, then the suite run): all 8 are caught. These are: no private refusal, reserve fallback 0,
ghwithoutencoding='utf-8', the config without an encoding, the config as plainutf-8(BOM), noisfinite, nocache_write_failedin the JSON, and the "run again" hint shown even after a failed write.The reviewer's own round-2 test file: the cache-write and BOM tests pass. Its NaN test expects 2 requests, but it puts NaN into every cache file, including the 4 jobs pages. With the agreed fix, all 6 count as damaged, so 6 requests is right; the folded test checks that.
State question
"What happens when this runs again, stops half-way, or meets existing/old/empty/corrupt state?"
FORMATbump). A file with a NaN or -Infinity date, which only hand damage can cause, is fetched again once and then saved correctly. An existing config with a BOM now works. A config without one reads as before.General vs project
All general: the tool, its tests and its README name no project. Project facts stay where they were: the repository (
--repoorciDemand.repoin the project's own config) and the cache folder the caller picks.🤖 Generated with Claude Code