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 2022/04/06 07:58:44 UTC

[GitHub] [airflow] uranusjr commented on a diff in pull request #22754: Fix secrets rendered in UI when task is not executed.

uranusjr commented on code in PR #22754:
URL: https://github.com/apache/airflow/pull/22754#discussion_r843610043


##########
airflow/models/taskinstance.py:
##########
@@ -2069,15 +2069,27 @@ def get_rendered_template_fields(self, session: Session = NEW_SESSION) -> None:
                 setattr(self.task, field_name, rendered_value)
             self.task = task
             return
+
         try:
-            self.render_templates()
+            # Task was never executed. Initialize RenderedTaskInstanceFields
+            # to render template and mask secrets. Set MASK_SECRETS_IN_LOGS
+            # to True to enable masking similar to task run.
+            original_value = settings.MASK_SECRETS_IN_LOGS
+            settings.MASK_SECRETS_IN_LOGS = True

Review Comment:
   What code does this value affect? This monkeypatching behaviour looks too hacky from a quick glance.



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