Repository navigation
test: the pinned-server prerequisites refuse a submodule checkout off the recorded commit (#469) - #473
Merged
Conversation
… the recorded commit (#469) Discovery now reads the index gitlink for external/opencode and the submodule's checked-out HEAD, and refuses the module when they differ or cannot be read, naming the command that fixes it. A stale checkout had let a gate run the previous upstream while the repository recorded the new one. The Bun version read and the two git reads share one process helper, and the existing rows reach FindAsync through a matching-commit helper.
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.
What
OpenCode.Sdk.Tests' discovery guard now refuses the module whenexternal/opencodeis not checked out at the commit this repository records, and names the command that fixes it.Fixes #469.
Why
On 2026-10-18 a gate worktree's gitlink named v2.0.32 (#465), but its submodule was still checked out at v2.0.29 (
git submodule statusshowed+). The guard checked the checkout's presence, its install and the Bun version, but not which commit was checked out. Every pinned-server test therefore ran a 2.0.29 server, and the suite passed. The env-precedence proof (#470) was the first test that can tell the two versions apart, and it exposed this.The change
tests/OpenCode.Sdk.Tests/Harness/PinnedServerPrerequisites.cs:FindAsynctakes the recorded commit and the checked-out commit.git ls-files -s -- external/opencode. That is the same entrygit submodule statuscompares against, so a staged gitlink counts.git -C external/opencode rev-parse HEAD.OPENCODE_SDK_TESTS_BUN_MISMATCHvalue, then missing source with its early return. The commit problems come next, followed by the Bun and install problems.PinnedServerPrerequisitesTests:FindAsyncthrough a matching-commit helper, with assertions unchanged.tools/jscpd/tests.baseline.jsononly removes two entries,482c654299e74350and57470feca6bbb65f. They are the duplicated arranges that the helper eliminated, and nothing is added.CI is unaffected: a fresh checkout's submodule always matches.
Proof
Each mutant is a compiling edit to the guard, run on net10.0 and on net472 and then restored:
&& string.IsNullOrEmpty(checkedOutCommit))FindAsync_Should_Name_A_Wrong_Checkout_Before_A_Missing_Installis red. The&& falseform is rejected by S1125, a second guard.FindAsync_Should_Name_A_Mismatch_Typo_Before_Missing_Sourceis red.Checks:
OpenCode.Sdk.Tools.Testsproject: 2072 of 2072.verify-clones: exit 0, tests at 4.97%, 0 new.6d3d93eb(masterdf25ea59): every step including the new submodule and pinned-install steps, and 10,805 tests with 0 failed.Provenance
Sol Fast drafted the guard and the rows, then made a fix pass. The coordinator finished the remaining items by hand, because that was cheaper than a third dispatch:
The coordinator also verified the evidence and ran the local check.
Need help on this PR? Tag
@codesmith-botwith what you need.