fix(reporters): stop prescribing a workflow change on a first run - #216
Merged
Conversation
There was a problem hiding this comment.

Query Doctor — 6 successful checks
More details via MCP → get_ci_run({ runId: "019fceec-8ea9-74dc-b93d-5e317d5761d2" }) · 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.
One template branch served both a project whose workflow lacks a push trigger and a correctly configured project on its first run, so the second was told to fix something that was already right. An unset comparison branch also rendered as an empty name, producing "push: branches: []". Closes Query-Doctor/Site#3841
veksen
force-pushed
the
fix-no-baseline-message
branch
from
August 4, 2026 22:36
182a812 to
8b8e26a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Goal
The no-baseline message told a user to add a
pushtrigger their workflow already had, and named an empty branch when none was set. Both land on a project's first run. Closes Query-Doctor/Site#3841.Found by putting four open-source repositories through the agent onboarding flow. Two of them hit this, on different repositories.
What
A correctly configured first run was told to fix its workflow. On Mastodon the workflow contained
push: branches: [main], the comparison branch was set, and the run producing the message was that push. There was no baseline because it was the first run.Before: "To establish a baseline, add a
pushtrigger for your comparison branch so the analyzer runs on merges tomain."After: "The analyzer records a baseline when it runs on a push to
main, and compares later runs against it. If this run is the first, the next one has something to compare against. If the workflow has nopushtrigger formain, add one."The report cannot see the workflow, so the guidance is now a condition rather than a claim about what is in it.
An unset comparison branch rendered as nothing. On listmonk the branch resolved to empty and the console read:
branches: []matches no branch. That case now says no comparison branch is set, and says to set one.How
Read
success.md.j2first, thenbaseline-notice.ts.The template had one branch serving both situations. It now splits on whether
comparisonBranchis present.The console message moved out of
main.tsintobaselineNotFoundMessage, which made the empty case reachable from a test. It was inline in a long function, which is part of why it went unnoticed.The branch resolves from the project's configured comparison branch, then the pull request base, then the current branch. On a push run for a project with none set, all three can be absent.
Tests
Both suites assert the property rather than the sentence. The template test checks that no empty inline code span survives rendering, which is the shape of the bug, and covers a comparison branch that is absent and one that is the empty string. The empty string is what production actually produced, and the first version of these tests did not cover it.
baselineNotFoundMessageis covered for empty, undefined and null.Both were mutation-checked. Forcing the template back to the single branch turns two cases red; removing the guard in
baselineNotFoundMessageturns three red.Two existing cases from Site#3287 asserted the old sentence verbatim. Their purpose is to keep "no baseline" distinct from "temporarily unavailable", which still holds, so they now assert the phrase that survived rather than the one that changed.
npm run typecheckclean.src/reportersandsrc/sync: 185 passed across 12 files.What changed since the first push
The first version of these tests was weak in three ways, and I rewrote them rather than leave them. Two assertions could never fail: the template never contained
branches: [], which is a string frommain.ts, andmerges tono longer exists in either template branch. A third matched/If the workflow/, pinning my own wording, so it would have caught a rewrite and not a defect.