Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15420391
D19289.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
D19289.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
@@ -11,6 +11,7 @@
private $affectedPaths;
private $firstBroadcast = false;
private $wasBroadcasting;
+ private $isDraftDemotion;
public function getEditorApplicationClass() {
return 'PhabricatorDifferentialApplication';
@@ -134,6 +135,11 @@
// as "Commented" later. This should get cleaner after T10967.
$this->hasReviewTransaction = true;
break;
+ case DifferentialRevisionPlanChangesTransaction::TRANSACTIONTYPE:
+ if ($xaction->getMetadataValue('draft.demote')) {
+ $this->isDraftDemotion = true;
+ }
+ break;
}
}
@@ -497,27 +503,42 @@
protected function shouldSendMail(
PhabricatorLiskDAO $object,
array $xactions) {
-
- if (!$object->getShouldBroadcast()) {
- return false;
- }
-
return true;
}
protected function getMailTo(PhabricatorLiskDAO $object) {
- $this->requireReviewers($object);
+ if ($object->getShouldBroadcast()) {
+ $this->requireReviewers($object);
- $phids = array();
- $phids[] = $object->getAuthorPHID();
- foreach ($object->getReviewers() as $reviewer) {
- if ($reviewer->isResigned()) {
- continue;
+ $phids = array();
+ $phids[] = $object->getAuthorPHID();
+ foreach ($object->getReviewers() as $reviewer) {
+ if ($reviewer->isResigned()) {
+ continue;
+ }
+
+ $phids[] = $reviewer->getReviewerPHID();
}
+ return $phids;
+ }
- $phids[] = $reviewer->getReviewerPHID();
+ // If we're demoting a draft after a build failure, just notify the author.
+ if ($this->isDraftDemotion) {
+ $author_phid = $object->getAuthorPHID();
+ return array(
+ $author_phid,
+ );
}
- return $phids;
+
+ return array();
+ }
+
+ protected function getMailCC(PhabricatorLiskDAO $object) {
+ if (!$object->getShouldBroadcast()) {
+ return array();
+ }
+
+ return parent::getMailCC($object);
}
protected function newMailUnexpandablePHIDs(PhabricatorLiskDAO $object) {
@@ -1408,12 +1429,14 @@
return array(
'changedPriorToCommitURI' => $this->changedPriorToCommitURI,
'firstBroadcast' => $this->firstBroadcast,
+ 'isDraftDemotion' => $this->isDraftDemotion,
);
}
protected function loadCustomWorkerState(array $state) {
$this->changedPriorToCommitURI = idx($state, 'changedPriorToCommitURI');
$this->firstBroadcast = idx($state, 'firstBroadcast');
+ $this->isDraftDemotion = idx($state, 'isDraftDemotion');
return $this;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Mar 22, 1:41 PM (1 h, 10 m ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7704178
Default Alt Text
D19289.diff (2 KB)
Attached To
Mode
D19289: When a draft's builds fail and it demotes to "Changes Planned + Draft", notify the author (only) via email
Attached
Detach File
Event Timeline
Log In to Comment