Skip to content

test: remove copy inventories and redundant formatter replays - #35890

Merged
OrcaWin merged 1 commit into
mainfrom
test-audit-749-copy-inventories
Oct 29, 2026
Merged

OrcaWin merged 1 commit into
mainfrom
test-audit-749-copy-inventories

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 10 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​3 $\color{#cf222e}{\Huge{\mathbf{−}}}$​546 $\color{#cf222e}{\Huge{\mathbf{−}}}$​543
Prod 0 0 0 0

Remove tests that copy catalog entries, inspect translation call arguments, or replay the same formatter against itself. Deletes six entire copy-wrapper suites and trims four others, including the Cartesian failure-formatter replay: 28 authored test registrations (29 expanded cases) removed.

Preserves 19 registrations (24 cases) across seven suites for locale-sensitive message assembly, nested placeholder preservation, timeout parsing, diagnostic composition, provider-error precedence, discard-error paths, and stable plugin ordering. Production code is unchanged.

Validation: static registration/body/support checks, formatting, lint, and reference/routing scans passed. Full PR CI will validate the change; no local runtime tests were run.

@greptile-apps

greptile-apps Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 4/5

[Low impact] The changes stay in renderer test files and leave runtime behavior alone.

The PR appears safe to merge, with non-blocking gaps where useful behavior tests are removed alongside copy checks.

Summary

Removes six test suites and trims four others. Production code is unchanged.

  • Renderer tests drop repeated copy checks and keep focused behavior checks.

Reviews (1) · Last reviewed commit: "test: remove copy inventories and redund..." · Reviewed by Greptile

@greptile-apps

greptile-apps Bot commented Oct 29, 2026

Copy link
Copy Markdown

Comments Outside Diff

These findings could not be posted inline.

  • P2 Plugin decisions lose tests src/renderer/src/components/plugins/presentation/plugin-status-presentation.test.ts:67 ▶

    These assertions check behavior, not just displayed words: a crashed plugin still counts as enabled, and a pending plugin needs review even without needsReconsent. The remaining sorting test cannot catch changes to either decision. Keep these assertions so later changes cannot silently break the Off switch or skip review.

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

  • P2 Host fallback loses tests src/renderer/src/components/right-sidebar/ai-vault-scan-issue-copy.test.ts:50 ▶

    The deleted fallback tests check behavior, not copied translations. Unknown codes, inherited names such as toString, and known codes with missing values must return the host's original message. These decisions live separately in the renderer helpers, and the surviving tests do not cover them. Keep a small set of fallback assertions while removing the catalog comparisons.

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

  • P2 Pet name rules lose tests src/renderer/src/components/pet/pet-import-failure-text.test.ts:43 ▶

    Deleting this suite also removes the only checks that customPetLabel translates default names but leaves user-chosen names alone. That is a separate decision from copying error strings. Keep this test, or move it to a focused customPetLabel suite.

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Walkthrough

The changes modify renderer tests only. They remove tests for localized error messages, English fallbacks, and plugin status helpers. The native-chat tests now check failure wording across English, Spanish, French, Japanese, Korean, and Chinese.

Priority: Low

Merge Risk: Low · up to db0e7

The change weakens protection against future status and error-message regressions. It is mergeable with awareness of those coverage gaps.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Description check Warning The description explains the main changes, rationale, preserved coverage, and validation status. However, it omits required template sections, including ELI5, Linked Issue, Visual Proof or an explicit… Add the required template sections. Include an issue link after “Fixes #”, state “N/A” with a reason for Visual Proof because production behavior is unchanged, document testing platforms and completed checks, and complete the Notes and Chec…
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the removal of redundant test coverage and copy inventories, which matches the primary changes.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 2 files.

Full details: Description check

Explanation

The description explains the main changes, rationale, preserved coverage, and validation status. However, it omits required template sections, including ELI5, Linked Issue, Visual Proof or an explicit N/A, Testing checkboxes, Notes, and Checklist items.

Resolution

Add the required template sections. Include an issue link after “Fixes #”, state “N/A” with a reason for Visual Proof because production behavior is unchanged, document testing platforms and completed checks, and complete the Notes and Checklist items.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nitpick comments: 3
src/renderer/src/components/plugins/presentation/plugin-status-presentation.test.ts: 1

2-2: Trivial · Functional Correctness · Quick win

Retain focused tests for plugin status contracts.

The remaining attention-order test indirectly covers only the error and pending cases. It does not cover the removed kill-list and review precedence, Stopped wording, enabled-state mapping, or direct review detection. Keep compact regression tests for these helper contracts.

src/renderer/src/components/right-sidebar/ai-vault-scan-issue-copy.test.ts: 1

40-42: Trivial · Functional Correctness · Quick win

Restore vault-scan fallback regression coverage.

The wire validator permits arbitrary messageCode values and incomplete metadata. The surviving uncoded test does not detect regressions for unknown, prototype-like, or incomplete recognized codes. Restore these focused cases so the host-message fallback remains covered.

Suggested fix
@@
   })
 
