Eason09053360 opened a new pull request, #74360: URL: https://github.com/apache/airflow/pull/74360
### Why `airflow sync-perm --include-dags` iterates `DBDagBag.iter_all_latest_version_dags`, which despite its name reads every `serialized_dag` row. Each Dag is synced once per stored version, and with no `ORDER BY` an older version's `access_control` can be applied last (e.g. re-granting a role that was removed) until the Dag processor next parses that file. ### What - Read only the latest version per Dag via the existing `SerializedDagModel.get_latest_serialized_dags()`, whose `dag_ids` is now optional; the underlying select already supported all Dags. - The old test mocked `session.scalars`; the new one writes two real versions to the database. related: #70935 (same change rebased onto main; the original was closed under the open-PR limit) --- ##### Was generative AI tooling used to co-author this PR? - [X] Yes — Claude Code (Opus 5.5) Generated-by: Claude Code (Opus 5.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]
