Skip to content

Add Linear round-trip fidelity integration test (#3187)#3255

Open
harry-miller-trimble wants to merge 1 commit intogastownhall:mainfrom
harry-miller-trimble:linear-roundtrip-test
Open

Add Linear round-trip fidelity integration test (#3187)#3255
harry-miller-trimble wants to merge 1 commit intogastownhall:mainfrom
harry-miller-trimble:linear-roundtrip-test

Conversation

@harry-miller-trimble
Copy link
Copy Markdown
Contributor

Summary

Implements the round-trip fidelity integration test requested in #3187.

What's included

TestLinearRoundTripCoreFields — Full push→pull integration test that:

  1. Seeds 3 issues with varied priority (P0/P1/P3) and status (open/in_progress/closed)
  2. Pushes to a stateful mock Linear GraphQL server
  3. Pulls into a fresh database
  4. Asserts title, description, priority, status, and external_ref all survive the round-trip

TestLinearRoundTripRelationships — Skipped spec test documenting that parent-child hierarchy, blocking dependencies, and issue type do not yet survive a round-trip (push doesn't send parent/relation/label fields). Becomes a regression gate when those features land.

Mock server design

The mockLinearServer is a stateful httptest.Server that:

  • Only stores what the client actually sends (no fabricated fields)
  • Routes by string match on GraphQL operations (no parser needed)
  • Handles: issueCreate, issueUpdate, issues query, team states
  • Assigns sequential identifiers (MOCK-1, MOCK-2, ...)

Key design decisions

  • Engine-level testing (not CLI) — wires the same hooks as runLinearSync but avoids global state/flag noise
  • Matches by external_ref — pulled IDs are hash-generated so they won't match source IDs
  • Split into two tests — keeps assertions honest by only testing what the integration actually supports today

What's NOT asserted (documented gap)

Per the issue's assertion table, these fields are requested but push doesn't currently support them:

Property Current status
Epic parent Push doesn't send parentId
Dependencies Push doesn't create relations
Issue type Push doesn't send labels for type

The skipped spec test documents this gap and will automatically become a regression gate when those features are implemented.

Closes #3187

…#3187)

Add TestLinearRoundTripCoreFields which verifies that a push→pull
round-trip through Linear preserves title, description, priority,
status, and external_ref. Uses a stateful mock GraphQL server that
only stores what the client actually sends.

Also adds TestLinearRoundTripRelationships as a skipped spec test
documenting that parent-child, blocking deps, and issue type don't
yet survive the round-trip (push doesn't send these fields). This
becomes a regression gate when those features land.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 13, 2026

Codecov Report

❌ Patch coverage is 40.00000% with 3 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
internal/audit/audit.go 40.00% 2 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FR: Round-trip fidelity integration test

2 participants