-
Notifications
You must be signed in to change notification settings - Fork 16.3k
AIP-84 | Add Auth for Dags #47433
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AIP-84 | Add Auth for Dags #47433
Conversation
5482c3e to
e7c9e29
Compare
|
As expected full tests break and need fixing. Also while testing the UI I realized that the server is not happy with this change (can't load dags internal error 500) and we will need to wait for @vincbeck fix. |
Just to double-check, do you mean that for this PR, I don’t need to make any changes but should wait for If that’s the case, should #47388 also be reverted? ( Since you mentioned that the dev setup use |
|
There are two problems:
|
Thanks for confirmation, I will start fixing k8s integration tests. |
|
I'll have a PR for FAB today |
e7c9e29 to
3621398
Compare
5148e1a to
c327620
Compare
c327620 to
0813087
Compare
|
Finally fixed the Kubernetes tests locally! Some notes:
|
0813087 to
7ca6fd4
Compare
|
I ran the Kubernetes tests locally yesterday, and they all passed. However, after rebasing today, they consistently fail. airflow/kubernetes_tests/test_base.py Lines 265 to 270 in 2ea7aed
Tracing the issue on the API side, it looks like the DAG must be active to be triggered: airflow/airflow/api_fastapi/core_api/routes/public/dag_run.py Lines 349 to 352 in 2ea7aed
However, in the patch DAG endpoint, only the airflow/airflow/api_fastapi/core_api/routes/public/dags.py Lines 218 to 228 in 2ea7aed
Update: This can be resolved by adding |
|
No error with Kubernetes tests / K8S System:KubernetesExecutor-3.9-v1.29.12-true Update: |
7724236 to
e62d885
Compare
|
Yep, seems to be something starts to happen this morning and can be fixed by retriggering |
|
@rawwar also ran the k8s test locally and found that it only fails when running all tests but passes when running a specific test. I'm looking into the reason now. Update: Not found the root cause, but add the following mechanism
|
|
Only 1 k8s test fail flaky 🎉 , I will rebase main and run again. |
Refactor conftest for api_fastapi and test_dags Add unauthorized 403 test cases Remove PATCH in requires_access Fix unauthorized_test_client, requires_access_dag Add EditableDagsFilterDep, ReadableDagsFilterDep Add permitted_dag_filter for dags API Fix test_security Add OrmFilterClause Fix mypy error
Refactor _get_jwt_token
8cd8c13 to
75efb26
Compare
|
Good news! All k8s tests are success in this run, I will rebase later ( there are conflicts with latest main ). |
|
all green. merging |
|
All green! Lesson learned: |
How many retries? |
|
#protm |
* AIP-84 | Add Auth for Dag Refactor conftest for api_fastapi and test_dags Add unauthorized 403 test cases Remove PATCH in requires_access Fix unauthorized_test_client, requires_access_dag Add EditableDagsFilterDep, ReadableDagsFilterDep Add permitted_dag_filter for dags API Fix test_security Add OrmFilterClause Fix mypy error * fix(api_fastapi): rename methods argument to method * Fix kubernetes_tests * Fix api_fastapi/test_dags * Add dags_reserialize for k8s tests Refactor _get_jwt_token * Increase threshold of test_integration_run_dag_with_scheduler_failure * test: raise if we cannot get jwt_token not due to connection error * Fix _get_jwt_token after dynamic patching k8s configMap * Remove dags_reserialize setup in BaseK8STest * Fix test_docker_compose_quick_start * Ensure scheduler health in test_integration_run_dag_with_scheduler_failure * Increase timeout threshold * Add HTTP retry for _get_jwt_token * Add JWTRefreshAdapter and restart api-server if needed --------- Co-authored-by: Wei Lee <weilee.rx@gmail.com>
related: #42360
Why
Since #47062 was reverted in #47402, this PR will also address the
full testissue here.