Two fail-closed defects in the new lint isolation #103
Reference in New Issue
Block a user
Delete Branch "%!s()"
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?
Non-blocking findings from the PR #102
review. Both fail closed — they can abort or misdiagnose a lint run,
never report a false green — which is why they did not block the merge.
Both are one-to-three-line fixes.
1.
script/lint—prune_dead_cachescan still fail a lintscript/lint:174:The only unguarded command in the function. Under
set -eua failedcommand substitution in an assignment aborts the script, so a stale cache
with an unreadable marker makes
./script/lintexit 1 printing onlycat: .../worktree: Permission denied— without linting anything.This contradicts the intent recorded in the PR, that tidy-up can never
fail a lint. It is the same class of defect the author already caught and
fixed once during implementation (an
rm -rfon a read-only Go modulecache aborting the script), surviving in one remaining line.
Realistic trigger is two concurrent lints collecting the same stale
cache:
[ -f ]passes, then A'srm -rfunlinks the marker before B'scat. The reviewer could not win that race in 36 concurrent attempts, soit is narrow.
Fix:
2>/dev/null || trueon the substitution. The existing[ -z "$owner" ]branch already handles the empty result.2.
script/lint-audit— dependency paths misdiagnosed as contaminationscript/lint-audit:63-66classes any absolute path outside$ROOTor/srcas foreign. Inside the containerGOMODCACHE=/cache/go-mod, so alegitimate
typecheckfinding citing a dependency's source is rejectedas cache contamination, telling the user to clear their lint cache when
the real problem is a dependency error.
Fix: exempt
/cache/go-modand/cache/go-buildfrom the foreignset. Keep everything else rejecting — the guard's value is that it
refuses to certify a pass.
Definition of done
unreadable marker lints normally, and a capture containing a
/cache/go-mod/...path no longer produces the contamination message.script/lint-auditstill rejects the original #99signature and still never certifies a pass.
script/cibuildexits 0.Also worth correcting
The PR #102 body and its
issue comment state the dirty worktree exited 2; the reviewer observed
1, golangci-lint's default
issues-exit-code. Minor, but the numberis quoted as evidence.