Skip to content

fix(ci): avoid repeated discovery during changed-test planning - #174069

Merged
vincentkoc merged 1 commit into
mainfrom
fix/ci-usage-v2-node-shards
Oct 16, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
fix/ci-usage-v2-node-shards

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Changed-test commands repeat Git discovery and target selection before starting tests, including a third pass when the selection is empty.

User Impact

Internal test-runner maintenance: each invocation reuses its selected targets and diagnostics. Test coverage, fallback behavior, watch mode, and isolated test execution stay the same. No elapsed-time improvement has been measured.

Why This Change Was Made

The command already owns the changed-target plan, so it passes those prepared facts into run-spec creation and empty-selection diagnostics. Standalone run-spec callers continue to resolve their own selection. The production delta is +9 lines to carry this invocation-owned fact; test coverage adds 73 lines.

Release-note context: internal CI/test-planner efficiency only; CHANGELOG.md remains release-owned.

Evidence

Exact-head CI passed for a6e20d2: https://github.com/openclaw/openclaw/actions/runs/38881863437 (attempt 1; 45 successful jobs, 28 intentional skips, no failures).

  • Both focused suites executed successfully: build-admission in tooling-isolated (job 116910852256), and all 261 planner tests in tooling (job 116910852344). The added empty-selection, single-discovery, standalone/watch, and broad-fallback cases passed.
  • The hosted classifier processed all four changed paths; affected script/test lint and formatting passed (job 116911296364).
  • Scripts types passed with tsconfig.scripts.json (job 116911296287); root script-test types passed with test/tsconfig/tsconfig.test.root.scripts.json (job 116911296412).
  • Required openclaw/ci-gate and applicable security checks passed. No inherited-failure exception is used.
  • Dependency-free syntax checks, git diff --check, pinned oxfmt 0.72.0, and scoped independent reviews passed on this unchanged source. The standalone full-tree erasability command was not separately invoked; the touched-file syntax proof and actual selected classifier/enforced gate cover this change.
  • No full build is required: this change only touches internal test-planner plumbing and its tests; it changes no published, packaging, or module-loading boundary.

ClawSweeper reviewed this unchanged head with no findings and no before-merge actions: #174069 (comment). The review lists no Rank-up moves. Its proof limitation remains explicit: no shipped-CLI trace or failing-base/passing-head replay was captured; the accepted proof is source review plus both actual hosted regression suites and enforced CI. No elapsed-time claim is made.

Carry the invocation-owned changed-target plan into Vitest run-spec creation
and reuse its skipped-path facts for empty-selection diagnostics. Standalone
run-spec callers retain their existing target discovery.

This reduces changed-target planning from two calls to one for normal changed
runs and from three calls to one for empty changed runs, without changing the
selected target multiset or process isolation.
@vincentkoc vincentkoc self-assigned this Oct 16, 2026
@clawsweeper

clawsweeper Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: S labels Oct 16, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review October 16, 2026 09:38
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 16, 2026
@clawsweeper

clawsweeper Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR reuses one changed-test selection for execution planning and empty-selection diagnostics.

Example: Run pnpm test:changed with no changed paths.

  • Before: The runner discovers changed paths three times before reporting that Vitest was skipped.
  • After: The runner discovers changed paths once and reuses that selection for the same skip result.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The focused patch is correct by inspection and hosted checks are successful; behavioral evidence remains limited to test-harness coverage.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored internal planner PR is outside the ordinary contributor proof gate; supplied support consists of source-level regression coverage and successful exact-head hosted checks rather than a shipped-CLI behavior capture.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Performance · Worth it: Yes · Fix scope: Complete
User problem: Contributors running changed-test commands repeat Git discovery and target planning before tests start.
Reason: A small maintainer-directed change removes demonstrably repeated work and follows the repository policy to carry prepared facts through existing owners.

Merge readiness

✅ Ready for maintainer review

Keep this maintainer-authored PR open: it removes verified duplicate planning work that remains on current main, and the reviewed diff introduces no actionable correctness defect.

Priority: P3
Reviewed head: a6e20d26ede5ca1c1cacbcb3928dca1924c52835

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: No supplied shipped-CLI trace demonstrates single discovery, and a failing-base/passing-head regression run is not shown.
Agent review details

How this fits together

The repository test CLI turns Git changes into owned Vitest targets, execution specifications, and diagnostics before launching test processes.

flowchart TD
  A[Test CLI arguments] --> B[Git changed paths]
  B --> C[Changed target plan]
  C --> D[Vitest run specifications]
  C --> E[Empty selection diagnostics]
  D --> F[Test process scheduler]
Loading

Technical review

Best possible solution:

Reuse the invocation-owned plan while preserving standalone discovery, target coverage, broad fallback, and scheduler behavior.

Do we have a high-confidence way to reproduce the issue?

Current-main source shows two discovery calls for precise changed runs and a third for empty selections; no target code was executed during this read-only review.

