Back to Plate

CI Check Investigation

docs/plans/2026-04-16-ci-barrel-drift.md

53.0.51.5 KB
Original Source

CI Check Investigation

Goal

Fix the failing PR CI check.

Findings

  • The screenshot was from an older run. The current failing check on PR #4945 was CI, not Fail on barrel drift in PR.
  • gh log inspection showed the first real failure in packages/suggestion/src/lib/transforms/deleteSuggestion.spec.ts.
  • Root cause 1: deleteSuggestion.ts now calls editor.api.range() and editor.api.isEnd(), but the lightweight mock editor in deleteSuggestion.spec.ts did not provide those APIs.
  • After fixing that seam, pnpm check exposed root cause 2: apps/www/src/registry/ui/suggestion-node.tsx now falls back to suggestion.dataList(...), but media-video-node.spec.tsx mocks only suggestionData, not dataList.
  • The durable fix was to keep the lightweight tests, update the mock surface where appropriate, and make the UI helper tolerate partial suggestion mocks.

Plan

  1. Inspect the PR checks and logs.
  2. Check existing learnings around CI drift and mock-surface drift.
  3. Reproduce the failing specs locally.
  4. Apply the minimal durable fix and rerun verification.

Result

  • Updated packages/suggestion/src/lib/transforms/deleteSuggestion.spec.ts to provide the new range and isEnd editor APIs expected by deleteSuggestion.ts.
  • Updated apps/www/src/registry/ui/suggestion-node.tsx so the child-text fallback only calls suggestion.dataList when that API exists.
  • Verified with targeted specs, package build/typecheck, lint, and a full pnpm check.