Skip to content

test: key Feature Previews and IPC channel counts per item so concurrent merges stay green - #37678

Merged
KiroCrewCaptain merged 1 commit into
mainfrom
crew/linuxflackyguard/merge-safe-frontend-counts
Nov 15, 2026
Merged

KiroCrewCaptain merged 1 commit into
mainfrom
crew/linuxflackyguard/merge-safe-frontend-counts

Conversation

@bolichen97

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: The Feature Previews and Electron IPC channel tests stay green on main when two pull requests that were each green on the same base both merge.

Both tests pinned one shared total. Two PRs that each add one item rewrite that number to the same value, git merges the identical edit cleanly, and main holds one item more than the number says. On origin/main in the last 30 days the switch count toHaveLength(17) was re-pinned 13 times, INFO_TIP_COUNT 12 times, and the IPC totals 47 / 48 10 times each.

Why it matters

A red main fails every open PR's CI until someone re-pins the number, and the re-pin itself races the next one.

Not a goal

  • No product code changes; tests only.
  • No loosening: every record stays an exact comparison, now one line per item.
  • settingsCoverage.test.ts is already keyed per file and stays as is.

What changed (motivation → approach → change)

Test Why it went red after a merge Change
website/src/test/previewSurfaces.test.tsx: two tests waiting for toHaveLength(17) switches One shared switch total A FEATURE_PREVIEW_ROWS table, one line per switch label, with whether the row carries an InfoTip. The tests wait until the rendered rows deep-equal the table
same file: INFO_TIP_COUNT = 15 One shared total Derived from the table: rows with a hint, minus Decisions (its tip is already in its own exact button set)
website/electron/test/ipc-registrar.test.js: registerShell owns the exact shell channel set… h.handlers.size + h.listeners.size == 47 (and + 1 == 48) beside exact sorted SHELL_HANDLES / SHELL_LISTENERS lists that already decide the set Drop both totals. Keep the exact lists (one channel per line) and a non-empty check

The rule is the one in docs/system-specs/common/testing-conventions.md § Merge-safe ratchets and counts (PR #37660).

Backwards compatibility

Compatible: test files only.

Removes nothing: each dropped total was either implied by an exact list that stays, or is now computed from the per-item table.

Tests

Two-branch merge simulation (scratch clone; A and B cut from one base, each adds one item in a different place and updates the record exactly as the test asks, then git merge):

Scenario origin/main this branch negative control (this branch, item added but record not updated)
preview rows: A and B each add a hinted switch clean merge, FAILED expected { tips: 17, ingress: [] } to deeply equal { tips: 16, ingress: [] } clean merge, 39 passed 3 FAILED, deep-equal names the extra label
IPC channels: A adds ipcMain.handle("sim:alpha"), B adds ipcMain.on("sim:beta") clean merge, FAILED expected: 48 actual: 49 clean merge, 56 passed FAILED, deep-equal names 'sim:beta'

In the preview scenario the old switch-count wait (pinned 18, 19 rendered) also passed by timing: waitFor read 18 switches before the Decisions card rendered. The new wait compares labels, so a table that misses a rendered row never matches.

On this branch rebased onto current main: previewSurfaces.test.tsx 39 passed; ipc-registrar*.test.js 93 passed; npx tsc -p tsconfig.app.json exit 0; eslint clean on both files.

Proof: not provable -- test-only change

Manual verification

N/A — tests only; the simulation above is the behavioral check.

Related Issues

Part of #37656

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners November 15, 2026 19:41
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ⏭️ skipped

Revision a16658a3466594ea6249f2352887918415e67586 ships no reviewable capability (docs, tests or generated files only), so there is nothing to inventory. Does not block merge.

@github-actions

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

UX-level review of a16658a3466594ea6249f2352887918415e67586 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

UX-Verdict: PASS

Nothing to check. The PR only changes two test files and nothing a user sees, so the missing screenshots and blind read leave no evidence gap.

[UX-REVIEWED] a16658a

Description read

[DESCRIPTION-READ] be33393c72717cc2e28d630eafbd08ed233a8d1fb88e3d948a1034236f82b2ec

That sha256 names everything this verdict read: the PR description, plus the 3 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of a16658a3466594ea6249f2352887918415e67586 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: the change only touches tests, every check is still exact, and each pinned total is now either computed from a per-item table or already implied by an exact list that stays.

Notes

  • renderedRows() builds an object with Object.fromEntries, so two switches with the same aria-label would merge into one key. A duplicated row would then pass. Comparing the sorted entries as an array would catch it at the same cost.

[DESIGN-REVIEWED] a16658a

Description read

[DESCRIPTION-READ] 89c7f68ea96bcfc89dc20543777c1786752150be0a2a91b36148cb513bffcde9

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed a16658a3466594ea6249f2352887918415e67586 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] a16658a

Verdict parsed from the review's SHA-scoped output markers for commit a16658a3466594ea6249f2352887918415e67586.

False positive or not applicable? A repository writer can comment:
/ai-review override fable a16658a3466594ea6249f2352887918415e67586 false-positive: <reason, 20 to 500 characters>

@github-actions

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of a16658a3466594ea6249f2352887918415e67586 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] a16658a

False positive or not applicable? A repository writer can comment:
/ai-review override gpt a16658a3466594ea6249f2352887918415e67586 false-positive: <reason, 20 to 500 characters>

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Nov 15, 2026

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I reviewed head a16658a. This is a test-only change: each shared count is replaced by a per-item record. I ran both changed test files on this head and they passed: 39 Feature Previews tests and 93 IPC registrar tests. I also checked that removing a row from the new table, or flipping its hint flag, makes the row-matching tests fail, so the new check is not vacuous. The computed InfoTip count gives the same value as the old pin, and the exact sorted channel lists still fully pin the IPC set, so dropping those totals removes no coverage. Nothing blocks.

@KiroCrewCaptain
KiroCrewCaptain merged commit 57eba16 into main Nov 15, 2026
96 of 97 checks passed
@KiroCrewCaptain
KiroCrewCaptain deleted the crew/linuxflackyguard/merge-safe-frontend-counts branch November 15, 2026 20:48
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 15, 2026
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