ephraimbuddy opened a new pull request, #69864: URL: https://github.com/apache/airflow/pull/69864
Adds the shared engine that computes an observed-state diff between two stored serialized Dag versions. Dag authors and operators need a reliable way to understand how two stored versions differ without downloading serialized payloads or manually comparing implementation details. This is the **foundation** of a three-part stack; the REST API endpoint and the `airflow dags versions diff` CLI command follow in separate PRs that build on this engine. It intentionally ships with no runtime caller yet — it is fully exercised by unit tests. ### What it does - `build_serialized_dag_diff` — pure, deterministic, bounded diff over two serialized payloads. Normalizes task/schedule/dependency/metadata state, converts legacy schema shapes (v1/v2 → v3), keys order-insensitive collections, categorizes each change (task, dependency, schedule, param, asset, callback, deadline, metadata, provenance) and its impact, and emits digests plus optional raw values. - `get_dag_version_diff` — DB-facing wrapper that loads two `DagVersion`s, assembles provenance, and classifies optional source/values data as available, redacted, or unavailable. - Malformed legacy payloads and missing historical data degrade to an `unavailable` result instead of failing the whole request. ### Testing - 32 unit tests, including a `@pytest.mark.db_test` class covering `get_dag_version_diff` end-to-end: observed-state diff, not-found handling, version-number validation, and the values/source status plumbing (available, redacted, unavailable-when-code-missing). - prek (ruff, mypy, license, no-new-AirflowException) clean. No newsfragment: the engine has no user-facing surface on its own; user-facing notes ship with the API and CLI PRs. --- ##### Was generative AI tooling used to co-author this PR? - [X] Yes — Claude Code (Opus 4.8) Generated-by: Claude Code (Opus 4.8) following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions) --- Drafted-by: Claude Code (Opus 4.8) (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]
