Page MenuHomePhabricator

Don't run Herald build and mail rules when they don't make sense
ClosedPublic

Authored by epriestley on Oct 24 2017, 9:21 PM.
Tags
None
Referenced Files
F12838756: D18731.id44973.diff
Thu, Mar 28, 6:36 PM
Unknown Object (File)
Tue, Mar 19, 6:05 AM
Unknown Object (File)
Feb 1 2024, 11:24 PM
Unknown Object (File)
Jan 31 2024, 5:46 PM
Unknown Object (File)
Jan 25 2024, 12:38 AM
Unknown Object (File)
Jan 22 2024, 6:12 AM
Unknown Object (File)
Jan 3 2024, 6:47 AM
Unknown Object (File)
Dec 27 2023, 12:20 PM
Subscribers
Restricted Owners Package

Details

Summary

Ref T2543. Fixes T10109.

Currently, Herald only runs in Differential when a change updates the diff. This is partly for historical reasons, and partly because we don't want to restart builds every time someone makes a comment. However, this behavior is inconsistent with other applications (which always trigger on any change), and occasionally confusing to users (in T10109, for example) or otherwise undesirable.

A similar issue is that T2543 has introduced a "Draft" state, where revisions don't send normal mail until builds finish. This interacts poorly with "Send me an email" rules (which shouldn't do anything here) and particularly with "Send me an email + only run these actions the first time the rule matches", since that might have an effect like "do nothing when the revision is created, then never anything again since you already did nothing once".

To navigate both of these issues, let objects tell Herald that certain actions (like mail or builds) are currently forbidden. If a rule uses a field or action which is currently forbidden, the whole rule automatically fails before it executes, but doesn't count toward "only the first time" as far as Herald's tracking of rule execution is concerned.

Then, forbid mail for draft revisions, and forbid builds for revisions which didn't just get updated. Forbidding mail fixes the issues with "Send me an email" that were created by the introduction of the draft state.

Finally, make Herald run on every revision update, not just substantive updates to the diff. This resolves T10109.

Test Plan

Created revisions via the draft -> submit workflow, saw different transcripts. Here's a mail action being forbidden for a draft:

Screen Shot 2017-10-24 at 2.09.46 PM.png (148×616 px, 25 KB)

Here's a build action being forbidden for a "mundane" update:

Screen Shot 2017-10-24 at 2.10.19 PM.png (152×768 px, 28 KB)

Diff Detail

Repository
rP Phabricator
Branch
dherald1
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 18742
Build 25253: Run Core Tests
Build 25252: arc lint + arc unit