Skip to content

fix: Add service-qa skill for local Supabase CLI integration checks, improve merge queue UI - #247

Open
Ziinc wants to merge 16 commits into
mainfrom
cursor/service-qa-skill-26fc
Open

fix: Add service-qa skill for local Supabase CLI integration checks, improve merge queue UI#247
Ziinc wants to merge 16 commits into
mainfrom
cursor/service-qa-skill-26fc

Conversation

@Ziinc

@Ziinc Ziinc commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

Merge Queue UX polish plus service-qa skill work on this branch.

Rebase

  • Rebased onto latest main.
  • Resolved .claude/settings.json to keep both post-edit-docs-writing.sh (from main) and post-edit-service-qa.sh (this branch), alongside post-edit-app-qa.sh.

Lint / format

  • Ran npm run format (Biome) and npm run lint (oxlint + eslint + ast-grep).
  • Split MergeQueueTab presentational pieces into merge-queue-parts.tsx to satisfy max-lines.
  • Consolidated duplicate @tanstack/react-query imports.
  • Removed a forbidden inline comment in github-panel integration test.

Merge Queue UX

  • Tip-first stack cards on a continuous rail into the default-branch terminator.
  • Toolbar Merged checkmark to show/hide history below the tip; paginated Load more.
  • Tip row: [main] label + landed PR title; SHA right-aligned with ghost copy.
  • Stack help via tooltip; outline Remove; status on second row with LOC.

Test plan

  • Rebase onto main with conflict resolution
  • npm run format / npm run lint / npm run check (pre-rebase)
  • merge-queue screenshot specs (pre-rebase)
Open in Web Open in Cursor 

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mirrors app-qa/SKILL.md structure (when-to-use, subagent delegation, steps 1–7, keep-specs-around) so agents already fluent in app-qa can run service-qa without relearning the ritual.

  • Explicit split: app-qa keeps mocking Supabase; this skill owns the real CLI stack
  • Proactive trigger paths match the files that actually change Auth/RPC/Edge contracts

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Separate Vitest config (node env, own setup) so npm test stays runnable without Docker — same isolation pattern as vitest.screenshot.config.ts.

  • Health gate in test/setup.service-qa.ts fails the suite with service-qa:up instructions instead of skipping silently
  • fileParallelism: false avoids Auth Admin races when specs create users in parallel

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exercises the same RPC names/args as useMergeQueueEnabled / useSetMergeQueueEnabled against a seeded github_app_installations + github_repositories pair.

  • Asserts the migration contract that “no config row ⇒ false”, then toggle + unlinked-repo error
  • Keeps GitHub API out of scope — only the Postgres/RLS path the desktop toggle needs

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

recordOutcome is the service-side twin of app-qa’s captureDocument expectations — Vitest asserts prove the contract; the JSON checklist is what the agent re-reads in step 5.

  • Cap of 3 expectations matches the app-qa ast-grep discipline (enforced here in code since these specs aren’t under the screenshot lint path)
  • Lives under scripts/service-qa/.generated/ (gitignored) so runs don’t dirty the tree

Comment thread Makefile

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

start was listed in .PHONY and called by restart, but had no recipe — make restart was broken. Added supabase start and fixed the garbled db.ßdiff phony name while touching the file.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worked example for the desktop handoff useAuth.exchangeToken depends on: create_desktop_token RPC → functions/v1/exchange-desktop-tokensetSession.

  • Covers happy path, single-use rejection, and missing-body 400 — the three failure modes the Edge Function actually returns
  • Hits the live local function runtime; no vi.mock of src/lib/supabase

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Local CLI migrations run as postgres, whose default privileges only granted Dxtm to service_role/authenticated — not SELECT/INSERT. That broke seeding and Edge Functions that use the service role.

  • Restores DML grants + default privileges for future migrations
  • Required for real service-qa (and for local Edge to read desktop_auth_tokens)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

service-qa forces emailSignup: true even when package.json has it off for the shipped app/web UI.

  • Specs must use Auth email/password (signUp / signInWithPassword) — never OAuth
  • createTestUser throws if this override is somehow false

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setup/teardown fixture for merge-queue specs: email/password session + linked GitHub repo, always deleted in finally.

  • enableQueue / seedQueuedEntry hit real PostgREST (no stubs)
  • Teardown deletes the installation (cascades repos/queues) then Auth deleteUser

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lives under the screenshot harness (not scripts/service-qa/specs/) so Chromium can rasterize the DOM, but deliberately does not mock src/lib/supabase.

  • Seeds via service-qa email/password + linkGithubRepo, then supabase.auth.setSession on the app singleton so Settings/GitHubPanel RPCs use a real JWT
  • Stubs only the Pro gate (useAuth.subscription) and gh list helpers — Stripe FDW and GitHub CLI are out of scope for proving PostgREST
  • Asserts round-trip with live get_merge_queue_enabled / seeded get_repo_branch_queue_statuses before capture so a green PNG can’t come from a mock

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No row seeding. Three workspaces enter via HMAC pull_request labeled webhooks; CI via check_suite; merges via worker + MERGE_QUEUE_GITHUB_STUB.

  • Captures filled (Testing/Queued) then drained (all Merged) against live get_repo_branch_queue_statuses
  • React Query invalidated between phases so the tab reflects PostgREST, not stale cache

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Local supautils rejects DELETE without a WHERE clause, so every queue.drive failed before lanes could start.

  • Migration replaces the temp-table clear with DELETE … WHERE true and pg_temp. qualification
  • Unblocks the webhook → worker → CI → merge path used by service-qa

