ci(web-deploy): only commit blog baseline on push, not on PRs#2828
Conversation
The "Commit pre-refreshed blog baseline" step pushes to develop, which branch protection rejects (GH013) on PR runs — failing the whole visual-regression job even when the regression check itself passed (observed on #2827). The workflow's own comments at lines 205-210 already document the post-merge blog-baseline auto-refresh as a push-only contract; this brings the step's `if:` into line with that intent. Trigger pattern: a PR behind develop where develop has merged a `web/content/blog/posts/` change since the branch point. detect-scope sees that file as "changed" in the PR diff, sets blog_content_changed, the pre-refresh regenerates the baseline, the regression check passes, and then the commit step fires and the push is rejected. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: Peter Amiri <peter@alurium.com>
There was a problem hiding this comment.
Wheels Bot — Reviewer A
TL;DR: Minimal, correct CI fix. Adds github.event_name == 'push' as the first guard on the "Commit pre-refreshed blog baseline" step so that the git push origin HEAD:develop it contains never fires on PR runs. The change realigns code with the block comment at lines 205-210 that has always documented push-only behavior for the auto-refresh. Verdict: approve.
Correctness
The logic is sound across all three relevant scenarios:
| Event | blog_content_changed | regress.outcome | Step fires? |
|---|---|---|---|
| push | true | success | Yes — as intended |
| push | true | failure | No — correct (don't commit on regression) |
| pull_request | true | success | No — correct (can't push; branch protection) |
The Pre-refresh blog baseline before regression test step (line 269) intentionally has no event_name guard — it regenerates the baseline in-place so the comparison is fair on PRs. Only the subsequent commit+push step needs the guard added here, and that is exactly what this PR does.
The retry loop (lines 308-333) and the rebase-conflict exit-0 path are unchanged and still function correctly for the push path.
Commits
ci(web-deploy): only commit blog baseline on push, not on PRs
Type ci is in the allowlist, scope is optional and unrestricted, subject is sentence-case and well under 100 characters. Commit conforms to commitlint.config.js.
|
Line1 |
Wheels Bot -- Reviewer B (round 1)A's review checks out. The truth table covers the three failure-relevant combinations, the explanation of why the pre-refresh step (line 269) intentionally stays unguarded is accurate, and the commit message assessment is correct. No issues with A's analysis or verdict. SycophancyNone detected. The approve verdict is backed by explicit scenario analysis and a reference to the existing block comment at lines 205-210 that already documented push-only intent. False positivesNone detected. Verified against the diff: the single added line is Missed issuesNone detected. This is a CI-only change -- no CFML code touched, so cross-engine concerns do not apply. The condition syntax is valid GitHub Actions expression syntax in a YAML literal block. No security, migration, or DI subsystems are in scope. Verdict alignmentA's approve is consistent with the findings: a correct, minimal, well-explained guard that realigns code with existing documentation. ConvergenceAligned. A's analysis is accurate and the approve verdict is appropriate for this change. |
…eline-push-pr-gate
There was a problem hiding this comment.
Wheels Bot — Reviewer A
TL;DR: This PR adds github.event_name == 'push' && as the first guard on the "Commit pre-refreshed blog baseline" step in the visual-regression job, preventing the git push origin HEAD:develop from firing on PR runs where branch protection would reject it (GH013). The change is minimal, correct, and precisely targeted. The head SHA (20a798560) is a merge-from-develop sync commit; the substantive PR change remains the single line at 9e27f3a47. Verdict: approve.
Correctness
The added guard is the right fix for the described failure mode. The three relevant event × condition combinations all behave correctly after this change:
| Event | blog_content_changed |
regress.outcome |
Step fires? |
|---|---|---|---|
push |
true |
success |
Yes — push proceeds as intended |
push |
true |
failure |
No — existing steps.regress.outcome == 'success' guard prevents it |
pull_request |
true |
success |
No — new event_name == 'push' guard blocks it |
The Pre-refresh blog baseline before regression test step (line 269) correctly has no event_name guard — it regenerates a local baseline so the comparison is valid on PRs without attempting a push. Only the downstream commit+push step needed the guard, and that is exactly what this PR adds.
The retry loop (lines 308–333), the fetch+rebase path, and the rebase-conflict exit-0 path are all unmodified and continue to work correctly for push events.
Commits
ci(web-deploy): only commit blog baseline on push, not on PRs
Type ci is in the commitlint.config.js allowlist, the subject is sentence-case and well under 100 characters, and the commit body explains the trigger pattern and the workflow comment it aligns with. DCO Signed-off-by trailer is present and matches the author identity.
The head commit (20a798560) is a merge from develop with no changes to this workflow file — it does not affect the review.
Wheels Bot — Reviewer B (round 1)A's review checks out on the new head SHA. The truth table is accurate against the diff, the distinction between the local-only pre-refresh step and the commit+push step is correct, and the commit metadata assessment is right. No issues with A's analysis or verdict. SycophancyNone detected. The approve is backed by a truth table and an explicit explanation of why the pre-refresh step stays unguarded. False positivesNone detected. Verified the diff: one line added — Missed issuesNone detected. CI-only change; no CFML code touched, so cross-engine invariants do not apply. No security, migration, DI, or other sensitive subsystems in scope. Verdict alignmentA's approve is consistent with the findings: a minimal, correct, precisely targeted guard that realigns code with the block comment already documenting push-only intent. ConvergenceAligned. A's analysis and approve verdict are correct for this SHA. |
Summary
Commit pre-refreshed blog baselinestep invisual-regressionongithub.event_name == 'push'so it stops running on PRs and being rejected by branch protection.git push origin HEAD:develops the auto-refreshedweb/tests/visual-baselines/blog.png. On PR runs that push is rejected withGH013("Changes must be made through a pull request"), failing the whole job even when the regression check itself passed.Trigger pattern
A PR that's behind develop, where develop has merged a
web/content/blog/posts/change since the branch point:detect-scopesees that file as "changed" in the PR diff (the PR branch doesn't have it yet).blog_content_changed=true, soPre-refresh blog baseline before regression testruns and regenerates the baseline locally.Run visual regressionpasses (steps.regress.outcome == 'success').Commit pre-refreshed blog baselinefires under the old condition, attemptsgit push origin HEAD:develop, and is rejected — failing the job.Observed on #2827.
What's NOT changed
Pre-refresh blog baseline before regression test(line ~268) stays as-is — it only regenerates a local baseline so the regression check has something current to compare against. It doesn't push, so it doesn't fail on PRs.developis still handled the same way.Test plan
visual-regressioneither skipping the commit step (whenblog_content_changed=false) or running it conditionally without the push attempt (whenblog_content_changed=true).web/content/blog/posts/, confirm the auto-refresh push still fires and succeeds.🤖 Generated with Claude Code