Repository navigation
feat(warden): Wait for ready for review before running Warden - #231
Draft
sentry-junior[bot] wants to merge 1 commit into
Draft
sentry-junior[bot] wants to merge 1 commit into
sentry-junior[bot] wants to merge 1 commit into
Conversation
Ruleset-required workflows only receive opened, synchronize, and reopened, so a passing run on a draft lets a PR marked ready merge unreviewed. Fail draft runs before any model call and check the live draft state, so a re-run after marking the PR ready proceeds. Turn on incremental review so re-runs and later pushes skip hunks a clean run already covered. Co-Authored-By: Jeffrey Hung <jeffrey.hung@sentry.io>
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.
Warden runs as a ruleset-required workflow, and GitHub ignores
typesfor those: onlyopened,synchronizeandreopenedfire (docs). Warden never seesready_for_review, so a skill withdraft = falsepasses green on a draft, and a PR marked ready with no new push can merge without review. #229 and #230 can't fix this, for that reason.This makes a draft-time run count as "not yet":
.github/scripts/warden-require-ready.shasks GitHub for the PR's live draft state and fails the job on drafts, before any model call. Drafts stay cheap. A PR marked ready stays blocked until someone re-runs the Warden check or pushes. The script reads live state rather than the event payload, so a re-run passes the gate.incremental = truein[defaults]:incrementalAppwas already set, but incremental was never on, sosecurity-reviewre-reviewed every hunk on every push. Re-runs and later pushes now skip hunks a clean run already reviewed. If there is no baseline, Warden reviews the full PR.Open decisions
draft = falsein their ownwarden.tomlneed to drop it. A re-run reuses the original event payload (expected GitHub behavior, not tested here), so Warden still thinks the PR is a draft and skips those skills with a green result. Drafts no longer reach Warden after this change, sodraft = falseisn't needed anyway.integrity-reviewstill has a gap. Onsynchronizeit only reviews hunks from that one push (integrity-gate.ts). When a draft-time run fails at the gate and is re-run,integrity-reviewonly covers the last push, not the commits made while the PR was a draft. It isn't in the org config yet. Before it's enforced, either keep it out of this gate or change Warden to scope from the last completed integrity-review run..warden-orgcheckout of this repo's default branch, so the script has to merge before or together with the ruleset picking up this workflow version.via Jeffrey Hung.
--
View Session [Sentry]