diff --git a/migration/disable_feed_mail.patch b/migration/disable_feed_mail.patch new file mode 100644 index 0000000000..feddfd087e --- /dev/null +++ b/migration/disable_feed_mail.patch @@ -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(); + } diff --git a/migration/import_task.php b/migration/import_task.php index 9da8531e0e..9c7e7e5af6 100755 --- a/migration/import_task.php +++ b/migration/import_task.php @@ -123,6 +123,10 @@ for($id = intval($argv[1]); $id < intval($argv[2]); $id+=1) { $priority = 40; $status = ManiphestTaskStatus::STATUS_CLOSED_INVALID; break; + case "None": /* happens for old bugs that were closed */ + $priority = 40; + $status = ManiphestTaskStatus::STATUS_CLOSED_INVALID; + break; case "Todo / Closed": $task_type = "To Do"; $priority = 40; @@ -169,7 +173,10 @@ for($id = intval($argv[1]); $id < intval($argv[2]); $id+=1) { $priority = 40; $status = ManiphestTaskStatus::STATUS_OPEN; break; - case "None": + case "None": /* happens for old bugs that were closed */ + $priority = 40; + $status = ManiphestTaskStatus::STATUS_CLOSED_INVALID; + break; case "Reopened": case "Investigate": case "Ready": diff --git a/migration/migration_steps.txt b/migration/migration_steps.txt index 87681da6f1..e17b7c739d 100644 --- a/migration/migration_steps.txt +++ b/migration/migration_steps.txt @@ -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. -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 @@ -126,6 +129,7 @@ G) TESTS * Check if number of developers with commit rights match * Check if number of open bugs and patches roughly match * 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) * Test if emails, password reset, etc works diff --git a/migration/phab.php b/migration/phab.php index 282ea3cfd7..ec587be5ba 100644 --- a/migration/phab.php +++ b/migration/phab.php @@ -53,7 +53,6 @@ function create_custom_field_transaction($task, $user, $name, $value, $template, $transaction->setNewValue($new); $transaction->setOverrideDate($date); - // TODO: hide transactions for irrelevant fields $transactions[] = $transaction; } }