Nishieee opened a new pull request, #68421:
URL: https://github.com/apache/airflow/pull/68421

   ## summary
   
   fixes 
[[#68354](https://github.com/apache/airflow/issues/68354)](https://github.com/apache/airflow/issues/68354):
 FAB Security Roles/Users pages could 500 with `TypeError: ... MockAnyWidget` 
when `/ui/connections/hook_meta` ran concurrently in the same api-server 
process.
   
   **cause:** `HookMetaService._get_hooks_with_mocked_fab()` used a global 
`mock.patch` on `BS3TextFieldWidget`. the guard checked `"wtforms.StringField" 
not in sys.modules`, which is always true (that submodule path is never 
registered), so the mock was applied even when FAB was already loaded.
   
   **fix:** `hook_meta_data()` now uses `ProvidersManager` directly, with no 
runtime mocks. the guard is corrected to `"wtforms" not in sys.modules`.
   
   **tests:** two regression tests added in `test_connections.py` (run with 
`--skip-db-tests`) verifying `BS3TextFieldWidget` is unchanged after both 
`hook_meta_data()` and `_get_hooks_with_mocked_fab()`.
   
   closes: #68354
   
   ---
   
   **Was generative AI tooling used to co-author this PR?**
   
   - [x] yes - Cursor (Auto)
   
   Generated-by: Cursor (Auto), following [[the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions).


-- 
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]

Reply via email to