HomePhabricator

Add "Revision has passing builds" Herald rules for commit content (pushes) and…

Description

Add "Revision has passing builds" Herald rules for commit content (pushes) and commits (discovery)

Summary:
Depends on D20469. Ref T13276. See PHI1159. See PHI953. See PHI901.

Allow Herald to detect when "arc land" would (or did) warn users about failed or ongoing builds. This respects the "Warn on Landing" build plan behavior.

To accomplish this:

  • When we close a revision, set a "wrong build state" flag if it lands in the wrong build state.
  • If the revision is closed when we hit Herald, look for the flag.
  • If not (common for push rules, can happen for commit rules if we race against the revision update worker), hit Harbormaster ourselves and check the current state.

Test Plan:

  • Wrote a "Require Green" rule.
  • Ran it against various commits with various build states (good, not good).
  • Fiddled with "Warn on Landing" and saw the effect in rule evaluation.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13276

Differential Revision: https://secure.phabricator.com/D20470