fix(e2e): #111 — decouple 'privates Repo' assertion from Top-6 ranking#112
Conversation
TC-CNT-071 and TC-CNT-084 asserted the anonymized "privates Repo" label appears in the visible page (Top-6 table / main), which assumed a withheld-private repo ranks into the visible set. As the estate grew, the top withheld-private repo (126 tests) now ranks 8th — behind oakwoodgolfclub-website (129) — and folds into the Top-N rollup, so the literal label no longer renders visibly. Both tests have been red on main since 2026-07-03 (a required check → blocked every website PR). Fix: lift the positive assertion from the ranking-dependent rendered page to the ranking-independent invariant it actually means — that the withholding transform ran and produced anonymized rows in the served data (`scope.per_repo.some(r => r.repo === "privates Repo")`). The hard privacy guarantee is unchanged: TC-CNT-084's canary loop still asserts no raw private repo name ever renders on the page. Verified: full test-management spec 12/12 green under CI settings (CI=1, retries=2). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Sxyx5TvFWqVXYMfZoLztw
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughTwo e2e test cases (TC-CNT-071, TC-CNT-084) in test-management-page.spec.ts are updated to verify the withheld-private "privates Repo" row by loading and inspecting scope.per_repo data rather than checking rendered table text, avoiding dependence on Top-N ranking/rollup visibility. ChangesRanking-independent privacy assertions
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/e2e/test-management-page.spec.ts (1)
256-261: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueMinor: reuse a stored
scopevariable for consistency with TC-CNT-071.Line 261 calls
loadScope()inline instead of assigning it to a variable the way TC-CNT-071 does at Line 130. Functionally fine (cheap synchronous file read), just a small style inconsistency between the two updated tests.♻️ Optional consistency tweak
- expect(loadScope().per_repo.some((r) => r.repo === "privates Repo")).toBe(true); + const scope = loadScope(); + expect(scope.per_repo.some((r) => r.repo === "privates Repo")).toBe(true);🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/e2e/test-management-page.spec.ts` around lines 256 - 261, The test in loadScope currently calls the helper inline, but TC-CNT-071 uses a stored scope variable for consistency. Update the relevant assertion in test-management-page.spec.ts to assign the result of loadScope() to a local scope variable first, then use that variable in the per_repo check so the style matches the other updated test.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@tests/e2e/test-management-page.spec.ts`:
- Around line 256-261: The test in loadScope currently calls the helper inline,
but TC-CNT-071 uses a stored scope variable for consistency. Update the relevant
assertion in test-management-page.spec.ts to assign the result of loadScope() to
a local scope variable first, then use that variable in the per_repo check so
the style matches the other updated test.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 364af06d-12a9-4fe5-ab91-69ba63ae0fbc
📒 Files selected for processing (1)
tests/e2e/test-management-page.spec.ts
Fixes #111.
Problem
TC-CNT-071andTC-CNT-084asserted the anonymized"privates Repo"label appears in the visible page (Top-6 table /main), assuming a withheld-private repo ranks into the visible set. As the estate grew, the top withheld-private repo (126 tests) now ranks 8th — behindoakwoodgolfclub-website(129) — and folds into the Top-N rollup, so the label no longer renders visibly. Both tests have been red onmainsince 2026-07-03, andPlaywright E2Eis a required check → it blocked every website PR (incl. the ClearPath rename #110).Fix
Lift the positive assertion from the ranking-dependent rendered page to the ranking-independent invariant it actually means — the withholding transform ran and produced anonymized rows in the served data:
The hard privacy guarantee is unchanged:
TC-CNT-084's canary loop still asserts no raw private repo name (omnopsis-backend,snakeoil-check, …) ever renders on the page.Verification
Full
test-managementspec 12/12 green under CI settings (CI=1, retries=2). ESLint clean.Follow-up (optional, not in this PR)
A product-side alternative would surface the anonymized count in the rollup (e.g. "… und N weitere, davon M privat") so the label stays visible regardless of ranking — an estate-display decision for a later pass.
🤖 Generated with Claude Code
https://claude.ai/code/session_013Sxyx5TvFWqVXYMfZoLztw
Summary by CodeRabbit