Skip to content

Baseline every Percy build against main - #6077

Open
backspace wants to merge 1 commit into
mainfrom
percy-target-branch-main
Open

Baseline every Percy build against main#6077
backspace wants to merge 1 commit into
mainfrom
percy-target-branch-main

Conversation

@backspace

Copy link
Copy Markdown
Contributor

Percy picks a build's baseline from git history when nothing tells it otherwise. A branch stacked on another feature branch is therefore compared against its parent rather than against main, and inherits whatever that parent's most recent build happened to contain.

The case that hurts is a parent build that lost snapshots. The child compares its full set against a partial one, every snapshot with no counterpart reads as new, and the build lands with most of the suite needing review — with nothing on the build explaining why.

The build that prompted this

A 59-snapshot build was baselined against a four-snapshot build on a sibling branch, whose own review state was missing_snapshots. 55 snapshots reported as changed, at diff-ratio: 1 — the ratio for "no counterpart to compare against", not for a visual change. None of the 55 were real.

That has now happened on two branches, and it is indistinguishable at a glance from a change that genuinely moved the whole suite.

Why the existing gate does not cover it

The reject step in this workflow already stops a partial build becoming a baseline on main, and its comment describes exactly this failure: a partial set becomes the baseline every later branch is compared against. What it cannot do is stop a partial build on a feature branch from being inherited by something stacked on it — nothing rejects those, because nothing needs to until they are used as a baseline.

Pinning the target branch closes that path without having to extend the gate.

What changes

Every build now compares against main, which is gated by that reject step and auto-approved. For a stacked PR the diff becomes its cumulative effect against main rather than only its increment over its parent — the same comparison an unstacked branch already gets, and the one a reviewer of the eventual merge cares about.

Set on the step that takes snapshots rather than the finalize step: the baseline is chosen when the build is created by the first shard to upload, and finalize only seals it.

Percy picks a build's baseline from git history when nothing tells it
otherwise, so a branch stacked on another feature branch is compared against
its parent rather than against main — and inherits whatever that parent's most
recent build happened to contain.

A parent build that lost snapshots is the case that hurts. The child compares
its full set against a partial one, every snapshot with no counterpart in the
baseline reads as new, and the build lands with most of the suite needing
review. One such build compared 59 snapshots against a four-snapshot baseline
on a sibling branch and reported 55 changes, none of them real.

The reject step already keeps a partial build from becoming a baseline on
`main`. It does not cover a partial build on a feature branch, which is not
rejected and can still be inherited by anything stacked on it. Pinning the
target branch closes that path without needing to.

It also means a stacked PR's diff shows its cumulative effect against main,
which is what an unstacked branch already gets.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-10T16:38:56.657971Z c5dbe85 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown
Contributor

Host Test Results

    1 files      1 suites   1h 51m 47s ⏱️
4 733 tests 4 719 ✅ 14 💤 0 ❌
4 748 runs  4 734 ✅ 14 💤 0 ❌

Results for commit c5dbe85.

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