Add allowed_run_types to whitelist specific dag run types#61833
Add allowed_run_types to whitelist specific dag run types#61833guan404ming merged 8 commits intoapache:mainfrom
Conversation
d22c599 to
08df0af
Compare
|
Great work! I get It's solved if I change |
eladkal
left a comment
There was a problem hiding this comment.
I think we are missing tests for cases like:
from airflow.utils.types import DagRunType
my_dag = DAG(
...,
schedule=[example_asset]
deny_dag_run_types = [DagRunType.ASSET_TRIGGERED]
)
from airflow.utils.types import DagRunType
my_dag = DAG(
...,
schedule="@daily"
deny_dag_run_types = [DagRunType.SCHEDULED]
)
from airflow.utils.types import DagRunType
my_dag = DAG(
...,
schedule=None
deny_dag_run_types = [DagRunType.MANUAL]
)
Test should verify broken dag message is raised for all these 3 cases
e4f3907 to
dbbc219
Compare
Thanks, just updated to make the tests covering more cased.
Sure, that is a nice suggestion. I've updated to support that and also fix some type issue there. |
0bb60cb to
e6c003b
Compare
|
Thanks for all the comments. I just updated with @ashb review comments and will handle @jason810496's tomorrow! |
e6c003b to
c05d343
Compare
658c46a to
41b9a51
Compare
airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_run.py
Outdated
Show resolved
Hide resolved
4446d03 to
de27d5a
Compare
|
@guan404ming did you address all comments? are we ready to merge? |
|
Yes, I think I have resolved all the comments and we could refine it if there is any issue after merging. |
jason810496
left a comment
There was a problem hiding this comment.
Nice! Thanks for the rapid update!
airflow-core/src/airflow/api_fastapi/core_api/routes/public/backfills.py
Show resolved
Hide resolved
airflow-core/src/airflow/migrations/versions/0104_3_2_0_add_allowed_run_types_to_dag.py
Show resolved
Hide resolved
airflow-core/src/airflow/ui/public/i18n/locales/en/components.json
Outdated
Show resolved
Hide resolved
de27d5a to
b690c32
Compare
|
Hi @jason810496, thanks for your great catch. I just updated with your comments. |
Signed-off-by: Guan-Ming (Wesley) Chiu <105915352+guan404ming@users.noreply.github.com>
Signed-off-by: Guan-Ming (Wesley) Chiu <105915352+guan404ming@users.noreply.github.com>
Signed-off-by: Guan-Ming (Wesley) Chiu <105915352+guan404ming@users.noreply.github.com>
Co-authored-by: Shahar Epstein <60007259+shahar1@users.noreply.github.com> Signed-off-by: Guan-Ming (Wesley) Chiu <105915352+guan404ming@users.noreply.github.com>
Co-authored-by: Andrii Roiko <57030016+roykoand@users.noreply.github.com> Signed-off-by: Guan-Ming (Wesley) Chiu <105915352+guan404ming@users.noreply.github.com>
Signed-off-by: Guan-Ming (Wesley) Chiu <105915352+guan404ming@users.noreply.github.com>
Co-authored-by: Jason(Zhe-You) Liu <68415893+jason810496@users.noreply.github.com> Signed-off-by: Guan-Ming (Wesley) Chiu <105915352+guan404ming@users.noreply.github.com>
b690c32 to
aea76f1
Compare
|
Thanks! |
* Add deny_dag_run_types option to limit specific dag run types Signed-off-by: Guan-Ming (Wesley) Chiu <105915352+guan404ming@users.noreply.github.com> * Add missing deny_dag_run_types to test expectations and CLI helper * Support single value Signed-off-by: Guan-Ming (Wesley) Chiu <105915352+guan404ming@users.noreply.github.com> * Update to use accept list Signed-off-by: Guan-Ming (Wesley) Chiu <105915352+guan404ming@users.noreply.github.com> * Update tests Co-authored-by: Shahar Epstein <60007259+shahar1@users.noreply.github.com> Signed-off-by: Guan-Ming (Wesley) Chiu <105915352+guan404ming@users.noreply.github.com> * Refactor run type checks to use enum values directly Co-authored-by: Andrii Roiko <57030016+roykoand@users.noreply.github.com> Signed-off-by: Guan-Ming (Wesley) Chiu <105915352+guan404ming@users.noreply.github.com> * Update to use the generated API model Signed-off-by: Guan-Ming (Wesley) Chiu <105915352+guan404ming@users.noreply.github.com> * Update create_openapi_http_exception_doc Co-authored-by: Jason(Zhe-You) Liu <68415893+jason810496@users.noreply.github.com> Signed-off-by: Guan-Ming (Wesley) Chiu <105915352+guan404ming@users.noreply.github.com> --------- Signed-off-by: Guan-Ming (Wesley) Chiu <105915352+guan404ming@users.noreply.github.com> Co-authored-by: Shahar Epstein <60007259+shahar1@users.noreply.github.com> Co-authored-by: Andrii Roiko <57030016+roykoand@users.noreply.github.com> Co-authored-by: Jason(Zhe-You) Liu <68415893+jason810496@users.noreply.github.com>
Related Issue
Closes #61710
Why
Allow dag authors to restrict which run types (manual, scheduled, backfill, asset-triggered) are permitted on a per-DAG basis.
How
Was generative AI tooling used to co-author this PR?
Claude Code with Opus 4.6
{pr_number}.significant.rstor{issue_number}.significant.rst, in airflow-core/newsfragments.