Is this the best way to solve the issue?

The patch fixes redundant work at its existing owner without adding a cache or changing selection policy, and correctly distinguishes omitted, null, and empty prepared selections.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 6e73bd9d532c.

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Introduced change: The pinned introduction diff carries the invocation-owned selection into run-spec creation and reuses its skipped-path diagnostics; it does not change target-selection rules. (scripts/test-projects-run.mts:359, a6e20d26ede5)
  • Standalone discovery preserved: An omitted prepared selection still invokes the existing resolver; an empty array remains an empty selection, and explicit targets retain their existing path. (scripts/test-projects.test-support.mts:5295, a6e20d26ede5)
  • Current main still needs the change: The affected files are unchanged between the merge base and fetched main, where execution planning and empty-selection diagnostics still independently resolve changed targets. (scripts/test-projects-run.mts:360, 6e73bd9d532c)
  • Existing scheduling contract: fix: run concrete changed test groups concurrently #162701 established concurrent admission for resolved changed targets; this PR preserves the selected-target admission logic and strengthens its independent target-multiset assertion. (test/scripts/test-projects-build-admission.test.ts:775, afca8f9fce55)
  • Exact-head hosted checks: The complete paginated check-run response contains successful Node test lanes, lint, type checks, and architecture guards, with no failing or pending check runs; skipped and neutral checks are not counted as passing tests. (a6e20d26ede5)
  • Discussion and merge state: The current body records the maintenance purpose and makes no measured speedup claim; comments contain bot acknowledgments only, reviews are empty, and mergeability remains unknown. (a6e20d26ede5)

Likely related people:

  • Peter Steinberger: Raw commit c904e71 adds scripts/test-projects-run.mts:147 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: c904e712f9c5; files: scripts/test-projects-run.mts)
  • Vincent Koc: Raw commit 8d1ab6c adds scripts/test-projects-run.mts:174 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 8d1ab6c88f17; files: scripts/test-projects-run.mts)
  • Shakker: Raw commit afca8f9 adds scripts/test-projects-run.mts:405 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: afca8f9fce55; files: scripts/test-projects-run.mts)

PR surface

Tests +80, Other +2. Total +82 across 4 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 3 89 9 +80
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 9 7 +2
Total 4 98 16 +82

Review metrics

Metric Value Why it matters
Production versus test growth Production net +9 lines; tests net +73 lines The production growth carries prepared facts through existing owners; test growth covers empty diagnostics, target preservation, and standalone discovery.

Labels

Label changes:

  • add P3: This is internal planner efficiency work with preserved test behavior and no demonstrated user-facing outage or measured elapsed-time regression.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: This is internal planner efficiency work with preserved test behavior and no demonstrated user-facing outage or measured elapsed-time regression.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 16, 2026, 5:55 AM ET / 09:55 UTC.

@vincentkoc
vincentkoc merged commit e8cc619 into main Oct 16, 2026
201 checks passed
@vincentkoc
vincentkoc deleted the fix/ci-usage-v2-node-shards branch October 16, 2026 10:07
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Oct 16, 2026
* commit 'ac03ca0b6d26a7dc55d0d262e40d2549631b1ea7': (25 commits)
  fix: apply shared plugin model policy to decisions (#156621)
  perf: shortlist transcript relevance scores before metadata reads (#174058)
  fix: strip standalone trailing NO_REPLY from replies (#171990)
  fix(ci): avoid repeated discovery during changed-test planning (#174069)
  fix(sqlite): preserve transaction outcomes when warnings throw (#157151)
  fix(ai): native video handoff to chat-completions providers + preflight video cost (#170920)
  fix(litellm): image generation fails when the backend returns image URLs (#173508)
  test(memory,gateway,infra,subagents): remove low-value tests (batch d152) (#174034)
  perf(memory): bound derived worker snapshot and pricing retention (#174067)
  fix(test): reduce eager imports during test startup (#174056)
  refactor(codex): share lifecycle preflight fixtures (#174062)
  test(gateway,matrix,agents,ui): remove low-value tests (batch d150) (#174025)
  perf(infra): batch usage refresh maintenance (#174050)
  fix(gateway): revert cold session list worker regression (#174052)
  refactor(config): consolidate browser meeting configuration (#173947)
  fix(cron): keep global-session deliveries on the selected agent (#173855)
  test(compaction): assert structured stale-writer failure (#174064)
  fix(cli): local terminal chat sends model requests without the configured proxy (#173530)
  test(ui): restore bootstrap preference locale after each case (#174065)
  fix: download session files through the development proxy (#173973)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 17, 2026
…law#174069)

Carry the invocation-owned changed-target plan into Vitest run-spec creation
and reuse its skipped-path facts for empty-selection diagnostics. Standalone
run-spec callers retain their existing target discovery.

This reduces changed-target planning from two calls to one for normal changed
runs and from three calls to one for empty changed runs, without changing the
selected target multiset or process isolation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant