Repository navigation
Mock the simple auth manager in permission tests and guard against the base-class patch - #75138
Merged
Merged
Conversation
SimpleAuthManager overrides get_authorized_assets since apache#72934, so patching the BaseAuthManager method left the real one in place, every asset stayed readable, and the tests added in apache#73008 failed on main. Generated-by: Claude Opus 5
Twice in one day a permission test patched BaseAuthManager.get_authorized_assets, which SimpleAuthManager overrides, so the mock never applied and main broke after merge. The hook reads which methods SimpleAuthManager overrides, so it keeps up when more are added. Generated-by: Claude Opus 5
potiuk
requested review from
amoghrajesh,
ashb,
bugraoz93,
gopidesupavan,
jason810496 and
jscheffl
as code owners
October 19, 2026 20:12
vincbeck
approved these changes
Oct 19, 2026
Contributor
Backport failed to create: v3-4-test. View the failure log Run detailsNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
You can attempt to backport this manually by running: cherry_picker ac0c20c v3-4-testThis should apply the commit to the v3-4-test branch and leave the commit in conflict state marking After you have resolved the conflicts, you can continue the backport process by running: cherry_picker --continueIf you don't have cherry-picker installed, see the installation guide. |
1 task done
potiuk
added a commit
that referenced
this pull request
Oct 19, 2026
…d against the base-class patch (#75138) (#75140) Only the check-auth-manager-mock-targets prek hook applies here: the dependencies graph permission tests from #73008 are not on v3-4-test, and the upstream asset events test from #72924 already patches SimpleAuthManager on this branch. (cherry picked from commit ac0c20c) Generated-by: Claude Opus 5
1 task done
1 task done
vatsrahul1001
pushed a commit
that referenced
this pull request
Oct 20, 2026
…d against the base-class patch (#75138) (#75140) Only the check-auth-manager-mock-targets prek hook applies here: the dependencies graph permission tests from #73008 are not on v3-4-test, and the upstream asset events test from #72924 already patches SimpleAuthManager on this branch. (cherry picked from commit ac0c20c) Generated-by: Claude Opus 5
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.
Five asset permission tests in
routes/ui/test_dependencies.py, added in #73008, fail onmain: the unreadable assets are still returned.Same cause as #75126: the tests patch
BaseAuthManager.get_authorized_assets, but since #72934SimpleAuthManager(the auth manager the API test client uses) overrides that method, so the patch never takes effect and every asset stays readable. The production filter is fine; this patchesSimpleAuthManager.get_authorized_assets, as the other asset permission tests do.routes/ui/test_dependencies.py: 43 passed (previously 5 failed onmain).It also adds a
check-auth-manager-mock-targetsprek hook, since this is the second PR today (after #75126) to patch aBaseAuthManagermethod thatSimpleAuthManageroverrides. The hook reads which public methodsSimpleAuthManageroverrides, so it follows the code as more are added, and rejects API tests (airflow-core/tests/unit/api_fastapi/, excluding the simple auth manager's own tests) that patch one of them onBaseAuthManager, naming theSimpleAuthManagertarget to use instead. On themainversion oftest_dependencies.pyit flags all 6 patches; on this branch it passes.Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 5) following the guidelines