Open
Conversation
6382118 to
d1e4052
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new DAG run type (operator) so that DAG runs created via TriggerDagRunOperator/execution API can be distinguished from manual/UI/CLI triggers across Python, OpenAPI clients, and the UI.
Changes:
- Add
DagRunType.OPERATOR = "operator"across core + generated client datamodels. - Update the Execution API trigger endpoint to create operator-typed DagRuns and enforce
allowed_run_typesaccordingly. - Regenerate/update OpenAPI artifacts and UI rendering for the new run type.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| task-sdk/src/airflow/sdk/api/datamodels/_generated.py | Adds operator to generated DagRunType for the Task SDK models. |
| airflow-ctl/src/airflowctl/api/datamodels/generated.py | Adds operator to generated DagRunType for airflowctl models. |
| airflow-core/src/airflow/utils/types.py | Adds DagRunType.OPERATOR in core enum. |
| airflow-core/src/airflow/api/common/trigger_dag.py | Allows callers to specify run_type (default manual) and validates against allowed_run_types. |
| airflow-core/src/airflow/api_fastapi/execution_api/routes/dag_runs.py | Execution API now triggers runs as run_type=operator and enforces operator run permission. |
| airflow-core/tests/unit/api_fastapi/execution_api/versions/head/test_dag_runs.py | Asserts triggered run uses DagRunType.OPERATOR and adds additional denial coverage. |
| airflow-core/tests/unit/api/common/test_trigger_dag.py | Adds unit test for operator run denial when only manual is allowed. |
| airflow-core/src/airflow/ui/src/components/RunTypeIcon.tsx | Displays an icon for run_type="operator". |
| airflow-core/src/airflow/ui/openapi-gen/requests/types.gen.ts | Updates generated TS union type to include operator. |
| airflow-core/src/airflow/ui/openapi-gen/requests/schemas.gen.ts | Updates generated TS schema enum to include operator. |
| airflow-core/src/airflow/api_fastapi/core_api/openapi/v2-rest-api-generated.yaml | Adds operator to DagRunType enum in generated OpenAPI. |
| airflow-core/src/airflow/api_fastapi/core_api/openapi/_private_ui.yaml | Adds operator to DagRunType enum in UI OpenAPI. |
You can also share your feedback on Copilot code review. Take the survey.
airflow-core/tests/unit/api_fastapi/execution_api/versions/head/test_dag_runs.py
Outdated
Show resolved
Hide resolved
airflow-core/src/airflow/api_fastapi/execution_api/routes/dag_runs.py
Outdated
Show resolved
Hide resolved
5147f3e to
f47fb76
Compare
e5a7cc7 to
937a827
Compare
937a827 to
db40fd0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
MANUALrun type for operator-triggered DAG runs, which caused ambiguity and made it difficult to distinguish between user-initiated and operator-initiated runs.What
OPERATORto theDagRunTypeenum and updated all relevant code paths to useOPERATORfor operator-triggered DAG runs.OPERATORas the only allowed run type.Was generative AI tooling used to co-author this PR?
{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.