@biffo/cli 0.242.0 → 0.243.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/scripts/verify.sh +40 -1
package/package.json
CHANGED
package/scripts/verify.sh
CHANGED
|
@@ -381,7 +381,46 @@ pytest_is_fast() {
|
|
|
381
381
|
# "Yes, CI runs this" and "there is no CI to ask" are not the same claim, and a
|
|
382
382
|
# repo that LOST its ci.yml must not read as maximally covered. The summary
|
|
383
383
|
# below says which one produced the run.
|
|
384
|
-
|
|
384
|
+
#
|
|
385
|
+
# ABSENT and UNREADABLE are not the same claim either, and collapsing them is
|
|
386
|
+
# #1218. `[ -f ]` is true for a file that exists but cannot be opened, so a
|
|
387
|
+
# `ci.yml` present-but-unreadable (a permissions oddity, a partial checkout) was
|
|
388
|
+
# falling into the same branch as "no CI to mirror" -- except it then made
|
|
389
|
+
# EVERY `ci_has()` call answer `grep`'s "cannot open" exit (2) exactly as it
|
|
390
|
+
# answers a genuine "not found" (1), because the `&&` every call site gates on
|
|
391
|
+
# does not distinguish them. Unlike a repo with no `ci.yml` at all, this repo
|
|
392
|
+
# LOOKS like it has CI (`NO_CI` never gets set), so the best-effort fallback
|
|
393
|
+
# never fires either -- every ci_has()-gated check just silently vanishes from
|
|
394
|
+
# the run, with nothing in the summary naming what went missing. That is worse
|
|
395
|
+
# than "ran nothing": checks that do not gate on `ci_has` (JS lint/format among
|
|
396
|
+
# them) still run and pass, so the gate does not even reach the "ran NOTHING"
|
|
397
|
+
# branch below -- it prints `verify passed` having covered less than it claims.
|
|
398
|
+
#
|
|
399
|
+
# So this is decided ONCE, here, before a single check runs -- not rediscovered
|
|
400
|
+
# independently at each of the eight `ci_has()` call sites, where a per-site fix
|
|
401
|
+
# is exactly the kind of second copy that drifts (AGENTS.md's `_extract_detail`
|
|
402
|
+
# point). "Cannot tell what CI requires" fails the whole gate immediately, in
|
|
403
|
+
# the estate's three-valued convention (0 green, 1 failed, 2 cannot tell --
|
|
404
|
+
# wait-for-checks.sh, branch-health.sh, claim.sh): 2 is never a pass, and
|
|
405
|
+
# letting the rest of the gate run anyway would produce a partial,
|
|
406
|
+
# misleadingly-labelled PASS on top of a question it already could not answer.
|
|
407
|
+
CI_YML_UNREADABLE=""
|
|
408
|
+
if [ -f .github/workflows/ci.yml ]; then
|
|
409
|
+
[ -r .github/workflows/ci.yml ] || CI_YML_UNREADABLE=1
|
|
410
|
+
else
|
|
411
|
+
NO_CI=1
|
|
412
|
+
fi
|
|
413
|
+
|
|
414
|
+
if [ -n "$CI_YML_UNREADABLE" ]; then
|
|
415
|
+
printf '\n\033[31mverify: CANNOT TELL - .github/workflows/ci.yml exists but could not be read\033[0m\n'
|
|
416
|
+
printf 'Permissions, a partial checkout, or a filesystem error -- not "no CI to\n'
|
|
417
|
+
printf 'mirror" (that is a missing ci.yml, handled separately, and does not\n'
|
|
418
|
+
printf 'block). Every check gated on ci_has() would silently be skipped and the\n'
|
|
419
|
+
printf 'gate would still report an unqualified pass, having covered less than it\n'
|
|
420
|
+
printf 'claims (biffo-template#1218).\n'
|
|
421
|
+
printf 'Fix the permissions (or the checkout) and re-run.\n\n'
|
|
422
|
+
exit 2
|
|
423
|
+
fi
|
|
385
424
|
|
|
386
425
|
ci_has() {
|
|
387
426
|
[ -n "${NO_CI:-}" ] && return 0
|