Repository navigation
test(shipping): answer the shipping tests from one fake GitHub - #240
Merged
Merged
Conversation
Both shipping test files dispatched on the query text themselves, and each compared the dequeue mutation with a fixed string. That check failed a query that differed only in spacing and passed a wrong input field on disablePullRequestAutoMerge. fakeGitHub holds each mutation's required input field in one table and answers the way the endpoint does: a query gets back only the fields it selects, and a mutation needs the right name, input field, variable type, and pull request id.
michael-denyer
force-pushed
the
shipping-shared-fake
branch
from
October 8, 2026 21:27
615fd7a to
0280c46
Compare
The field filter matched the nested id in mergeQueueEntry { id }, so the fake still returned the pull request id to a query that no longer selected it. The mutation pattern also refused a named operation, which GitHub accepts.
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.
watch-pr/shipping.test-helper.tswithfakeGitHub(pullRequest, argv), one fake ofgh api graphqlthat both shipping test files call. A two-row table holds the contract. Each row names a mutation's required input field and the pull request field the mutation clears.$idasID!, names a known mutation and its input field, and carries the pull request's node id. The fake ignores whitespace.shipping.test.tsandshipping-cli.test.tsdrop their own dispatchers and call the fake. That replaces the two guards fix(shipping): use GitHub dequeue input id #239 added, which compared the query text byte for byte, and removes a.callslog that no test read.Why
The guards from #239 catch the dequeue bug. They pass the same wrong-field mistake on
disablePullRequestAutoMerge, and they fail a query that differs only in spacing.Verification
All of these ran on this branch, rebased onto
mainatfee271bafter #239 merged.shipping.ts, each run againstbun test shipping. The fix(shipping): use GitHub dequeue input id #239 guards classify 2 of 6 correctly. The fake classifies 6 of 6. Four invalid queries fail, and the unmodified query and the reformatted query pass.idfails, and a dequeue mutation with an operation name passes.bun test orch watch-prreports 225 pass, 0 fail.bun run typecheckprints no diagnostics.bunx prettier@3.6.2 --checkpasses on the three changed files.bun tools/generate.mjs --checkreports 81 generated files current.Open risk
The contract table is a hand-kept copy of GitHub's schema, so no test fails if GitHub renames a field. The helper's header comment has the introspection command that regenerates the table.