Created by: bobheadxi
Closes https://github.com/sourcegraph/sourcegraph/pull/30339
This PR adds a new SteptOpt
, IfReadyForReview()
, that only enables a step if a commit is attached to a pull request and that pull request is ready for review, and adds sg ci status
support for indicating this information.
The Chromatic step now uses IfReadyForReview()
if the step is not configured to autoAcceptChanges
(which implies the main
branch at the moment). Semantically I believe this makes sense too - can't auto accept changes if you don't generate them in the first place, so we ensure they do get generated
I've updated the Buildkite settings based on the notes in https://github.com/sourcegraph/sourcegraph/pull/30339 - after testing this out, it seems that new builds created will aggressively cancel previous builds. We also won't get duplicate builds building branch commits and PRs.
❯ go run ./dev/sg ci status --build 127865 | grep 'PR\|skipped'
PR: https://github.com/sourcegraph/sourcegraph/pull/30375
- [skipped] :chromatic: Upload Storybook to Chromatic