dolfinus commented on code in PR #68588:
URL: https://github.com/apache/airflow/pull/68588#discussion_r3549643896


##########
airflow-core/docs/core-concepts/dags.rst:
##########
@@ -707,6 +707,32 @@ This is especially useful if your tasks are built 
dynamically from configuration
             EmptyOperator(task_id="extract_orders")
 
 
+Dag Source Code Location
+------------------------
+
+You can annotate a Dag with information about the source repository and 
revision that define it.
+This metadata is stored with the serialized Dag and can be used by 
integrations that need to link a Dag run back to source code.
+
+.. code-block:: python
+
+    from airflow.sdk import DAG, SourceCodeLocation
+
+    with DAG(
+        "my_dag",
+        schedule="@daily",
+        source_code_location=SourceCodeLocation(
+            repo_url="https://github.com/apache/airflow.git";,
+            path="dags/my_dag.py",
+            version="abc123",
+            branch="main",
+        ),
+    ):

Review Comment:
   That's a nice feature to have, but other bundles don't have such information 
(LocalDagBundle, S3DagBundle), so a manual annotation should be an option.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to