mirror of
https://github.com/kuhyx/testsAndMisc.git
synced 2026-11-24 17:36:19 +01:00
Compare commits
No commits in common. "d255288e06eb9df3b71eb05a13ab70350a34fecc" and "7decc499cbb54ab716b15fc67c6c0f7256d4f2e8" have entirely different histories.
d255288e06
...
7decc499cb
15
.github/workflows/pre-commit.yml
vendored
15
.github/workflows/pre-commit.yml
vendored
@ -29,7 +29,6 @@ jobs:
|
||||
path: .utils
|
||||
|
||||
- uses: actions/setup-python@v5
|
||||
id: setup-python
|
||||
with:
|
||||
python-version: "3.x"
|
||||
# See the note in python-tests.yml: caches the pip download cache,
|
||||
@ -128,22 +127,10 @@ jobs:
|
||||
# pre-commit builds a virtualenv per hook repo on first use, which is
|
||||
# slower than the pip install itself. Keyed on the hook definitions, so
|
||||
# it invalidates exactly when a hook's repo or rev changes.
|
||||
# The interpreter goes in the key, resolved rather than typed. A
|
||||
# `language: python` hook env is built by whichever Python pre-commit ran
|
||||
# under, and restoring one built by a different release is silent: the
|
||||
# hooks keep working right up to the first syntax the old interpreter
|
||||
# cannot parse. This key said `py3.12` as a literal while the job had
|
||||
# moved to `3.x`, so 3.14-only source (PEP 758's `except A, B:`) reached
|
||||
# pylint and the debug-statement hook running on a cached 3.12.14 and
|
||||
# came back as "multiple exception types must be parenthesized" -- a
|
||||
# failure with no local reproduction, since developer caches were built
|
||||
# on 3.14. `steps.setup-python.outputs.python-version` cannot drift from
|
||||
# what was actually installed.
|
||||
- uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/pre-commit
|
||||
key: >-
|
||||
pre-commit-${{ runner.os }}-py${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('.pre-commit-config.yaml') }}
|
||||
key: pre-commit-${{ runner.os }}-py3.12-${{ hashFiles('.pre-commit-config.yaml') }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
|
||||
@ -1,36 +0,0 @@
|
||||
{
|
||||
"intent": "Make the CI-baseline guard's own error message tell the whole truth: the fix-forward escape hatch has to be given at commit AND at push, because the hook runs at both stages.",
|
||||
"scope": [
|
||||
"meta/scripts/check_ci_green.sh: the header comment and the failure hint",
|
||||
"Non-goal: changing when the guard fires, what it checks, or the semantics of CI_GREEN_SKIP"
|
||||
],
|
||||
"changes": [
|
||||
"Header comment now documents both invocations and why the second is needed (the pre-push CI mirror re-runs pre-commit in a clean worktree against the same still-red baseline)",
|
||||
"Failure hint now prints `CI_GREEN_SKIP=1 git push` beneath the commit form, plus one line naming the mirror as the reason"
|
||||
],
|
||||
"verification": [
|
||||
{
|
||||
"command": "shellcheck meta/scripts/check_ci_green.sh",
|
||||
"result": "pass",
|
||||
"evidence": "shellcheck OK (no output)"
|
||||
},
|
||||
{
|
||||
"command": "CI_GREEN_SKIP=1 bash meta/scripts/check_ci_green.sh",
|
||||
"result": "pass",
|
||||
"evidence": "check_ci_green.sh: CI_GREEN_SKIP is set / skipping the CI-baseline check (pre-push ci-mirror is the real gate). exit 0"
|
||||
},
|
||||
{
|
||||
"command": "bash meta/scripts/check_ci_green.sh",
|
||||
"result": "pass",
|
||||
"evidence": "silent, exit 0, against a main that is green as of 6eb70de0"
|
||||
}
|
||||
],
|
||||
"risks": [
|
||||
"The red path's exact wording is not covered by a test; there is no test file for this script in the repo, so a future edit could break the hint without failing anything.",
|
||||
"If ci_mirror.sh ever starts scrubbing the environment, the documented push form stops working and this message becomes wrong."
|
||||
],
|
||||
"rollback": [
|
||||
"git revert the commit; the change is comment and printf text only, so nothing depends on it.",
|
||||
"After rollback, confirm the guard still exits 0 on a green main and 1 on a red one."
|
||||
]
|
||||
}
|
||||
@ -18,13 +18,8 @@
|
||||
# failing is how a red baseline gets buried under changes that make it harder
|
||||
# to bisect.
|
||||
#
|
||||
# Bypass for a deliberate fix-forward commit. It must be given TWICE, because
|
||||
# this hook runs at both stages: once at commit, and again inside the pre-push
|
||||
# CI mirror's clean-worktree `pre-commit` run, which sees the same still-red
|
||||
# baseline. The variable is read from the environment and the mirror does not
|
||||
# scrub it, so exporting it for the push carries through:
|
||||
# Bypass for a deliberate fix-forward commit:
|
||||
# CI_GREEN_SKIP=1 git commit ...
|
||||
# CI_GREEN_SKIP=1 git push
|
||||
# ============================================================================
|
||||
|
||||
set -euo pipefail
|
||||
@ -81,8 +76,6 @@ if [[ ${#failed[@]} -gt 0 ]]; then
|
||||
printf '\nCommitting more work onto a failing baseline buries the breakage.\n' >&2
|
||||
printf 'Fix it first, or if THIS commit is the fix:\n' >&2
|
||||
printf ' CI_GREEN_SKIP=1 git commit ...\n' >&2
|
||||
printf ' CI_GREEN_SKIP=1 git push\n' >&2
|
||||
printf '(both: the pre-push CI mirror re-runs this same check.)\n' >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user