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 2020/08/12 01:23:55 UTC

[GitHub] [airflow] jaketf commented on a change in pull request #10282: Add ClusterPolicyViolation support to airflow local settings

jaketf commented on a change in pull request #10282:
URL: https://github.com/apache/airflow/pull/10282#discussion_r468952337



##########
File path: docs/concepts.rst
##########
@@ -1207,6 +1211,66 @@ queue during retries:
             ti.queue = 'retry_queue'
 
 
+Cluster Policies for Custom Task Checks
+-----------------------------
+You may also use Cluster Policies to  apply cluster-wide checks on Airflow
+tasks. You can raise :class:`~airflow.exceptions.AirflowClusterPolicyViolation`
+in a policy or task mutation hook (described below) to prevent a DAG from being
+imported or prevent a task from being executed if the task is not compliant with
+your check.
+
+These checks are intended to help teams using Airflow to protect against common
+beginner errors that may get past a code reviewer, rather than as technical
+security controls.
+
+For example, don't run tasks without airflow owners:
+
+.. code-block:: python
+    def task_must_have_owners(task: BaseOperator):

Review comment:
       Hmm this link seems not to be rendering properly.
   ![image](https://user-images.githubusercontent.com/11599048/89964712-c7981e00-dbff-11ea-97bf-1d52ea232c74.png)
   




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