fix: two silent-failure defects in the Plane sync path - #371
Closed
DrumRobot wants to merge 2 commits into
Closed
Conversation
INDEX_LINE_RE matched the identifier prefix with [A-Z]+, so an index line from a workspace whose project identifier contains a digit (ES6KR-117) never matched. plane_sync then reported "0 index lines" and left every marker unsynced — a silent no-op rather than a loud failure, which is why the gap went unnoticed. Widen the prefix to [A-Z][A-Z0-9]* (still letter-initial, so a purely numeric [123-4] is not absorbed) and cover both directions with a regression test.
create_via_k3s_fallback() returns before subprocess.run() when kubectl is absent from PATH, so the escaping test asserted on ambient tooling rather than on the behaviour it names. It failed in a pre-push run whose hook environment had no /usr/local/bin, and would fail on any CI host without kubectl installed. Stub shutil.which the same way test_k3s_fallback_skips_gracefully_without_kubectl already does, so the test exercises the escaping path unconditionally.
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.
Two independent silent-failure defects surfaced while running a Plane intake flow end to end. Both are
fixtype, so this is a patch bundle targetingnext-fix.1.
INDEX_LINE_REnever matched digit-bearing project identifiersplane_sync.pymatched the Plane identifier prefix with[A-Z]+. Any workspace whose project identifier contains a digit —ES6KR-117— therefore matched no index line at all.The failure mode is what made this expensive:
plane_syncreportedNo changes (0 index lines moved to completed/cancelled)and exited 0. There was no error to notice, so an entire workspace's Plane sync was inert while looking healthy.INFRA-12matched fine, which is why the gap survived.Widened to
[A-Z][A-Z0-9]*. Still letter-initial, so[123-4]is not absorbed as an identifier. Covered in both directions by a new regression test.2. The k3s-fallback escaping test depended on ambient
kubectlcreate_via_k3s_fallback()returns early whenshutil.which("kubectl")isNone, before it ever reachessubprocess.run.test_k3s_fallback_script_survives_quote_in_workspace_slugnever stubbed that lookup, so on a host withoutkubectlthe function short-circuits and the test fails onassert captured_cmd— asserting on ambient tooling rather than on the escaping behaviour it is named for.This is not hypothetical: it failed a real
pre-pushrun whose hook environment did not carry/usr/local/bin, blocking a push ofmain+next-fix. It would fail the same way on any CI host withoutkubectlinstalled.Stubbed
shutil.whichthe way the sibling testtest_k3s_fallback_skips_gracefully_without_kubectlalready does, so the escaping path runs unconditionally.Test plan
uvx --from pytest pytest testsin the worktree → 95 passed, 4 skipped (94 before; +1 new regression test)INDEX_LINE_RE.match()returnedNonefor a realES6KR-117index line, andplane_sync --dry-runreported0 index linesagainst a tracker that contained onePATHstripped ofkubectl,create_via_k3s_fallbackreturnedkubectl not available on PATHandsubprocess.runwas never called — exactly the observed assertion failureenv PATH=/opt/homebrew/bin:/usr/bin:/bin uvx --from pytest pytest tests/test_plane_profile.py→ 6 passed (nokubectlon that PATH)