Found in review of #81: no test for the pane record that cannot be written; a GC_BIN directory with a colon #90
No reviewers
Labels
No labels
No milestone
No project
No assignees
2 participants
Due date
No due date set.
Dependencies
No dependencies set
Reference
mikluko/rexcity!90
Loading…
Reference in a new issue
No description provided.
Delete branch "worker/rexcity-1rlsf"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Two small gaps found in the review of #81 (bead rexcity-1rlsf).
GC_BIN's directory. The pane script puts the directory ofGC_BINon thePATH; a colon in it would split it into two entries, the first a prefix of the real directory.gcDirnow returns "" for such a directory, so the pane gets the runtime'sPATHas it is. The command still reaches the city'sgcthrough thegcfunction. New fragment.changelog/pane-gc-dir-colon.md.addMissingPaneswhere the record reads but the trial write fails had no test.TestAPaneIsNotReplacedAtEveryStartWhenItsRecordReadsButCannotBeWrittenshuts the state directory (mode 0500; skipped as root) and callsensureCityPanesdirectly, because a whole start fails earlier writing the agent's own record. It checks the pane is left alone and one warning comes per start. With the trial write removed the test fails.Verified locally:
go vet ./internal/...,go test ./cmd/... ./internal/... ./packs/...(all pass), and the changelog v2 check (valid=true).Bead: rexcity-1rlsf
Review of
59159e7c09for rexcity-1rlsf. Checks of the head: success.Verdict
pass
Findings
GC_BINgoes first on the pane'sPATHwheneverGC_BINis an absolute path, and that a program the command starts therefore finds the samegc. After this change neither holds for a directory with a colon in it. Adding a clause there ("unless its directory has a colon, which noPATHentry can hold") would bring the README in line withgcDirand the fragment. This edge case is rare, so the finding does not block.Verified
internal/rpp/citypanes.go,internal/rpp/panepath_test.go,.changelog/pane-gc-dir-colon.md). The PR has a description.gcDir(citypanes.go:193): it returns "" whenfilepath.Dir(GC_BIN)contains:. ThenpaneScriptskipsPATH=$4:$PATH, and the pane gets the runtime'sPATHunchanged. Thegcfunction still runs"$0", the fullGC_BIN, so a colon does it no harm. A colon in the file name only still gives the directory (asserted in the test).addMissingPanes:SavePaneCommandswrites throughos.CreateTempin the state directory, so mode 0500 does make the trial write fail, and the test exercises that branch. RunningensureCityPanesdirectly is justified: a whole start fails earlier, when it writes the agent's record.gcDir,TestAGCBinDirectoryWithAColonIsNotPutOnThePATHfails ("Should be empty, but was /opt/a:b"). With the trial write replaced by a no-op,TestAPaneIsNotReplacedAtEveryStartWhenItsRecordReadsButCannotBeWrittenfails (the replacement goes ahead and errors when it saves the tracked panes).origin/main(0653b94): clean. Forgejo reportsmergeable.go vet ./...passes, also with GOOS=darwin GOARCH=arm64 and GOOS=linux GOARCH=amd64.go test ./...passes.go test -raceofinternal/rppandinternal/statepasses. The new tests passed in all 5 runs of-count=5.v2(c19d67d) and run with-base=main -warn=missing-fragmentprintedvalid=true. The fragment holds only a### Fixedheading and its bullet, as REVIEW.md requires.