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


##########
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:
   Keeping manual annotation as the PR behavior. A Git bundle fallback would 
only help GitDagBundle, while the Dag-level API still needs to work for 
LocalDagBundle, S3DagBundle, and manually managed source locations. I am 
leaving automatic inference out of this PR so the public API and emitted facet 
remain explicit and bundle-independent.
   
   ---
   Drafted-by: OpenAI Codex (GPT-5.5) (no human review before posting)



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