Skip to content

feat(scripts): map changed files and feature surfaces to CI browser checks - #4841

Open
devswha wants to merge 2 commits into
mainfrom
feat/browser-checks
Open

devswha wants to merge 2 commits into
mainfrom
feat/browser-checks

Conversation

@devswha

@devswha devswha commented Nov 26, 2026

Copy link
Copy Markdown
Owner

Change

Add scripts/browser-checks.ts so contributors and agents can map changed files (or named feature surfaces such as composer, pending, files, diff, sidebar, terminal, prompts, relay, account) directly to the canonical CI browser scripts in scripts/ci-browser.sh without maintaining a hand-edited per-script table that conflicts across PRs.

  • Ranks canonical CI browser scripts using direct imports, 1-hop src/ caller/CSS propagation, inverse-document-frequency DOM/API-route/protocol-code coupling tokens, and named feature surfaces (--surfaces, --surface <id>, --base <rev>, --limit <n>, --json).
  • Excludes demo-only browser checks when changes touch server/ alone.
  • Supports --run to execute the matched browser checks through the isolated runner (scripts/ci-browser-parallel.ts for demo-only sets, or scripts/check.ts run --build when any script needs an isolated herdr session).
  • Documents bun scripts/browser-checks.ts in CONTRIBUTING.md.

Validation

  • Ran bun test ./scripts/browser-checks.test.ts (6 pass, 0 fail)
  • Ran bun run check fast (actionlint, generate:types --check, generate:themes --check, typecheck, build, and test:unit: 28,839 pass, 0 fail across 1,356 files)
  • Skipped bun run check full locally (covered by CI Integration and browser and Native Windows install; this change touches scripts/ tooling and CONTRIBUTING.md only)

@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Explain Change →

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • New Features
    • Added a command-line tool that identifies browser checks relevant to changed files or selected feature areas. You can review suggested checks, list available areas, output results as JSON, or run the checks directly.
    • Check selection accounts for staged, unstaged, and untracked changes, and avoids suggesting demo-only checks for server-only edits.
  • Documentation
    • Added contribution guidance for finding and running relevant browser checks.

The change adds a browser-check tool that maps changed files or named surfaces to CI browser scripts. It can show match details and suggested commands, or run selected scripts.

Changes: Browser Check Tool

Layer / File(s) Summary
Surface model and repository index
scripts/browser-checks.ts
Defines browser surfaces and result types. Scans repository files, imports, and source tokens to build script and surface summaries.
Target discovery and check selection
scripts/browser-checks.ts, scripts/browser-checks.test.ts
Discovers changed files, validates targets, and ranks matching scripts. Tests cover surface and path matching, server-only targets, coupling tokens, and invalid inputs.
CLI, execution, and usage
scripts/browser-checks.ts, CONTRIBUTING.md
Adds CLI options for listing surfaces, outputting JSON, and running matches. The runner builds the shell when needed and configures the child process. CONTRIBUTING.md documents the command.

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Feature

Merge Risk: Minimal · previous review eedb5

This adds a developer tool that maps changed files to CI browser checks, plus documentation. No concrete defect remains in the reviewed head, and the change is limited to scripts and contributor docs, so merge risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: a new script that maps changed files and feature surfaces to CI browser checks. It is specific and matches the summary and objectives. It is 74 characters, which is ac…
Description check Passed The description follows the template's two sections, Change and Validation. The Change section explains the new script, its options, the --run behavior, and the CONTRIBUTING.md update. The Validation …
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: Title check

Explanation

The title names the main change: a new script that maps changed files and feature surfaces to CI browser checks. It is specific and matches the summary and objectives. It is 74 characters, which is acceptable.

Full details: Description check

Explanation

The description follows the template's two sections, Change and Validation. The Change section explains the new script, its options, the --run behavior, and the CONTRIBUTING.md update. The Validation section lists the tests and checks run, with results, and states which check was skipped and why. It does not link an issue, and the template asks for one for features. The description also does not state that the change is a feature the maintainer agreed to, and the template's HTTP/WS contract-test note does not apply to this change.

Resolution

Optional: link the issue where a maintainer agreed to this feature, since the template asks for it on feature changes. The description is otherwise complete.

Finishing Touches

Generate unit tests (beta)

  • 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

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between b378257 and eedb55a.

Files selected for processing: 3

  • CONTRIBUTING.md
  • scripts/browser-checks.test.ts
  • scripts/browser-checks.ts

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

@devswha

devswha commented Nov 26, 2026

Copy link
Copy Markdown
Owner Author

Holding per maintainer instruction: leave open as a PR without merging.

@devswha devswha added the hold Not merged until the owner says so label Nov 26, 2026
Map 29 CI browser scripts that matched no surface (machine dialog, account PC list, per-agent chat and image QA, header, PWA update and others), weigh a matched surface at 20 instead of 8, and take a 1-hop importer's tokens at 0.25 instead of 0.6 so a large caller such as App.tsx no longer floods the ranking. On 21 older merged PRs not used for tuning, a script the PR edited ranks in the top 12 for 11 instead of 10.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hold Not merged until the owner says so

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant