Skip to content

fix: distinguish missing baseline from Site API fetch error#122

Merged
veksen merged 1 commit intomainfrom
veksen/pr-2767-no-baseline
Apr 20, 2026
Merged

fix: distinguish missing baseline from Site API fetch error#122
veksen merged 1 commit intomainfrom
veksen/pr-2767-no-baseline

Conversation

@veksen
Copy link
Copy Markdown
Member

@veksen veksen commented Apr 20, 2026

Summary

  • fetchPreviousRun now returns a PreviousRunResult discriminated union (found / not-found / error) so callers can tell a genuine 404 ("no baseline on branch") apart from a 5xx, timeout, or network failure.
  • main.ts emits the existing "No baseline found... add a push trigger" guidance only on not-found, and a new warning with the actual reason on error ("Failed to fetch baseline... likely a transient Site API issue — re-run the check to retry.").
  • Previously both cases produced the same misleading "No baseline found" log, so a 502 from the Site API looked identical to an actually-missing baseline.

Test plan

  • npm run typecheck — clean
  • npx vitest run — 161/161 passing

🤖 Generated with Claude Code

fetchPreviousRun now returns a discriminated PreviousRunResult so
callers can tell a genuine 404 ("no baseline on branch") apart from
a 5xx/timeout/network failure. main.ts emits the existing "no baseline"
guidance only on not-found, and a distinct transient-error warning
(with the reason) when the fetch itself fails.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Query Doctor Analysis

View full run details

2 queries analyzed

2 pre-existing issues

Using assumed statistics (10000000 rows/table). For better results, sync production stats.

@veksen veksen merged commit 4251328 into main Apr 20, 2026
6 checks passed
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