ametel01 opened a new pull request, #68588: URL: https://github.com/apache/airflow/pull/68588
Adds Dag-level source code location metadata that can record repository, path, revision, branch, or tag information and preserves it through Dag serialization. The OpenLineage provider now emits this metadata as the OpenLineage `sourceCodeLocation` job facet for Dag-run events and task events, so lineage consumers can link emitted jobs back to the source that defined the Dag. closes: #51321 Tests: - `uv run --frozen --project task-sdk pytest task-sdk/tests/task_sdk/definitions/test_dag.py::test_dag_source_code_location_from_mapping task-sdk/tests/task_sdk/definitions/test_dag.py::test_source_code_location_requires_url_or_repo_url task-sdk/tests/task_sdk/definitions/test_dag.py::test_source_code_location_rejects_unknown_type -q` - `uv run --frozen --project airflow-core pytest airflow-core/tests/unit/serialization/test_dag_serialization.py::test_dag_source_code_location_serialization_roundtrip airflow-core/tests/unit/serialization/test_dag_serialization.py::test_dag_source_code_location_omits_none_values -q` - `uv run --frozen --project providers/openlineage pytest providers/openlineage/tests/unit/openlineage/utils/test_utils.py::test_get_source_code_location_job_facet providers/openlineage/tests/unit/openlineage/utils/test_utils.py::test_get_source_code_location_job_facet_returns_empty_for_missing_metadata providers/openlineage/tests/unit/openlineage/utils/test_utils.py::test_build_task_event_job_facets_includes_source_code_location providers/openlineage/tests/unit/openlineage/plugins/test_adapter.py::test_dag_success_includes_job_facets providers/openlineage/tests/unit/openlineage/plugins/test_adapter.py::test_dag_failed_includes_job_facets providers/openlineage/tests/unit/openlineage/plugins/test_listener_airflow3.py::TestDagRunStateChangeProcess::test_dag_run_running_emits_source_code_location_job_facet providers/openlineage/tests/unit/openlineage/plugins/test_listener_airflow3.py::TestDagRunStateChangeProcess::test_dag_run_success_emits_source_code_location_job_facet providers/op enlineage/tests/unit/openlineage/plugins/test_listener_airflow3.py::TestDagRunStateChangeProcess::test_dag_run_failed_emits_source_code_location_job_facet -q` - `prek run --from-ref main --stage pre-commit --skip check-schema-defaults` - `git diff --check main...HEAD` Note: `prek run --from-ref main --stage pre-commit` and the local pre-push hook were also attempted, but Docker-backed Airflow hooks failed because the Docker daemon is unavailable at `/Users/alexmetelli/.docker/run/docker.sock` in this environment. --- ##### Was generative AI tooling used to co-author this PR? - [X] Yes — OpenAI Codex (GPT-5) Generated-by: OpenAI Codex (GPT-5) following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions) -- 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]
