tien238lnd commented on PR #44339:
URL: https://github.com/apache/superset/pull/44339#issuecomment-5709239574

   @aminghadersohi Fixed in c12fa85f1f, including 
`generate_bug_report._collect_user_context`. All three sites now use 
`get_user_role_names` (`superset/mcp_service/utils/permissions_utils.py`), 
which follows `SecurityManager.get_user_roles`: direct roles, then each group's 
roles, each name kept once. One of its tests checks the result against 
`security_manager.get_user_roles` on real FAB `User`/`Role`/`Group` rows.
   
   - Bito's `DetachedInstanceError` point is handled in the helper: a role that 
cannot be read is skipped, and a `groups` relationship that raises still leaves 
the direct roles that were already loaded. There is a test for a real user 
detached after only its roles were loaded.
   - Copilot's note on `find_users` is correct: it returns `UserMatch`, which 
has no roles. I removed it from the description, together with `list_users`, 
which never returns `roles` in list context.
   
   I also rebased onto master. `pytest tests/unit_tests/mcp_service` on this 
head: 4309 passed, 1 skipped, and 2 failures in `test_query_dataset.py` that 
fail the same way on master (4c77b0b924) in my environment.
   


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to