Skip to content

feat(cli): list every budget and its verdict in the reports - #326

Merged
nucliweb merged 1 commit into
mainfrom
feat/cli-budgets-reports
Oct 26, 2026
Merged

nucliweb merged 1 commit into
mainfrom
feat/cli-budgets-reports

Conversation

@nucliweb

Copy link
Copy Markdown
Owner

Summary

Phase 1 of the budgets, second part (#325 was the first): the reports say which budget failed. Before, only stderr did, which the comment of a pull request does not show.

  • Human report: a Budgets section with every budget the run was given, passed or not.

    Budgets
      ✗ INP   304ms     budget 200ms      exceeded by 104ms
    
  • Markdown report: the same as a table, for the comment of a pull request (the TTFB row shows the format of a metric that was not measured):

    ### Budgets
    | Metric | Value | Budget | Verdict |
    |--------|-------|--------|---------|
    | LCP | 12ms | 2.50s | ✅ passed |
    | TTFB | · | 800ms | ❌ not measured: No navigation entry |
    
  • JSON output and --report-to: a budgets field with { metric, budget, value, unit, verdict, note? } for each budget, also in each combination of a matrix. No field without budgets.

  • Matrix: under the table, the failed budgets with their combination (<combination>: LCP <value> exceeds budget 250ms), or Every budget passed. The report of each combination, with --verbose or in its <details> block, has its own Budgets section.

cli/src/reporters/budgets-view.js shapes the rows for both reports, each with its own format of a value, and bin.js keeps the verdicts it already computes for the exit code. cli/README.md, content/CLI.mdx and the CLI changelog describe it.

Test plan

  • Unit tests of the reporters (local): the Budgets section of the human report with passed, exceeded by how much and not measured with the note; the markdown table; no section without budgets; budgets in the JSON; the failed budgets of a matrix with their combination, and Every budget passed. They failed before the change.
  • E2e (local): --json carries the verdict of each budget, and --markdown the table (budgets.test.js); the body of --report-to carries budgets, and has no field without them (report-to.test.js); the human report of a matrix names the combination of the failed budget (matrix.test.js).
  • Lint, check:emoji, CLI unit 346 of 346, CLI e2e 586 of 586, test:site 44 of 44 (local).
  • By hand with the CLI (local): --workflow interaction --interact-script click.json --budget-inp 200 on a page with a slow button prints ✗ INP 304ms budget 200ms exceeded by 104ms; --budget-lcp 2500 --budget-cls 0 --markdown prints the table with both passed.

The reports list every budget the run was given, with its value and verdict: passed, exceeded with by how much, or not measured with why. The human and markdown reports have a Budgets section, the JSON output and the body of --report-to a budgets field, also in each combination of a matrix, and a matrix lists the failed budgets with their combination under its table. A pull request comment says which budget failed, which only stderr said before. cli/src/reporters/budgets-view.js shapes the rows for both reports, and bin.js keeps the verdicts it already computes for the exit code.
@vercel

vercel Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
webperf-snippets Ready Ready Preview Oct 25, 2026 11:57pm UTC

@nucliweb
nucliweb merged commit fdc4a0f into main Oct 26, 2026
3 checks passed
@nucliweb
nucliweb deleted the feat/cli-budgets-reports branch October 26, 2026 06:54

This branch was successfully deployed

1 active deployment
Preview — 7f83a2b3 Deployed Oct 25, 2026 by vercel[bot]
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