You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2019/12/27 19:54:06 UTC

[GitHub] [airflow] nuclearpinguin commented on a change in pull request #6932: [AIRFLOW-6374] Automate sending emails for Release management

nuclearpinguin commented on a change in pull request #6932: [AIRFLOW-6374] Automate sending emails for Release management
URL: https://github.com/apache/airflow/pull/6932#discussion_r361735056
 
 

 ##########
 File path: dev/send_email.py
 ##########
 @@ -0,0 +1,321 @@
+#!/usr/bin/python3
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# This tool is based on the Superset send_email script:
+# https://github.com/apache/incubator-superset/blob/master/RELEASING/send_email.py
+
+import smtplib
+import ssl
+from typing import List, Union
+
+try:
+    import jinja2
+except ModuleNotFoundError:
+    exit("Jinja2 is a required dependency for this script")
+try:
+    import click
+except ModuleNotFoundError:
+    exit("Click is a required dependency for this script")
+
+
+SMTP_PORT = 587
+SMTP_SERVER = "mail-relay.apache.org"
+PROJECT_NAME = "Airflow"
+PROJECT_MODULE = "airflow"
+PROJECT_DESCRIPTION = "Apache Airflow - A platform to programmatically author, " \
+                      "schedule, and monitor workflows"
+TWITTER_HANDLE = "@ApacheAirflow"
+MAILING_LIST = {
+    "dev": f"dev@{PROJECT_MODULE}.apache.org",
+    "users": f"users@{PROJECT_MODULE}.apache.org"
+}
+
+
+def string_comma_to_list(message: str) -> List[str]:
+    """
+    Split string to list
+    """
+    if not message:
+        return []
+    return message.split(",")
 
 Review comment:
   ```suggestion
       return message.split(",") if message else []
   ```
   Maybe we can use one-liner? 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services