Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15452697
D18745.id44997.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D18745.id44997.diff
View Options
diff --git a/src/applications/differential/editor/DifferentialTransactionEditor.php b/src/applications/differential/editor/DifferentialTransactionEditor.php
--- a/src/applications/differential/editor/DifferentialTransactionEditor.php
+++ b/src/applications/differential/editor/DifferentialTransactionEditor.php
@@ -1204,16 +1204,32 @@
// edited the title or changed subscribers), prevent "Run build plan"
// and other similar rules from acting yet, since the build results will
// not (or, at least, should not) change unless the actual source changes.
+ // We also don't run Differential builds if the update was caused by
+ // discovering a commit, as the expectation is that Diffusion builds take
+ // over once things land.
$has_update = false;
+ $has_commit = false;
+
$type_update = DifferentialTransaction::TYPE_UPDATE;
foreach ($xactions as $xaction) {
- if ($xaction->getTransactionType() == $type_update) {
+ if ($xaction->getTransactionType() != $type_update) {
+ continue;
+ }
+
+ if ($xaction->getMetadataValue('isCommitUpdate')) {
+ $has_commit = true;
+ } else {
$has_update = true;
- break;
}
+
+ break;
}
- if (!$has_update) {
+ if ($has_commit) {
+ $adapter->setForbiddenAction(
+ HeraldBuildableState::STATECONST,
+ DifferentialHeraldStateReasons::REASON_LANDED);
+ } else if (!$has_update) {
$adapter->setForbiddenAction(
HeraldBuildableState::STATECONST,
DifferentialHeraldStateReasons::REASON_UNCHANGED);
diff --git a/src/applications/differential/herald/DifferentialHeraldStateReasons.php b/src/applications/differential/herald/DifferentialHeraldStateReasons.php
--- a/src/applications/differential/herald/DifferentialHeraldStateReasons.php
+++ b/src/applications/differential/herald/DifferentialHeraldStateReasons.php
@@ -5,6 +5,7 @@
const REASON_DRAFT = 'differential.draft';
const REASON_UNCHANGED = 'differential.unchanged';
+ const REASON_LANDED = 'differential.landed';
public function explainReason($reason) {
$reasons = array(
@@ -14,6 +15,9 @@
self::REASON_UNCHANGED => pht(
'The update which triggered Herald did not update the diff for '.
'this revision, so builds will not run.'),
+ self::REASON_LANDED => pht(
+ 'The update which triggered Herald was an automatic update in '.
+ 'response to discovering a commit, so builds will not run.'),
);
return idx($reasons, $reason);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Mar 30, 6:49 AM (4 d, 16 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7681153
Default Alt Text
D18745.id44997.diff (2 KB)
Attached To
Mode
D18745: Don't run Herald build rules when Differential revisions are updated automatically
Attached
Detach File
Event Timeline
Log In to Comment