You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "vchiapaikeo (via GitHub)" <gi...@apache.org> on 2024/02/26 14:30:52 UTC

[PR] Deprecate smtp configs in airflow settings / local_settings [airflow]

vchiapaikeo opened a new pull request, #37711:
URL: https://github.com/apache/airflow/pull/37711

   <!--
    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.
    -->
   
   <!--
   Thank you for contributing! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   In case of an existing issue, reference it using one of the following:
   
   closes: #ISSUE
   related: #ISSUE
   
   How to write a good git commit message:
   http://chris.beams.io/posts/git-commit/
   -->
   
   
   
   <!-- Please keep an empty line above the dashes. -->
   ---
   **^ Add meaningful description above**
   Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)** for more information.
   In case of fundamental code changes, an Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals)) is needed.
   In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
   In case of backwards incompatible changes please leave a note in a newsfragment file, named `{pr_number}.significant.rst` or `{issue_number}.significant.rst`, in [newsfragments](https://github.com/apache/airflow/tree/main/newsfragments).
   


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Deprecate smtp configs in airflow settings / local_settings [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk merged PR #37711:
URL: https://github.com/apache/airflow/pull/37711


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Deprecate smtp configs in airflow settings / local_settings [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on PR #37711:
URL: https://github.com/apache/airflow/pull/37711#issuecomment-1965210530

   Also I think we should release 1.6.1 NOT 1.7.0. Technically it will be a bugfix to buggy feature added it 1.6.0. Even if we yank 1.6.0, this one is still adding the same feature already added in 1.6.* (only properly).


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Deprecate smtp configs in airflow settings / local_settings [airflow]

Posted by "Taragolis (via GitHub)" <gi...@apache.org>.
Taragolis commented on code in PR #37711:
URL: https://github.com/apache/airflow/pull/37711#discussion_r1503055680


##########
airflow/providers/smtp/provider.yaml:
##########
@@ -87,3 +87,19 @@ config:
         version_added: 1.3.0
         example: "default"
         default: ~
+      default_templated_email_subject_path:
+        description: |
+          Allows overriding of the standard templated email subject line when the SmtpNotifier is used.
+          Must provide a path.
+        type: string
+        version_added: 2.9.0

Review Comment:
   ```suggestion
           version_added: 1.6.1
   ```
   
   This fields uses for a provider version
   
   **Update version**: https://github.com/apache/airflow/pull/37711#issuecomment-1965210530



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Deprecate smtp configs in airflow settings / local_settings [airflow]

Posted by "Taragolis (via GitHub)" <gi...@apache.org>.
Taragolis commented on code in PR #37711:
URL: https://github.com/apache/airflow/pull/37711#discussion_r1503055937


##########
airflow/providers/smtp/provider.yaml:
##########
@@ -87,3 +87,19 @@ config:
         version_added: 1.3.0
         example: "default"
         default: ~
+      default_templated_email_subject_path:
+        description: |
+          Allows overriding of the standard templated email subject line when the SmtpNotifier is used.
+          Must provide a path.
+        type: string
+        version_added: 2.9.0
+        example: "path/to/override/email_subject.html"
+        default: ~
+      default_templated_html_content_path:
+        description: |
+          Allows overriding of the standard templated email path when the SmtpNotifier is used. Must provide
+          a path.
+        type: string
+        version_added: 2.9.0

Review Comment:
   ```suggestion
           version_added: 1.6.1
   ```
   
   **Update version**: https://github.com/apache/airflow/pull/37711#issuecomment-1965210530



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Deprecate smtp configs in airflow settings / local_settings [airflow]

Posted by "Taragolis (via GitHub)" <gi...@apache.org>.
Taragolis commented on code in PR #37711:
URL: https://github.com/apache/airflow/pull/37711#discussion_r1503055680


##########
airflow/providers/smtp/provider.yaml:
##########
@@ -87,3 +87,19 @@ config:
         version_added: 1.3.0
         example: "default"
         default: ~
+      default_templated_email_subject_path:
+        description: |
+          Allows overriding of the standard templated email subject line when the SmtpNotifier is used.
+          Must provide a path.
+        type: string
+        version_added: 2.9.0

Review Comment:
   ```suggestion
           version_added: 1.7.0
   ```
   
   This fields uses for a provider version



##########
airflow/providers/smtp/provider.yaml:
##########
@@ -87,3 +87,19 @@ config:
         version_added: 1.3.0
         example: "default"
         default: ~
+      default_templated_email_subject_path:
+        description: |
+          Allows overriding of the standard templated email subject line when the SmtpNotifier is used.
+          Must provide a path.
+        type: string
+        version_added: 2.9.0
+        example: "path/to/override/email_subject.html"
+        default: ~
+      default_templated_html_content_path:
+        description: |
+          Allows overriding of the standard templated email path when the SmtpNotifier is used. Must provide
+          a path.
+        type: string
+        version_added: 2.9.0

Review Comment:
   ```suggestion
           version_added: 1.7.0
   ```



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Deprecate smtp configs in airflow settings / local_settings [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on code in PR #37711:
URL: https://github.com/apache/airflow/pull/37711#discussion_r1503258455


##########
airflow/settings.py:
##########
@@ -503,6 +503,15 @@ def import_local_settings():
             setattr(airflow_local_settings, "task_policy", airflow_local_settings.policy)
             names.remove("policy")
 
+        if "SMTP_DEFAULT_TEMPLATED_SUBJECT" in names or "SMTP_DEFAULT_TEMPLATED_HTML_CONTENT_PATH" in names:
+            warnings.warn(
+                "Configuring non-default `SMTP_DEFAULT_TEMPLATED_SUBJECT` and "
+                "`SMTP_DEFAULT_TEMPLATED_HTML_CONTENT_PATH` is deprecated. Please upgrade to "
+                "the new version of the SMTP provider and use provider configurations instead.",
+                AirflowProviderDeprecationWarning,
+                stacklevel=2,
+            )
+

Review Comment:
   Yes. We should IMHO yank 1.6.0 and forget about those old settings.



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Deprecate smtp configs in airflow settings / local_settings [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on PR #37711:
URL: https://github.com/apache/airflow/pull/37711#issuecomment-1966754911

   Should be good to go @eladkal 


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Deprecate smtp configs in airflow settings / local_settings [airflow]

Posted by "Taragolis (via GitHub)" <gi...@apache.org>.
Taragolis commented on code in PR #37711:
URL: https://github.com/apache/airflow/pull/37711#discussion_r1503048385


##########
airflow/settings.py:
##########
@@ -503,6 +503,15 @@ def import_local_settings():
             setattr(airflow_local_settings, "task_policy", airflow_local_settings.policy)
             names.remove("policy")
 
+        if "SMTP_DEFAULT_TEMPLATED_SUBJECT" in names or "SMTP_DEFAULT_TEMPLATED_HTML_CONTENT_PATH" in names:
+            warnings.warn(
+                "Configuring non-default `SMTP_DEFAULT_TEMPLATED_SUBJECT` and "
+                "`SMTP_DEFAULT_TEMPLATED_HTML_CONTENT_PATH` is deprecated. Please upgrade to "
+                "the new version of the SMTP provider and use provider configurations instead.",
+                AirflowProviderDeprecationWarning,
+                stacklevel=2,
+            )
+

Review Comment:
   I'm not sure do we need this check if we consider that this settings originally added by a mistake.
   Let's wait what the other say.



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Deprecate smtp configs in airflow settings / local_settings [airflow]

Posted by "Taragolis (via GitHub)" <gi...@apache.org>.
Taragolis commented on code in PR #37711:
URL: https://github.com/apache/airflow/pull/37711#discussion_r1502802293


##########
airflow/providers/smtp/notifications/templates/email_subject.jinja:
##########


Review Comment:
   You could add into the top of the header and in this case RAT check should be pass
   
   ```jinja
   {#
    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 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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org