@cursor

cursor Bot commented Aug 10, 2026

Copy link
Copy Markdown

Added merge-queue-webhook-stacks.spec.ts + UI captures for a 2-stack + independent PR + 3-stack with mid sibling (7 PRs). Topology lives in scripts/service-qa/topologies.ts; drain asserts buildQueueStacks grouping then CI/merge until all merged.

@Ziinc Ziinc changed the title Add service-qa skill for local Supabase CLI integration checks fix: Add service-qa skill for local Supabase CLI integration checks, improve merge queue UI Aug 10, 2026
@Ziinc
Ziinc marked this pull request as ready for review August 10, 2026 20:06
cursoragent and others added 15 commits August 10, 2026 20:15
Mirror app-qa with a node/vitest harness that hits real local Auth, RPCs,
and Edge Functions (no mocked supabase-js), plus a post-edit hook and
worked-example specs for desktop token exchange and merge-queue RPCs.

Co-authored-by: Ziinc <Ziinc@users.noreply.github.com>
…ication

- Override emailSignup for service-qa; sign up/in via Auth email/password only
- Add withMergeQueueFixture setup/teardown for full merge-queue RPC coverage
- Fix public table GRANTs (008) so service_role/PostgREST can seed and Edge can run
- Bundle @supabase/supabase-js for offline Edge worker boot; scripts/service-qa/up.sh
- Verified 9/9 service-qa tests against local supabase start

Co-authored-by: Ziinc <Ziinc@users.noreply.github.com>
… bundle

Edge Functions import @supabase/supabase-js via deno.json → local
node_modules (installed by service-qa:up). Remove the esbuild bundle from
git; gitignore functions/node_modules.

Co-authored-by: Ziinc <Ziinc@users.noreply.github.com>
Prove Settings › Integrations and the GitHub Merge Queue tab drive real
RPCs/RLS (email/password session on the app singleton) instead of mocked
supabase-js or terminal/outcome stand-ins.

Co-authored-by: Ziinc <Ziinc@users.noreply.github.com>
Drive the Merge Queue tab through labeled webhooks and check_suite
completions (with MERGE_QUEUE_GITHUB_STUB) instead of seeding entries.
Fix reserve_next_merge_queue_lane DELETE for local supautils.

Co-authored-by: Ziinc <Ziinc@users.noreply.github.com>
Add a shared topology and webhook/UI drain specs that enqueue a two-stack,
an independent PR, a three-level stack, and a mid-tier sibling, then
CI/merge until every queue is drained.

Co-authored-by: Ziinc <Ziinc@users.noreply.github.com>
Rename testing chip to "Running checks", drop per-entry remove inside
stacks (outline Remove on the stack header only), and align the stack
accent border under the Layers icon.

Co-authored-by: Ziinc <Ziinc@users.noreply.github.com>
Default view lists only the live queue; fully merged stacks move below
the target-branch terminator when Show merged is on (paginated Load more).
Partially merged stacks stay active with the bottom PR labelled Merged
until the whole stack finishes.

Co-authored-by: Ziinc <Ziinc@users.noreply.github.com>
Each queue stack is a bordered card with Layers header and per-PR
+/- diff stats (shared DiffBar). Stats come from entry fields or
local workspace commit enrichment.

Co-authored-by: Ziinc <Ziinc@users.noreply.github.com>
One list-level rail paints through card backgrounds and gaps so every
PR node stays linked down to the target branch terminator.

Co-authored-by: Ziinc <Ziinc@users.noreply.github.com>
Render stacks tip-first so the next-to-merge PR sits above the target
branch terminator. Move Show merged into a toolbar under the Merge
Queue tab, matching the Issues/PRs filter bar.

Co-authored-by: Ziinc <Ziinc@users.noreply.github.com>
Show default-branch tip commit/PR on the terminator; use outline Remove
for singles; replace Show merged switch with a Merged checkmark control;
move status under the queue number; put stack help in a docs tooltip.

Co-authored-by: Ziinc <Ziinc@users.noreply.github.com>
Place the default-branch tip short SHA on the right of the terminator
row with a ghost copy button that copies the full commit id.

Co-authored-by: Ziinc <Ziinc@users.noreply.github.com>
Style the default-branch tip as a label with the landed PR title on the
same line. Return pr_title from get_repo_branch_queue_statuses.

Co-authored-by: Ziinc <Ziinc@users.noreply.github.com>
Extract presentational merge-queue pieces under 500 lines,
merge react-query imports, drop test inline comment, apply biome.

Co-authored-by: Ziinc <Ziinc@users.noreply.github.com>
@cursor
cursor Bot force-pushed the cursor/service-qa-skill-26fc branch from 0339e3d to 85075de Compare August 10, 2026 20:15
Conflict resolution during rebase onto main dropped conflict markers
into settings.json; keep app-qa, docs-writing, and service-qa hooks.

Co-authored-by: Ziinc <Ziinc@users.noreply.github.com>
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.

2 participants