Skip to content

fix(reporters): count a warning in the comment's heading - #238

Closed
veksen wants to merge 1 commit into
mainfrom
fix-comment-heading-warning
Closed

veksen wants to merge 1 commit into
mainfrom
fix-comment-heading-warning

Conversation

@veksen

@veksen veksen commented Sep 15, 2026

Copy link
Copy Markdown
Member

Goal

A developer reads one Query Doctor comment on their pull request. Two renderers produce it: this template, for repositories on the fat action, and Site's platform, for repositories on the ingest path. A repository running both legs gets both comments on the same pull request, so a difference between them is visible side by side.

This PR brings the two into line. Site's half is Query-Doctor/Site#4311.

What

On a run carrying a warning the heading read 1 failing and 1 successful check: two of three rows announced. It now reads 1 failing, 1 warning and 1 successful check. An outcome nothing concluded is left out rather than counted as a zero.

How

The sentence moved out of the template into the view model, where the join and the plural are readable. success.md.j2 renders {{ gateHeading }}; github.ts builds it.

formatGateHeading is a hand-maintained copy of heading in Site's apps/api/src/ci/capture/capture-comment.ts. Sharing it would mean putting it in @query-doctor/core beside summarizeGates, which this repository consumes from npm and cannot adopt in the change that ships Site's half. The two are not identical either: Site appends · N not run from an unevaluated count, and the summarizeGates in src/gate/evaluate.ts has no such field. The doc comment says both rather than claiming parity.

Tests

github.test.ts covers the warning heading beside the two cases already there: nothing failing, and one failing with one passing.

Its 78 tests pass and tsc --noEmit is clean. The full suite reports four failures, in src/sql/postgresjs.exit.test.ts, src/remote/publish-stats-on-sync.test.ts and src/remote/remote-controller.test.ts. All six tests in those three files pass when the files run alone, and none of them touches the reporter.

The heading was assembled in the template as "{failing} failing and {successful}
successful check(s)", which has no place for a warning: a run with 1 FAIL, 1 WARN
and 1 PASS announced two of its three rows. It reads "1 failing, 1 warning and 1
successful check", built in the view model where the join and the plural are
readable. An outcome nothing concluded is left out rather than counted as a zero.

Site's platform renders this same comment for repositories on its ingest path,
and both post onto one pull request, so the two headings match again (Site
#4201). Not identically: Site appends "· N not run", which this summary has no
field for, and the heading's doc comment says so rather than claiming parity.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Query Doctor — 6 successful checks

 Cost regression — No query went up more than 5%
 Untested data access — No changed data-access file without a test
 New query — No new queries
 New query with index recommendation — No new query ships an index recommendation
 Schema drift — No schema changes
 High-value nudge — No index or rewrite past the threshold


More details via MCP → get_ci_run({ runId: "01a0a344-156f-7bb3-87de-4fc4a48d5783" }) · view run · docs
3 queries read against main on assumed statistics of 10,000,000 rows per table. Sync production stats for costs measured against your real data.

@veksen

veksen commented Sep 15, 2026

Copy link
Copy Markdown
Member Author

Closing: the fat action is being deprecated, so its renderer is not worth fixing. The platform's half is Query-Doctor/Site#4311.

@veksen veksen closed this Sep 15, 2026
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