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


##########
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:
   For sure, I was not clear enough above: manual annotation should be the way 
to go, but if not provided, as a fallback, we could check if git bundle is used 
and get information from there.



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