Skip to content

ci(browser): say which check failed, and rank failures across runs - #1009

Merged
devswha merged 2 commits into
mainfrom
ci/failure-sites-and-flake-report
Oct 14, 2026
Merged

devswha merged 2 commits into
mainfrom
ci/failure-sites-and-flake-report

Conversation

@devswha

@devswha devswha commented Oct 14, 2026 •

Copy link
Copy Markdown
Owner

Change

Since #1002 a browser script that fails is run once more and a pass on the second run is reported as flaky. Two things were still missing for whoever maintains the lanes.

The report did not say what failed. "FLAKY scripts/ui-regression.ts" names a script with 65 checks. The lane now reads the failed run's log for the first error line and the first stack frame in scripts/, and puts both in the console line, the warning annotation, the job summary and summary.json:

::warning title=Flaky browser script::scripts/ui-regression.ts: scripts/terminal-input-regression.ts:65: AssertionError: input regression timed out failed once and passed when run again. …

A script that fails twice gets an ::error title=Browser script failed:: annotation with the same, which it did not have. A log with no recognisable error is reported as before, by script alone.

Nothing counted failures across runs. bun scripts/ci-flakes.ts [--hours 24] [--repo owner/name] [--json] reads recent ci.yml runs through gh, every attempt of each, and prints each script and failing site with how often it failed and how often it passed only on a second run, most frequent first. It changes nothing. A failed job's log is read; a passed job's only when it carries the flaky warning, so 30 hours of this repository (242 runs, 516 browser jobs) take about 100 seconds instead of more than five minutes.

What it shows today, first rows of --hours 30:

failed flaky script site
14 1 ui-regression terminal-input-regression.ts:65 (#1001 did not fix it; #1019 does)
11 0 ui-contexts-regression split-view-regression.ts:81
10 0 chat-virtual-browser-qa chat-virtual-browser-qa.ts:169
9 0 pane-paging-demo-regression pane-paging-demo-regression.ts:279
8 0 prompt-dock-demo-regression (no script frame in the log)

No change to which scripts run, to the second run, to exit codes or to what gates a merge.

Validation

  • macOS arm64, Bun 1.4.0. bun run typecheck: pass. scripts/ci-flakes.test.ts (new), pages-gate.test.ts (new cases for failureSite), conventions.test.ts, changelog-fold.test.ts: 0 fail. With failureSite made to return no site, 4 of those cases fail.
  • The lane, run for real with BROWSER_SCRIPTS=scripts/deep-link-demo-regression.ts GITHUB_ACTIONS=true bun scripts/ci-browser-parallel.ts and a throwaway line that made that script fail:
    • an assertion on the first run only: exit 0, the FLAKY line, the ::warning, the job summary and summary.json all carry scripts/deep-link-demo-regression.ts:10 and AssertionError: scratch forced failure;
    • the assertion on both runs: exit 1, ::error title=Browser script failed:: with the same;
    • process.exit(1) with nothing printed, first run only: exit 0, reported flaky by script alone, no "null" or "undefined".
  • bun scripts/ci-flakes.ts --hours 30 against this repository: exit 0 in 103 s; lists scripts/ui-regression.ts as flaky for run 38490957637 and the pre-retry failures. --json parses. With GH_TOKEN set to a bad token it prints gh: Bad credentials (HTTP 401) and exits 1.
  • Not run locally: the integration lane and the browser lanes as a whole.

…ne's reports

A flaky or failed browser script was reported by name only. The console lines, the warning annotation, a new error annotation for a script that fails twice, the job summary and summary.json now carry the first error line of its log and the first stack frame in scripts/.
…ipts across recent runs

bun scripts/ci-flakes.ts reads recent ci.yml runs through gh and lists each script and failing site with how often it failed and how often it passed only on a second run.
@coderabbitai

coderabbitai Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: devswha/herdr-web-ui/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 94818054-cfcc-4fce-bec7-f99d5c624331
📥 Commits

Reviewing files that changed from the base of the PR and between b83c7c5 and 7d56451.

📒 Files selected for processing: 6
  • changelog.d/ci-names-the-failing-check.md
  • docs/development.md
  • scripts/ci-browser-parallel.ts
  • scripts/ci-flakes.test.ts
  • scripts/ci-flakes.ts
  • scripts/pages-gate.test.ts

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

📝 Summary

Summary by CodeRabbit

  • New Features
    • Browser CI reports now show the failing assertion and, when available, the script location and error message.
    • A read-only command-line report ranks failed and flaky browser checks from recent CI runs. You can adjust the time window or choose JSON output.
  • Documentation
    • CI guidance now explains failure details in reports and how to use the failure-ranking report, including which jobs may be skipped.

Browser CI reports now include available assertion messages and script locations. A new CLI reads recent workflow logs and ranks failed and flaky browser scripts. Documentation, changelog entries, and tests cover these changes.

Changes: Browser CI Failure Reporting and Flake Analysis

Layer / File(s) Summary
Capture and report failure details
scripts/ci-browser-parallel.ts, scripts/pages-gate.test.ts
Browser CI extracts an error message and the first matching repository script location from logs. Available details appear in summary.json, console output, GitHub annotations, and step summaries.
Collect, rank, and report CI failures
scripts/ci-flakes.ts, scripts/ci-flakes.test.ts, docs/development.md, changelog.d/ci-names-the-failing-check.md
The CLI retrieves eligible browser job logs, parses failed and flaky scripts, groups and ranks results, and prints JSON or tab-separated output. Tests cover parsing and aggregation. Documentation describes the report details and CLI options.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Merge Risk: ⚪ Minimal · up to 7d564

No confirmed issue blocks merging. The error details shown for uncaught plain errors remain unverified.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 27.27% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 4 files. (2 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly summarizes both primary changes: improved browser failure reporting and ranking failures across CI runs.
Description check Passed The description includes the required Change and Validation sections. It explains the behavior, scope, test results, and unrun checks with sufficient detail.
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

Docstring coverage is 27.27% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 4 files. (2 skipped: 2 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 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

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

@devswha
devswha merged commit 4a9226f into main Oct 14, 2026
9 checks passed
@devswha
devswha deleted the ci/failure-sites-and-flake-report branch October 14, 2026 01:41
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