Skip to content

test: remove 11 low-value declarations and batch historical checkout fetches - #37894

Merged
OrcaWin merged 5 commits into
mainfrom
codex/remove-low-value-tests-1239
Nov 3, 2026
Merged

OrcaWin merged 5 commits into
mainfrom
codex/remove-low-value-tests-1239

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 14 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​149 $\color{#cf222e}{\Huge{\mathbf{−}}}$​446 $\color{#cf222e}{\Huge{\mathbf{−}}}$​297
Prod 1 0 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1

Remove 11 low-value test declarations after reviewing 40 sources (223 declarations; 212 retained). Delete the entire terminal-title classification corpus and its obsolete CI timing row. Product runtime code is unchanged.

The corpus pins a historical nine-API verdict matrix; focused suites retain identity, grammar, provenance, cache-call and eviction checks. Deletion intentionally gives up the combined matrix and some unique legacy literals. Other cuts remove duplicate Muse approval and Pi/OMP owner cases, shortcut glyph inventories, ordinary projection/parser examples, a restart claim that never reopens its store, and simpler scenarios repeated by stronger retained cases.

Fix the compatibility test harness to fetch missing historical blobs in one batch before archive extraction. Filtered CI clones repeatedly exceeded the existing 45-second extraction limit for v1.4.219/v1.4.220 while fetching blobs lazily. The helper scans only the requested commit and archive paths, retains the same deadline, and leaves full clones offline. A real filtered-clone regression disables implicit lazy fetches and checks extracted source bytes; removing prefetch makes it fail. A fully cold v1.4.220 extraction completed locally in 21 seconds. Workflow configuration matches main.

Validation: 363 tests pass across 15 files, including all edited surviving suites, focused title suites, five checkout-tree fixtures and six checkout lifecycle/importer tests. The harness also loads directly in plain Node. Formatting, changed-code quality, and full ast-grep/flaky-pattern gates pass. Static verification checks pinned originals, unchanged retained registrations/hooks/support, exact deletion candidates, and full tracked-tree references including hidden workflows, runners, timing lists, and ratchets. One regression test is added for the harness fix.

@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • Resume reviews
  • Trigger review
Walkthrough

The pull request removes selected tests covering main-process and shared behavior, including the terminal-title classification corpus test and its CI timing entry. Release checkout extraction now checks for missing Git blobs and fetches them from a configured promisor remote before creating the archive. A new integration test verifies extraction from a filtered clone with lazy fetching disabled.

Merge Risk: Moderate · up to cec1a

Release checkout extraction can fail for valid filtered-clone configurations, hang on credential prompts, or provide misleading diagnostics. Several removed tests also leave important behavior less protected, so the PR is not ready to merge without addressing these risks.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Description check Warning The description explains the main changes, rationale, testing, and reported risk areas, but it omits most required template sections, including ELI5, Linked Issue, Visual Proof, explicit Risk, AI Disc… Add the required template headings and complete the missing sections. Include an actual linked issue or state the applicable maintainer exception, write N/A with a reason for Visual Proof, provide a risk level with failure impact and roll…
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly summarizes both primary changes: removing low-value tests and batching historical checkout fetches.
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: Description check

Explanation

The description explains the main changes, rationale, testing, and reported risk areas, but it omits most required template sections, including ELI5, Linked Issue, Visual Proof, explicit Risk, AI Disclosure, Review, Notes, and Checklist.

Resolution

Add the required template headings and complete the missing sections. Include an actual linked issue or state the applicable maintainer exception, write N/A with a reason for Visual Proof, provide a risk level with failure impact and rollback steps, complete Testing details and platform coverage, fill AI Disclosure when applicable, and complete the Review, Agent skill upstream boundary, Notes, and Checklist sections.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. 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 3 functions across 4 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

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

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

@OrcaWin OrcaWin changed the title test: remove 11 low-value test declarations test: remove 11 low-value declarations and serialize compatibility checks Nov 3, 2026
@OrcaWin OrcaWin changed the title test: remove 11 low-value declarations and serialize compatibility checks test: remove 11 low-value declarations and batch historical checkout fetches Nov 3, 2026
['config', '--get-regexp', '^remote\\..*\\.promisor$'],
deadline
)
const remote = /^remote\.(.+)\.promisor (?:true|1)$/m.exec(remotes)?.[1]

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.

Minor · Functional Correctness · Quick win

Accept Git’s valid promisor Boolean values.

If remote.origin.promisor is yes or on, Git treats the remote as a promisor, but this regex rejects it. A filtered checkout with missing blobs then fails before the fetch. Read the configuration with Git’s --bool option so the value is normalized before matching. (git-scm.com)

Tools
OpenGrep (1.30.2)

[ERROR] 225-225: A nonliteral argument is passed to exec/execSync. Identify the receiver: Node child_process methods execute shell commands, while regular-expression and database methods have different contracts. For shell execution, prefer execFile or spawn with an argument array.

(coderabbit.command-injection.exec-js)

Comment on lines +32 to +41
const remotes = await runCheckoutProcess(
repoRoot,
'git',
['config', '--get-regexp', '^remote\\..*\\.promisor$'],
deadline
)
const remote = /^remote\.(.+)\.promisor (?:true|1)$/m.exec(remotes)?.[1]
if (!remote) {
throw new Error('Historical release blobs are missing without a promisor remote')
}

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.

Minor · Functional Correctness · Quick win

Make the "no promisor remote" error reachable.

git config --get-regexp exits with code 1 when no key matches. runCheckoutProcess throws git config exited with 1 in that case. The custom error at Line 40 is never reached. Missing blobs without a promisor remote therefore produce a less useful message.

Run the lookup so that exit code 1 is not an error. Alternatively, catch the error and throw the descriptive message.

Tools
OpenGrep (1.30.2)

[ERROR] 38-38: A nonliteral argument is passed to exec/execSync. Identify the receiver: Node child_process methods execute shell commands, while regular-expression and database methods have different contracts. For shell execution, prefer execFile or spawn with an argument array.

(coderabbit.command-injection.exec-js)

Comment on lines +13 to +21
const result = await runProcess({
program,
args,
cwd: repoRoot,
timeoutMs: Math.max(1, deadline - Date.now()),
maxOutputBytes: options.maxOutputBytes ?? CHECKOUT_MAX_OUTPUT_BYTES,
input: options.input,
terminationBarrier: true
})

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.

Minor · Stability & Availability · Quick win

Disable Git credential prompts in the shared checkout runner.

runCheckoutProcess passes no env to runProcess. The new prefetchReleaseBlobs uses this runner for git fetch against a network promisor remote. If that remote needs credentials, Git can call an inherited askpass helper or core.askPass. The fetch then blocks until the 45-second deadline instead of failing at once.

Set both GIT_TERMINAL_PROMPT=0 and an empty GIT_ASKPASS. Spread process.env so PATH is kept.

Proposed fix
     maxOutputBytes: options.maxOutputBytes ?? CHECKOUT_MAX_OUTPUT_BYTES,
     input: options.input,
+    env: { ...process.env, GIT_TERMINAL_PROMPT: '0', GIT_ASKPASS: '' },
     terminationBarrier: true

Based on learnings: when spawning Git non-interactively, set both GIT_TERMINAL_PROMPT=0 and GIT_ASKPASS="", because the first variable alone can still hang on an askpass helper.

Committable suggestion

IMPORTANT
Review the replacement and indentation, then test before committing.

Suggested change
const result = await runProcess({
program,
args,
cwd: repoRoot,
timeoutMs: Math.max(1, deadline - Date.now()),
maxOutputBytes: options.maxOutputBytes ?? CHECKOUT_MAX_OUTPUT_BYTES,
input: options.input,
terminationBarrier: true
})
const result = await runProcess({
program,
args,
cwd: repoRoot,
timeoutMs: Math.max(1, deadline - Date.now()),
maxOutputBytes: options.maxOutputBytes ?? CHECKOUT_MAX_OUTPUT_BYTES,
input: options.input,
env: { ...process.env, GIT_TERMINAL_PROMPT: '0', GIT_ASKPASS: '' },
terminationBarrier: true
})

Source: Learnings

@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/shared/terminal-title-agent-type.test.ts: 1

226-290: Trivial · Functional Correctness · Quick win

Retain one focused cross-projection assertion for a legacy title.

The deleted corpus was the only test that checked all nine projections for the same input. The retained test checks only explicit identity and tab-agent resolution. Add one representative legacy row, such as openclaude, and assert the status, shared label, Claude/Gemini predicates, explicit projections, title-agent projection, policy projection, and identity projection. This is a material regression-detection gap introduced by removing the corpus.

src/main/ai-vault/scanners/codex/session-scanner-codex-tool-records.test.ts: 1

90-108: Trivial · Functional Correctness · Quick win

Retain focused coverage for local_shell_call.

The retained resume-parser test does not exercise the branch that converts an argv command into searchable tool text. Add this focused assertion at the same test boundary so a regression can be detected.

Suggested fix
+it('keeps local shell argv searchable', () => {
+  const messages: TranscriptMessage[] = []
+  const state = createCodexSessionResumeState(file, null, {
+    active: true,
+    push: (message) => messages.push(message)
+  })
+  state.consumeLineBytes!(
+    record('response_item', {
+      type: 'local_shell_call',
+      action: { type: 'exec', command: ['rg', 'argvneedle'] }
+    })
+  )
+  expect(messages.map((message) => message.text)).toEqual(['tool: rg argvneedle'])
+})
src/main/native-chat/agent-session-wire/structured-agent-session-status-feed-launch-directory.test.ts: 1

94-115: Trivial · Maintainability & Code Quality · Quick win

Add a late-subscriber assertion for the pinned floating directory.

The retained launch-directory tests only check the live status event for an existing subscriber. The late-subscriber snapshot branch in subscribe has no retained assertion for launchDirectory. A regression on that path would not fail the suite. Add one test that pins the directory, subscribes a second reader, and checks its snapshot.

Suggested fix
+  it('includes the pinned floating directory in a late subscriber snapshot', async () => {
+    const { feed } = await feedFor(FLOATING)
+    await store.pinLaunchDirectory(SESSION, '/home/me/original-floating')
+    const late: AgentSessionStatusEvent[] = []
+    feed.subscribe({ id: 'late', emit: (event) => late.push(event) })
+
+    expect(lastSummary(late)).toMatchObject({
+      sessionId: SESSION,
+      launchDirectory: '/home/me/original-floating'
+    })
+  })
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: 9c5b3d85-467e-4f52-8814-eeffcb100c5c
Commits

Reviewing files that changed from the base of the PR and between 7aa555c and cec1a34.

Files selected for processing: 2
  • tests/e2e/cross-version-wire/release-checkout-prefetch.ts
  • tests/e2e/cross-version-wire/release-checkout-tree.ts

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

@OrcaWin
OrcaWin merged commit b10e0bd into main Nov 3, 2026
72 of 74 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