You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
mypy audit silently passes when FORCE_COLOR is set: ANSI output parses as zero findings; pr_gates skips env -i when versions match #4551
bugUnintended behavior or logic failure in the engineci-cdContinuous integration, delivery, and automated runnerspriority: highCore feature broken, but workarounds existscope:infraCI, tooling, churn/factory, docs infrastructuretestingUnit, integration, and E2E pipeline verification
The local mypy audit can silently pass on code that CI rejects. Found on PR #4550, and the likely cause of the earlier local-pass/CI-fail on #4500 and #4529.
pr_gates.pinned_mypy_audit() uses the clean env -i pinned venv only when the local mypy version differs from tests/requirements-mypy.txt. When it matches (the shared selfscan venv has mypy 2.4.0), the audit runs in the caller's full environment.
With FORCE_COLOR=3 and TERM=xterm-256color in that environment, mypy writes ANSI colour codes even into a pipe. tests/mypy_audit.py's _ERROR_LINE regex then matches nothing, parses zero findings and prints "no NEW type errors". This is a silent false pass (confirmed by bisecting the environment).
"mypy used: …" is printed only on the pinned path, so the log does not show which mypy ran.
Acceptance criteria
mypy_audit.py makes colour impossible: pass --no-color-output (and/or set NO_COLOR=1, unset FORCE_COLOR/MYPY_FORCE_COLOR), and strip ANSI escapes before parsing.
The audit fails loudly (non-zero) when mypy produced output but zero lines parsed, or when mypy's own exit status contradicts the parsed result.
pr_gates always runs the audit in a clean environment (env -i plus the needed vars), whether or not the local version matches, and always prints "mypy used: ()".
Apply the same three checks to the ruff audit.
Regression test: with FORCE_COLOR=3 TERM=xterm-256color, a known type error is reported.
bugUnintended behavior or logic failure in the engineci-cdContinuous integration, delivery, and automated runnerspriority: highCore feature broken, but workarounds existscope:infraCI, tooling, churn/factory, docs infrastructuretestingUnit, integration, and E2E pipeline verification
Activity
ci: pr_gates tolerates a missing mypy/ruff when announcing the tool u…
ci: make the mypy/ruff audits colour-proof and always run them clean (#…