deanobob opened a new issue, #35186:
URL: https://github.com/apache/airflow/issues/35186
### Apache Airflow version
Other Airflow 2 version (please specify below)
### What happened
Experienced in version 2.6.1 but appears to be an issue in the latest
version too.
When using the Airflow REST API `/api/v1/dags/{dag name}/tasks` to query the
tasks of a DAG that contains a task with the trigger rule 'one_done' an error
is returned:
```
{
"detail": "'one_done' is not one of ['all_success', 'all_failed',
'all_done', 'one_success', 'one_failed', 'none_failed', 'none_skipped',
'none_failed_or_skipped', 'none_failed_min_one_success', 'dummy']\n\nFailed
validating 'enum' in
schema['properties']['tasks']['items']['properties']['trigger_rule']:\n
{'description': 'Trigger rule.\\n'\n '\\n'\n
'*Changed in version 2.2.0*: '\n
\"'none_failed_min_one_success' is added as a possible \"\n
'value.\\n',\n 'enum': ['all_success',\n 'all_failed',\n
'all_done',\n 'one_success',\n 'one_failed',\n
'none_failed',\n 'none_skipped',\n
'none_failed_or_skipped',\n 'none_failed_min_one_success',\n
'dummy'],\n 'type': 'string'}\n\nOn
instance['tasks'][6]['trigger_rule']:\n 'one_done'",
"status": 500,
"title": "Response body does not conform to specification",
"type":
"https://airflow.apache.org/docs/apache-airflow/2.6.1/stable-rest-api-ref.html#section/Errors/Unknown"
}
```
This appears to be an issue with the openapi spec, specifically the
`trigger_rules` enum which is missing some valid trigger rules:
https://github.com/apache/airflow/blob/0bb56315e664875cd764486bb2090e0a2ef747d8/airflow/api_connexion/openapi/v1.yaml#L4756
https://github.com/apache/airflow/blob/8531396c7c8bf1e016db10c7d32e5e19298d67e5/airflow/utils/trigger_rule.py#L23
I believe the openapi spec needs to include `one_done`. It should also be
updated to include `all_done_setup_success`, `always`, and `all_skipped`.
### What you think should happen instead
DAG tasks should be returned with the trigger rule `one_done`
### How to reproduce
Create a DAG, add a task with a trigger rule of `one_done`. Call the Get
tasks API:
https://airflow.apache.org/docs/apache-airflow/stable/stable-rest-api-ref.html#operation/get_tasks
### Operating System
Ubuntu 22.04
### Versions of Apache Airflow Providers
_No response_
### Deployment
Docker-Compose
### Deployment details
_No response_
### Anything else
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
--
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]