+  it('shows the English message for uncoded, unknown, or incomplete issues', async () => {
+    await useSpanish()
+    expect(aiVaultScanIssueDisplayText({ message: 'Old host text' })).toBe('Old host text')
+    expect(
+      aiVaultScanIssueDisplayText({
+        message: 'Newer',
+        messageCode: 'futureCode'
+      })
+    ).toBe('Newer')
+    expect(
+      aiVaultScanIssueDisplayText({
+        message: 'English',
+        messageCode: 'toString'
+      })
+    ).toBe('English')
+    expect(
+      aiVaultScanIssueDisplayText({
+        message: 'English',
+        messageCode: 'wslDistroNotRunning'
+      })
+    ).toBe('English')
+  })
+
   it('localizes classified scanner faults and passes other errors through', async () => {
src/renderer/src/lib/browser-cookie-import-error-copy.test.ts: 1

14-17: Trivial · Functional Correctness · Quick win

Restore fallback coverage for returned browser-import failures.

The surviving test covers only a complete recognized code. Add cases for an absent code, an unknown code, and missing parameters for a recognized code. These returned failures can reach browserCookieImportFailureText, which must preserve the host reason. Exception-catch paths bypass this helper and do not need coverage here.

Suggested fix
   it('keeps diagnostic detail verbatim', async () => {
     i18n.addResourceBundle('es', 'translation', es)
     await i18n.changeLanguage('es')
@@
     )
     expect(browserCookieImportFailureText(failed)).toContain('database is locked {{browser}}')
   })
+
+  it('preserves the host reason for uncoded, unknown, and incomplete failures', () => {
+    const reason = 'The browser import failed on the host.'
+
+    expect(browserCookieImportFailureText({ reason })).toBe(reason)
+    expect(browserCookieImportFailureText({ reason, reasonCode: 'futureCode' })).toBe(reason)
+    expect(
+      browserCookieImportFailureText({
+        reason,
+        reasonCode: 'importFailedWithLog',
+        reasonParams: { browser: 'Chrome', logPath: '/tmp/diag.log' }
+      })
+    ).toBe(reason)
+  })
 })

Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 192fd482-7895-42a7-86e1-aa7cf3bcbb09
Commits

Reviewing files that changed from the base of the PR and between e0f05c3 and db0e7e5.

Files selected for processing: 10
  • src/renderer/src/components/native-chat/agent-session-failure-words-text.test.ts
  • src/renderer/src/components/pet/pet-import-failure-text.test.ts
  • src/renderer/src/components/plugins/presentation/plugin-status-presentation.test.ts
  • src/renderer/src/components/right-sidebar/ai-vault-scan-issue-copy.test.ts
  • src/renderer/src/components/right-sidebar/hosted-review-create-failure-copy.test.ts
  • src/renderer/src/components/sidebar/wsl-host-failure-text.test.ts
  • src/renderer/src/lib/bitbucket-connect-error-copy.test.ts
  • src/renderer/src/lib/browser-cookie-import-error-copy.test.ts
  • src/renderer/src/lib/remote-server-pairing-error-copy.test.ts
  • src/renderer/src/lib/updater-message-copy.test.ts
Files with no reviewable changes: 8
  • src/renderer/src/components/pet/pet-import-failure-text.test.ts
  • src/renderer/src/lib/bitbucket-connect-error-copy.test.ts
  • src/renderer/src/components/right-sidebar/hosted-review-create-failure-copy.test.ts
  • src/renderer/src/components/sidebar/wsl-host-failure-text.test.ts
  • src/renderer/src/lib/remote-server-pairing-error-copy.test.ts
  • src/renderer/src/lib/browser-cookie-import-error-copy.test.ts
  • src/renderer/src/components/right-sidebar/ai-vault-scan-issue-copy.test.ts
  • src/renderer/src/lib/updater-message-copy.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

@OrcaWin
OrcaWin merged commit c8dec21 into main Oct 29, 2026
40 checks passed
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.

1 participant