utkarshsahay2008-cloud opened a new pull request, #77511:
URL: https://github.com/apache/airflow/pull/77511
<!-- SPDX-License-Identifier: Apache-2.0
https://www.apache.org/licenses/LICENSE-2.0 -->
### Summary
When DAG parse results arrive out of order across bundle versions,
`SerializedDagModel.write_dag` previously persisted or updated DAG versions
without verifying that `bundle_version` still matched the bundle's current
`DagBundleModel.version`.
This change checks `DagBundleModel.version` at the start of
`SerializedDagModel.write_dag` whenever `bundle_version` is provided, skipping
writes and returning `False` if the bundle has already moved on to a different
version.
### Testing
- Added unit tests in `test_serialized_dag.py` verifying that stale
`bundle_version` writes are ignored both when DAG contents change and when the
DAG hash is unchanged.
closes: #77504
---
##### Was generative AI tooling used to co-author this PR?
- [X] Yes (please specify the tool below)
Generated-by: Gemini 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]