Skip to content

test: remove low-value metadata and registration inventories - #36066

Merged
OrcaWin merged 1 commit into
mainfrom
test-audit-764-metadata-inventories-and-projections
Oct 29, 2026
Merged

OrcaWin merged 1 commit into
mainfrom
test-audit-764-metadata-inventories-and-projections

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 8 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2 $\color{#cf222e}{\Huge{\mathbf{−}}}$​359 $\color{#cf222e}{\Huge{\mathbf{−}}}$​357
Prod 1 0 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2

Remove 22 low-value test declarations across metadata, schema, and registration tests, including the entire Jira metadata-registration and headless SSH-registration suites. Remove mock-supplied receipts, literal/string inventories, and duplicate default cases; retain parser boundaries, admission rejection, cache/prune transitions, and metadata indexing checks.

Reviewed 13 complete test sources (57 declarations / 70 expanded cases); retain 35 declarations / 48 expanded cases. Remove six unused imports, one empty suite wrapper, and the two deleted suites’ timing entries. No executable production changes.

Validation: isolated static formatting, lint, AST/token identity, retained callback/setup identity, routing, and exact metadata checks passed. Draft while upstream repair #36065 finishes; the previous CI attempt failed on unrelated main lint and session fixtures. Refresh the base and run fresh full CI before merge.

@OrcaWin
OrcaWin marked this pull request as ready for review October 29, 2026 19:51
@greptile-apps

greptile-apps Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The reviewed changes appear safe to merge.

Summary

Removes 22 test declarations and the timing entries for two deleted suites. No executable production code changes.

  • Jira metadata tests no longer include a separate registration suite.
  • Headless SSH registration no longer has a dedicated test suite.
  • Browser metadata tests focus on refusal cases instead of publish replies.
  • Worktree metadata tests keep display-name checks without identity and suppression examples.
  • WSL interop tests retain config checks without broad probe and script inventories.
  • Plugin schema tests retain combined error checks without standalone path and message examples.
  • Prune-gate tests keep state transitions without first-scan examples.
  • Link-preview tests no longer include a standalone named-entity title example.

No actionable new issues were found.

Reviews (2) · Last reviewed commit: "test: remove low-value metadata and regi..." · Reviewed by Greptile

@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Walkthrough

The changes remove selected tests for browser page metadata IPC, Jira project metadata registration, worktree metadata merging and pruning, plugin schema issues, link-preview title decoding, headless SSH registration, and WSL interop. They also remove timing entries for the deleted Jira and headless SSH test files. No runtime implementation changes are described.

Priority: Low

Merge Risk: Low · up to c1352

WSL runtime behavior is unchanged, but future health regressions could go undetected until focused parser and script tests are restored.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Description check Warning The description explains the test reductions and validation results, but it does not follow the required template. Most required headings and information are missing, including ELI5, Linked Issue with… Rewrite the description using all required template sections. Add a plain-language ELI5 summary, clear What Changed and Why sections, an actual linked issue, Visual Proof with N/A and a reason if there is no UI change, completed Testing and…
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly summarizes the main change: removing low-value tests related to metadata and registration inventories.
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 test reductions and validation results, but it does not follow the required template. Most required headings and information are missing, including ELI5, Linked Issue with an actual issue reference, Visual Proof with N/A if applicable, Testing checkboxes, AI Disclosure, Review, Notes, and the Checklist.

Resolution

Rewrite the description using all required template sections. Add a plain-language ELI5 summary, clear What Changed and Why sections, an actual linked issue, Visual Proof with N/A and a reason if there is no UI change, completed Testing and Checklist items, AI Disclosure as applicable, Review, Agent skill upstream boundary, and Notes covering compatibility and risk considerations.

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: 4
src/main/ipc/jira/register-handlers.ts: 1

231-234: Trivial · Maintainability & Code Quality · Quick win

Restore focused tests for the jira:listFavouriteFilters IPC callback.

The deleted project-metadata-registration.test.ts was the only test that reached this callback through the registered IPC handler. The remaining tests cover the schema, the helper, and the runtime RPC path, but not this handler. Without the deleted suite, these behaviors lack direct test coverage at this boundary:

  • The channel is registered.
  • Invalid arguments are rejected before listFavouriteFilters runs.
  • The siteId from a valid payload is forwarded exactly once.
  • A rejection from listFavouriteFilters propagates unchanged.

Restore a focused IPC test that covers these four behaviors. The deleted file at the merge base can serve as the starting point, with its mock setup kept and only the assertions that still apply retained. This is a coverage gap, not a production defect. The callback code is correct as written.

src/main/ipc/browser-guest-view-ipc.ts: 1

293-303: Trivial · Maintainability & Code Quality · Quick win

Retain focused tests for the published and failed handler outcomes.

The current IPC suite only tests refused. Add handler-boundary tests for accepted: true, accepted: false, and RemoteRuntimeClientError.code. Lower-layer transport tests do not detect regressions in this IPC response mapping.

Suggested fix
+import { RemoteRuntimeClientError } from '../../shared/remote-runtime/remote-runtime-client-error'
+
 ...
 describe('browser:publishClientPageMetadata', () => {
+  it('returns the published runtime acknowledgement', async () => {
+    await expect(
+      publishMetadata({ environmentId: 'environment-a', params: PARAMS })
+    ).resolves.toEqual({ status: 'published', accepted: true })
+  })
+
+  it('passes through an unaccepted runtime acknowledgement', async () => {
+    mocks.publish.mockResolvedValue({ accepted: false })
+
+    await expect(
+      publishMetadata({ environmentId: 'environment-a', params: PARAMS })
+    ).resolves.toEqual({ status: 'published', accepted: false })
+  })
+
+  it('returns the code from a RemoteRuntimeClientError', async () => {
+    mocks.publish.mockRejectedValue(
+      new RemoteRuntimeClientError('remote_runtime_unavailable', 'no lease')
+    )
+
+    await expect(
+      publishMetadata({ environmentId: 'environment-a', params: PARAMS })
+    ).resolves.toEqual({
+      status: 'failed',
+      errorCode: 'remote_runtime_unavailable'
+    })
+  })
+
   // Untrusted renderer identities must not reach the paired runtime lease.
src/main/ipc/worktree-metadata-merge.ts: 1

22-69: Trivial · Functional Correctness · Quick win

Restore focused mergeWorktree projection assertions.

The retained merge test covers only display-name behavior. Add assertions for identity with a proven host, omission when the host is absent, and suppressedGitHubPR propagation. The remaining direct callers assert different fields, so regressions in these projections can pass the retained tests.

Suggested fix
 import { describe, expect, it } from 'vitest'
 import type { GitWorktreeInfo } from '../../shared/worktree/types'
+import { canonicalWorktreeIdentity } from '../../shared/worktree/identity'
 import { mergeWorktree } from './worktree-metadata-merge'
 
@@ -51,4 +52,45 @@ describe('mergeWorktree identity projection', () => {
 
     expect(worktree.displayNameMode).toBe('fixed')
   })
+
+  it('publishes identity when host and instance metadata are known', () => {
+    const instanceId = '11111111-1111-4111-8111-111111111111'
+    const worktree = mergeWorktree('repo-1', git, {
+      hostId: 'ssh:build-box',
+      instanceId
+    })
+
+    expect(worktree.identity).toEqual({
+      key: canonicalWorktreeIdentity({
+        worktreeId: worktree.id,
+        executionHostId: 'ssh:build-box',
+        instanceId
+      }),
+      executionHostId: 'ssh:build-box',
+      instanceId
+    })
+  })
+
+  it('omits identity when the host is not proven', () => {
+    const worktree = mergeWorktree('repo-1', git, {
+      instanceId: '11111111-1111-4111-8111-111111111111'
+    })
+
+    expect(worktree.identity).toBeUndefined()
+  })
+
+  it('projects GitHub PR suppression metadata', () => {
+    const worktree = mergeWorktree('repo-1', git, { suppressedGitHubPR: 42 })
+
+    expect(worktree.suppressedGitHubPR).toBe(42)
+  })
 })
src/shared/plugins/manifest/plugin-schema-issues.test.ts: 1

53-62: Trivial · Maintainability & Code Quality · Quick win

Restore focused assertions for the three parser diagnostics.

parsePluginManifest preserves schema and custom issue messages. Retained tests still cover (root) and items[0] formatting, but they do not assert the exact messages for the engine-range error, trusted-worker error, or unsupported manifest version. Restore focused assertions for these three inputs so diagnostic changes cannot pass unnoticed. This is a test-coverage gap, not a current runtime failure.


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: 9ff4158e-0a00-4437-a524-deaf546f6aa0
Commits

Reviewing files that changed from the base of the PR and between cb21824 and 5ff849a.

Files selected for processing: 5
  • config/scripts/ci-shard-timings.json
  • src/main/ipc/browser-client-page-metadata-ipc.test.ts
  • src/main/ipc/jira/project-metadata-registration.test.ts
  • src/main/ipc/worktree-metadata-merge.test.ts
  • src/shared/plugins/manifest/plugin-schema-issues.test.ts
Files with no reviewable changes: 4
  • src/main/ipc/jira/project-metadata-registration.test.ts
  • src/main/ipc/worktree-metadata-merge.test.ts
  • config/scripts/ci-shard-timings.json
  • src/main/ipc/browser-client-page-metadata-ipc.test.ts

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

@OrcaWin
OrcaWin marked this pull request as draft October 29, 2026 20:07
@OrcaWin OrcaWin changed the title test: remove metadata inventories and mock acknowledgements test: remove low-value metadata and registration inventories Oct 29, 2026
@OrcaWin
OrcaWin force-pushed the test-audit-764-metadata-inventories-and-projections branch from 5ff849a to 3c3feae Compare October 29, 2026 20:07
@OrcaWin
OrcaWin force-pushed the test-audit-764-metadata-inventories-and-projections branch from 3c3feae to c13520a Compare October 29, 2026 20:15
@OrcaWin
OrcaWin marked this pull request as ready for review October 29, 2026 20:15

@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: 1
src/main/wsl/wsl-interop-registration.test.ts: 1

2-2: Trivial · Stability & Availability · Quick win

Keep focused parser and script contract tests.

The removed tests covered distinct behavior. They checked WSLInterop-late, the non-flushing repair command, and the unmounted, parser unknown, and repair unknown branches. The remaining health tests compare calls with imported constants, but do not validate script contents or these parser results.

These branches affect monitor outcomes such as unsupported, unknown, and repair-failed. Retain focused tests for the parser branches and the safety-critical script invariants.


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: cbc4ab82-fee9-4529-8b99-66a7ce33a50c
Commits

Reviewing files that changed from the base of the PR and between 5ff849a and c13520a.

Files selected for processing: 5
  • config/scripts/ci-shard-timings.json
  • src/main/link-preview/link-preview-page-metadata.test.ts
  • src/main/local-worktree-metadata-prune-gate.test.ts
  • src/main/startup/headless-serve-ssh-registration.test.ts
  • src/main/wsl/wsl-interop-registration.test.ts
Files with no reviewable changes: 4
  • src/main/link-preview/link-preview-page-metadata.test.ts
  • src/main/startup/headless-serve-ssh-registration.test.ts
  • config/scripts/ci-shard-timings.json
  • src/main/local-worktree-metadata-prune-gate.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 a01568e into main Oct 29, 2026
68 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