Migration tweaks, and patch to temporarily disable sending mails and updating feeds
during import of data.
This commit is contained in:
44
migration/disable_feed_mail.patch
Normal file
44
migration/disable_feed_mail.patch
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
diff --git a/src/applications/feed/PhabricatorFeedStoryPublisher.php b/src/applications/feed/PhabricatorFeedStoryPublisher.php
|
||||||
|
index ee0950f..008f8e8 100644
|
||||||
|
--- a/src/applications/feed/PhabricatorFeedStoryPublisher.php
|
||||||
|
+++ b/src/applications/feed/PhabricatorFeedStoryPublisher.php
|
||||||
|
@@ -52,6 +52,8 @@ final class PhabricatorFeedStoryPublisher {
|
||||||
|
}
|
||||||
|
|
||||||
|
public function publish() {
|
||||||
|
+ return null;
|
||||||
|
+
|
||||||
|
$class = $this->storyType;
|
||||||
|
if (!$class) {
|
||||||
|
throw new Exception("Call setStoryType() before publishing!");
|
||||||
|
diff --git a/src/applications/metamta/storage/PhabricatorMetaMTAMail.php b/src/applications/metamta/storage/PhabricatorMetaMTAMail.php
|
||||||
|
index a6c2e1e..920baf2 100644
|
||||||
|
--- a/src/applications/metamta/storage/PhabricatorMetaMTAMail.php
|
||||||
|
+++ b/src/applications/metamta/storage/PhabricatorMetaMTAMail.php
|
||||||
|
@@ -301,6 +301,8 @@ final class PhabricatorMetaMTAMail extends PhabricatorMetaMTADAO {
|
||||||
|
public function saveAndSend() {
|
||||||
|
$ret = null;
|
||||||
|
|
||||||
|
+ return $ret;
|
||||||
|
+
|
||||||
|
if (PhabricatorEnv::getEnvConfig('metamta.send-immediately')) {
|
||||||
|
$ret = $this->sendNow();
|
||||||
|
} else {
|
||||||
|
@@ -311,6 +313,8 @@ final class PhabricatorMetaMTAMail extends PhabricatorMetaMTADAO {
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function didWriteData() {
|
||||||
|
+ return;
|
||||||
|
+
|
||||||
|
parent::didWriteData();
|
||||||
|
|
||||||
|
if (!$this->getWorkerTaskID()) {
|
||||||
|
@@ -343,6 +347,8 @@ final class PhabricatorMetaMTAMail extends PhabricatorMetaMTADAO {
|
||||||
|
$force_send = false,
|
||||||
|
PhabricatorMailImplementationAdapter $mailer = null) {
|
||||||
|
|
||||||
|
+ return null;
|
||||||
|
+
|
||||||
|
if ($mailer === null) {
|
||||||
|
$mailer = $this->buildDefaultMailer();
|
||||||
|
}
|
||||||
@@ -123,6 +123,10 @@ for($id = intval($argv[1]); $id < intval($argv[2]); $id+=1) {
|
|||||||
$priority = 40;
|
$priority = 40;
|
||||||
$status = ManiphestTaskStatus::STATUS_CLOSED_INVALID;
|
$status = ManiphestTaskStatus::STATUS_CLOSED_INVALID;
|
||||||
break;
|
break;
|
||||||
|
case "None": /* happens for old bugs that were closed */
|
||||||
|
$priority = 40;
|
||||||
|
$status = ManiphestTaskStatus::STATUS_CLOSED_INVALID;
|
||||||
|
break;
|
||||||
case "Todo / Closed":
|
case "Todo / Closed":
|
||||||
$task_type = "To Do";
|
$task_type = "To Do";
|
||||||
$priority = 40;
|
$priority = 40;
|
||||||
@@ -169,7 +173,10 @@ for($id = intval($argv[1]); $id < intval($argv[2]); $id+=1) {
|
|||||||
$priority = 40;
|
$priority = 40;
|
||||||
$status = ManiphestTaskStatus::STATUS_OPEN;
|
$status = ManiphestTaskStatus::STATUS_OPEN;
|
||||||
break;
|
break;
|
||||||
case "None":
|
case "None": /* happens for old bugs that were closed */
|
||||||
|
$priority = 40;
|
||||||
|
$status = ManiphestTaskStatus::STATUS_CLOSED_INVALID;
|
||||||
|
break;
|
||||||
case "Reopened":
|
case "Reopened":
|
||||||
case "Investigate":
|
case "Investigate":
|
||||||
case "Ready":
|
case "Ready":
|
||||||
|
|||||||
@@ -95,7 +95,10 @@ D) ACCIDENTAL EMAIL SENDING
|
|||||||
===========================
|
===========================
|
||||||
|
|
||||||
All email addresses have been modified to avoid sending emails while users and tasks are being created.
|
All email addresses have been modified to avoid sending emails while users and tasks are being created.
|
||||||
Either disable email sending code in phab, or disable postfix, or figure out what happens when you try to send a ton of emails to invalid addresses.
|
|
||||||
|
However to avoid the DB filling up and postfix trying to send up loads of mails to invalid addresses, apply this patch to disable all feed logging and mails before import:
|
||||||
|
|
||||||
|
disable_feed_mail.patch
|
||||||
|
|
||||||
|
|
||||||
E) IMPORT USERS AND PROJECTS
|
E) IMPORT USERS AND PROJECTS
|
||||||
@@ -126,6 +129,7 @@ G) TESTS
|
|||||||
* Check if number of developers with commit rights match
|
* Check if number of developers with commit rights match
|
||||||
* Check if number of open bugs and patches roughly match
|
* Check if number of open bugs and patches roughly match
|
||||||
* Check for report status, attached files, missing comments, etc
|
* Check for report status, attached files, missing comments, etc
|
||||||
|
* Unpatch disable_feed_mail.patch
|
||||||
* Add email address to you user settings to test (it's set to an invalid one for testing)
|
* Add email address to you user settings to test (it's set to an invalid one for testing)
|
||||||
* Test if emails, password reset, etc works
|
* Test if emails, password reset, etc works
|
||||||
|
|
||||||
|
|||||||
@@ -53,7 +53,6 @@ function create_custom_field_transaction($task, $user, $name, $value, $template,
|
|||||||
$transaction->setNewValue($new);
|
$transaction->setNewValue($new);
|
||||||
$transaction->setOverrideDate($date);
|
$transaction->setOverrideDate($date);
|
||||||
|
|
||||||
// TODO: hide transactions for irrelevant fields
|
|
||||||
$transactions[] = $transaction;
|
$transactions[] = $transaction;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user