Repository navigation
feat(tracker): trackerManifestContract, trackerManifestFake and trackerManifestFixture test a source from a manifest - #3120
Merged
Conversation
…erManifestFixture test a source from a manifest A tracker CLI made from wirecat.config.ts (linear-cli first) could not run trackerSourceContract: fakeTrackerSource is a TrackerSource, not a fake of the service, and the generated test synced over graphqlFake, which answers schema samples with no state. This is the tracker counterpart of #3088. - trackerManifestFake(manifest, { api, definitions, baseUrl? }) is cli-base's strict graphqlFake with three rows of each kind behind it. Each row is sampled within every selection its kind's calls send, with the values the map reads written where it reads them, and links to the first row of the kind a field points at (state.id, assignee.id, labels.nodes with each). Calls are answered within their selection, two rows a Relay page; a change read keeps rows at or after its since, oldest first; an operation taking includeArchived hides archived rows unless the call sets it. A call whose fixed variables match no manifest call, a cursor the fake never gave, an unreadable since and an answer of its own that breaks the schema are recorded in refusals. touch, archive and remove change a row. - trackerManifestFixture adds the source, held ids, a dead cursor and the faults skewed, change, archive and remove. - trackerManifestContract runs trackerSourceContract over it and fails a case whose calls the fake refused. - The Linear-shaped schema of source.test.ts moves to src/testing/ tracker-graphql.ts so both tests use it; its change call now sends orderBy, and issue labels use { each, id } as linear-cli does. - rowSelection is exported from the tracker manifest module. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t is, and an enum field is pinned by a test The generated wirecat-config.ts types SOURCE as a plain record, so the three helpers take the manifest as unknown and parse it, as trackerSourceFromManifest does; linear-cli's test needs no cast. The Linear-shaped schema gains an enum project status, and a test checks the fake writes one of its values, the one defect linear-cli's real schema showed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… apply, and names the refusal in the failed case
A review found manifests the contract passed although real Linear would
answer them differently:
- {since} was found by position and always read as updatedAt >= since, so
filter.createdAt.gte and filter.updatedAt.lt passed. A change call is now
refused unless {since} sits at <map updatedAt path>.gte or .gt; gt keeps
only rows strictly after it.
- Fixed variables only picked a route, so an ids call filtering out
canceled issues passed, though sync would mark them deleted. A list or id
call with a filter, and a change call whose filter holds anything beside
the since, are refused. Other variables are trusted, and TRACKER.md says so.
- trackerManifestContract now fails with the fake's refusals as the message
even when the source threw first, so a test can match why.
- TRACKER.md says the dead-cursor case is answered by the source itself and
never reaches the fake.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ission-key check does not read them as keys Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Task
A tracker CLI made from
wirecat.config.ts(linear-cli, the Linear pilot of the connector factory) could not runtrackerSourceContractover its source: there was no fake of the tracker built from the manifest, onlyfakeTrackerSourcein memory.cli-dev ready(cli-base #651) asks a tracker for that contract.Why
The tracker counterpart of #3088 (
crmManifestFake/crmManifestContract/crmManifestFixture), so the contract proves the manifest against a stateful fake of the service, not schema samples.What
trackerManifestFake(manifest, { api, definitions })over cli-base'sgraphqlFake: three rows per kind written where the map reads them, Relay pages,includeArchived, the{since}filter,touch/archive/remove.{since}that is not at<updatedAt path>.gte|gt, afilteron a list or id read, any change filter beyond the since. Refusals fail the case with their own message.trackerManifestFixture(held rows, dead cursor, faults) andtrackerManifestContract; docs/dev/TRACKER.md "The contract kit"; the Linear-shaped test schema moved tosrc/testing/tracker-graphql.ts.Testing
vitest run src/tracker: 64 passed; typecheck and docs:check clean.SOURCE: 10 of 10 contract cases (one-off check, not committed).Not covered
Date.parse), so a tracker's own refusal of an old page token is not tested.sampleWithin.🤖 Generated with Claude Code