Repository: AlexsLemonade/refinebio

Issue:
Rename 'Refine.bio Mail Robot' to something descriptive
### Context

'Refine.bio Mail Robot' isn't super descriptive of what we use that email for. We use it to provide information about the datasets - processed or failed and the name should reflect that.

Also am a little concerned of the word robot getting it flagged and pushed into a non-primary inbox folder. 

### Problem or idea

Rename it `refine.bio Datasets` (yes, lower case r) 

### Solution or next step

@davidsmejia Is there anything else we use that email for? 



Discussion:
We can make that change [ here ](https://github.com/AlexsLemonade/refinebio/blob/e2a5b53b5abfe4d99fd7b5e988a62b1330ad9d74/workers/data_refinery_workers/processors/smasher.py#L434)

We only send emails for datasets - note that this sender is for successful and unsuccessful processing mails.

Resolving patch:
diff --git a/workers/data_refinery_workers/processors/smasher.py b/workers/data_refinery_workers/processors/smasher.py
--- a/workers/data_refinery_workers/processors/smasher.py
+++ b/workers/data_refinery_workers/processors/smasher.py
@@ -431,7 +431,7 @@ def _notify_send_email(job_context):
     """Send email notification to the user if the dataset succeded or failed."""
     dataset_url = "https://www.refine.bio/dataset/" + str(job_context["dataset"].id)
 
-    SENDER = "Refine.bio Mail Robot <noreply@refine.bio>"
+    SENDER = "refine.bio Datasets <noreply@refine.bio>"
     RECIPIENT = job_context["dataset"].email_address
     SLACK_CCDL_EMAIL = "z7m4g8w4o6f5e0e7@alexslemonade.slack.com"
     CHARSET = "UTF-8"


Test patch:
diff --git a/workers/tests/processors/test_smasher.py b/workers/tests/processors/test_smasher.py
--- a/workers/tests/processors/test_smasher.py
+++ b/workers/tests/processors/test_smasher.py
@@ -1329,6 +1329,10 @@ def test_notify(self, mock_boto_client):
         self.assertTrue(final_context.get("success", True))
         mock_boto_client.assert_called_once_with("ses", region_name="dummy region")
         ses_client_mock.send_email.assert_called_once()
+        self.assertEqual(
+            ses_client_mock.send_email.call_args.kwargs["Source"],
+            "refine.bio Datasets <noreply@refine.bio>",
+        )
 
         # Now try explicitly setting notify_me false
         mock_boto_client.reset_mock()
@@ -1383,7 +1387,10 @@ def setUp(self):
             "experiments": {
                 "E-GEOD-44719": {
                     "accession_code": "E-GEOD-44719",
-                    "sample_accession_codes": ["IFNa DC_LB016_IFNa", "undefined_sample"],
+                    "sample_accession_codes": [
+                        "IFNa DC_LB016_IFNa",
+                        "undefined_sample",
+                    ],
                 }
             },
             "samples": {
@@ -1429,7 +1436,10 @@ def setUp(self):
                                         "name": "Sample_source_name",
                                         "value": "pineal glands at CT18, after light exposure",
                                     },
-                                    {"name": "Sample_title", "value": "Pineal_Light_CT18"},
+                                    {
+                                        "name": "Sample_title",
+                                        "value": "Pineal_Light_CT18",
+                                    },
                                 ],
                             },
                             # For single-key object whose key is "name",
@@ -1466,7 +1476,8 @@ def setUp(self):
 
         # Create a sample attribute to check for
         contribution, _ = Contribution.objects.get_or_create(
-            source_name="MetaSRA", methods_url="https://pubmed.ncbi.nlm.nih.gov/28535296/"
+            source_name="MetaSRA",
+            methods_url="https://pubmed.ncbi.nlm.nih.gov/28535296/",
         )
 
         s1 = Sample()
@@ -1518,7 +1529,10 @@ def test_all_samples(self):
             "metadata": self.metadata,
             "dataset": Dataset.objects.create(
                 aggregate_by="ALL",
-                data={"GSE56409": ["GSM1361050"], "E-GEOD-44719": ["E-GEOD-44719-GSM1089311"]},
+                data={
+                    "GSE56409": ["GSM1361050"],
+                    "E-GEOD-44719": ["E-GEOD-44719-GSM1089311"],
+                },
             ),
         }
         smashing_utils.write_tsv_json(job_context)
@@ -1562,7 +1576,10 @@ def test_experiment(self):
             "metadata": self.metadata,
             "dataset": Dataset.objects.create(
                 aggregate_by="EXPERIMENT",
-                data={"GSE56409": ["GSM1361050"], "E-GEOD-44719": ["E-GEOD-44719-GSM1089311"]},
+                data={
+                    "GSE56409": ["GSM1361050"],
+                    "E-GEOD-44719": ["E-GEOD-44719-GSM1089311"],
+                },
             ),
         }
         smashing_utils.write_tsv_json(job_context)
@@ -1600,7 +1617,11 @@ def test_unicode_writer(self):
                     "refinebio_accession_code": "eyy",
                     "refinebio_annotations": [
                         # annotation #1
-                        {"😎😎": "😎😎", "detection_percentage": 98.44078, "mapped_percentage": 100.0}
+                        {
+                            "😎😎": "😎😎",
+                            "detection_percentage": 98.44078,
+                            "mapped_percentage": 100.0,
+                        }
                     ],  # end of annotations
                 },  # end of sample #1
             },  # end of "samples"
@@ -1675,7 +1696,10 @@ def test_species(self):
             "metadata": self.metadata,
             "dataset": Dataset.objects.create(
                 aggregate_by="SPECIES",
-                data={"GSE56409": ["GSM1361050"], "E-GEOD-44719": ["E-GEOD-44719-GSM1089311"]},
+                data={
+                    "GSE56409": ["GSM1361050"],
+                    "E-GEOD-44719": ["E-GEOD-44719-GSM1089311"],
+                },
             ),
             "group_by_keys": ["homo_sapiens", "fake_species"],
             "input_files": {
@@ -1738,14 +1762,14 @@ def test_species(self):
         self.assertEqual(species_metadada["species"], "fake_species")
         self.assertEqual(len(species_metadada["samples"]), 1)
         self.assertEqual(
-            species_metadada["samples"][0]["refinebio_accession_code"], "E-GEOD-44719-GSM1089311"
+            species_metadada["samples"][0]["refinebio_accession_code"],
+            "E-GEOD-44719-GSM1089311",
         )
         self.assertEqual(species_metadada["samples"][0]["MetaSRA_age"]["value"], 3.0)
         os.remove(json_filename)
 
     @tag("smasher")
     def test_bad_smash(self):
-
         pj = ProcessorJob()
         pj.pipeline_applied = "SMASHER"
         pj.save()
@@ -1852,7 +1876,6 @@ def test_bad_smash(self):
 
     @tag("smasher")
     def test_bad_overlap(self):
-
         homo_sapiens = Organism(name="HOMO_SAPIENS", taxonomy_id=9606)
         homo_sapiens.save()