Conversation
The step sits in `l1-traceability.yml`, one of the four workflows that can block
a merge. Two independent bugs, either one sufficient.
`$BASE_BRANCH` was empty. It is computed at lines 47 and 119, each inside its own
`run:` block and each with `env: BASE_REF: ${{ github.base_ref }}`. This step had
no `env:` block, and every `run:` is a fresh shell, so the command executed as
`git diff origin/..HEAD` and printed
fatal: ambiguous argument 'origin/..HEAD': unknown revision or path not in
the working tree.
in the log of every successful run.
The `if` tested the wrong exit code. `a | b | head` returns head's status, 0
whether or not grep matched, with no `pipefail` set -- so the warning branch was
unconditional and the green branch has never executed.
Reproduced in a two-commit repository with a deterministic matcher rather than
`grep -P`, because Apple's `grep -P` does not behave like GNU's and verifying
this on macOS with grep measures the wrong thing:
old logic, pure ASCII -> WARNING
fixed, pure ASCII -> green
fixed, one Cyrillic file -> WARNING
fixed, BASE_REF unset -> WARNING (defaults to master, finds it)
A warning that is always on is indistinguishable from one that is never on. It
is `::warning::` and not `::error::`, which is why a fabricated step inside a
required workflow went unnoticed for the workflow's whole history.
Closes #2917
Contributor
|
📓 NotebookLM Notebook linked to this PR
This notebook contains session context, decisions, and artifacts for this work. |
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A step inside one of the four workflows that can block a merge, which has never
read a file.
Both lines appear, in that order, in the log of every successful run.
Two independent bugs
$BASE_BRANCHwas empty. Computed at lines 47 and 119, each in its ownrun:block, each withenv: BASE_REF: ${{ github.base_ref }}. This step had noenv:block. Everyrun:is a fresh shell.The
iftested the wrong exit code.a | b | headreturns head's status —0 whether or not grep matched — and no
pipefailis set. The warning branch wasunconditional; the green branch has never executed.
Verification
Reproduced in a two-commit repository, with a deterministic matcher rather than
grep -P: Apple'sgrep -Pdoes not behave like GNU's, so verifying this onmacOS with
grepmeasures the wrong thing.BASE_REFunsetThe first row is the control: on clean input the old logic still warns.
Why it survived
A warning that is always on is indistinguishable from one that is never on. And
it is
::warning::, not::error::, so it never failed a run — which is how afabricated verdict inside a required workflow went unnoticed.
Closes #2917