Repository navigation
Keep sync-perm going when a Dag has bad access_control - #71798
Conversation
|
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide
|
bfeddae to
3091827
Compare
potiuk
left a comment
There was a problem hiding this comment.
The production change is right and small, but the test hunk accidentally deletes an existing test (test_get_all_permissions), so that needs fixing before this merges. Details inline, plus two small nits.
This review was drafted by an AI-assisted tool and
confirmed by an Apache Airflow maintainer. The findings
below are observations, not blockers; an Apache Airflow
maintainer — a real person — will take the next look at the
PR. If you think a finding is mis-applied, please reply on
the PR and a maintainer will weigh in.More on how Apache Airflow handles maintainer review:
contributing-docs/05_pull_requests.rst.
A single Dag whose access_control references a non-existent role (or an invalid resource/action) made airflow sync-perm --include-dags abort partway through, leaving every remaining Dag without its permissions synced. Skip the misconfigured Dag and continue with the rest so one bad Dag can no longer block permission sync for all good ones.
3091827 to
3873036
Compare
Address review feedback on apache#71798: restore test_get_all_permissions as its own function (its body had been merged into the new test's tail), and use "Dag" in the skip log message per the repo prose convention.
3873036 to
1b9c303
Compare
potiuk
left a comment
There was a problem hiding this comment.
Thanks — both points are fixed: test_get_all_permissions is back as its own test, and the log string uses "Dag". The new test is a real regression test (without the try/except the FabException from the bad Dag propagates out of create_dag_specific_permissions and the good Dag's permission is never written). Approving.
One tiny nit, not blocking: the new test's docstring still says "DAG"/"DAGs" — prose in the repo uses "Dag".
This review was drafted by an AI-assisted tool and
confirmed by an Apache Airflow maintainer. The maintainer
approving this PR has read the findings and signed off. If
something feels off, please reply on the PR and a maintainer
will follow up.More on how Apache Airflow handles maintainer review:
contributing-docs/05_pull_requests.rst.
Drafted-by: Claude Code (Opus 5); reviewed by @potiuk before posting
|
Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions. |
airflow sync-perm --include-dagsiterates every Dag and syncs itsaccess_control. A single Dag referencing a non-existent role (or an invalid resource/action) raisedFabExceptionmid-loop, aborting the whole run and leaving every remaining Dag without its permissions synced.This catches
FabExceptionper-Dag increate_dag_specific_permissions, logs the misconfigured Dag, and continues with the rest — so one bad Dag can no longer block permission sync for all the good ones. The per-Dag parse path (_sync_dag_permsincollection.py) is deliberately left untouched, so a badaccess_controlstill surfaces as that Dag's import error.closes: #71795
Was generative AI tooling used to co-author this PR?
Generated-by: an AI coding assistant following the guidelines