Repository navigation
fix(oracle): fail closed when a named engine cannot be used - #22
Merged
Merged
Conversation
NETSPEC_KICAD_CLI, and the explicit argument behind it, were treated as the first entry in a candidate list. When the named engine did not probe, discovery fell through to the next one and the run succeeded against a different engine than the caller asked for, with nothing said on stdout, stderr, or in the report. The variable is presented as authoritative -- it is what the tool's own "no working kicad-cli found" message tells you to set. It is set to pick a specific engine: a second KiCad, a build under test, a pinned CI toolchain. A typo or a stale CI path therefore produced a green run against the wrong oracle, and `can do` is computed from that engine's version, so the substitution also changed what the tool claimed to check. A named engine that cannot be used is now an environment fault under D10: exit 4, naming the path and why it was rejected. Unnamed candidates (PATH, Flatpak, macOS, Windows) still fall through, since nobody asked for those specifically. Recorded as D10.1. Closes #17
Connectivity unchanged
|
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.
NETSPEC_KICAD_CLI, and theexplicitargument behind it, were treated as the firstentry in a candidate list. When the named engine did not probe, discovery fell through
to the next one and the run succeeded against a different engine than the caller
asked for, with nothing said on stdout, stderr, or in the report.
Why fall-through is the wrong default here
The variable is presented as authoritative -- it is what the tool's own error message
tells you to set. Someone sets it precisely because they need a specific engine: a
second KiCad, a build under test, a pinned CI toolchain. A typo or a stale CI path
therefore produced a green run against the wrong oracle.
can dois computed from thatengine's version, so the substitution also changed what the tool claimed to have
checked.
This takes option 1 from the issue, which is the direction the issue itself
expected.
Verified
Before, with a working Flatpak KiCad present:
After:
Controls, both confirmed unchanged: with no override, discovery still finds the Flatpak
engine at exit 0; with a valid override, it is still used and reported as
origin=env. Unnamed candidates (PATH, Flatpak, macOS, Windows) still fall through --nobody asked for those specifically, so trying the next one is the whole point.
Depends on #18
Without it this change would have turned a silent wrong-engine run into an unhandled
traceback, because
KiCadNotFounddid not reach the exit-4 handler. #18 landed firstand this is rebased on it.
Tests
New
tests/test_discovery.py, 6 tests. The 4 positive ones were confirmed to go redwith the source change reverted; the 2 controls (a working override is still used,
unnamed candidates still fall through) stay green either way.
Worth noting: my first draft of two of these passed without the fix. With every
candidate failing to probe, the ordinary fall-through path already raises with the bad
path in its
Tried:list, so asserting only that the path appears proved nothing. Bothnow arrange for a working alternative engine to exist, so only failing closed can
produce the expected result.
just checkandjust testgreen: 236 passed, 6 skipped (baseline 227).Recorded as D10.1 in
docs/DECISIONS.md.Closes #17