Fix FAB roles/users 500 caused by connection hook metadata mocks#68421
Open
Nishieee wants to merge 1 commit into
Open
Fix FAB roles/users 500 caused by connection hook metadata mocks#68421Nishieee wants to merge 1 commit into
Nishieee wants to merge 1 commit into
Conversation
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.
summary
fixes [#68354](#68354): FAB Security Roles/Users pages could 500 with
TypeError: ... MockAnyWidgetwhen/ui/connections/hook_metaran concurrently in the same api-server process.cause:
HookMetaService._get_hooks_with_mocked_fab()used a globalmock.patchonBS3TextFieldWidget. 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 usesProvidersManagerdirectly, 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) verifyingBS3TextFieldWidgetis unchanged after bothhook_meta_data()and_get_hooks_with_mocked_fab().closes: #68354
Was generative AI tooling used to co-author this PR?
Generated-by: Cursor (Auto), following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions).