Open
Conversation
Add full-stack tenant member management: stewards can view members, add new members (with searchable username dropdown), set permissions, and remove members — all from a new "Manage Members" tab accessible via tenant nodes in the sidebar tree. Backend: - New REST endpoints: GET/POST/DELETE for tenant members, GET for user names listing, GET for tenant summaries - Real implementation proxies to berdl_notebook_utils with automatic mock fallback for development - Input validation (permission values, JSON body parsing) Frontend: - TenantMembersTab with member table, access badges, steward icons - AddMemberForm with datalist-based searchable username dropdown that filters out existing members - managementApi client reuses shared serverGet/serverPost/serverDelete from api.ts (no duplicated boilerplate) - Members tabs tracked with WidgetTracker for layout restore
|
Prerelease: pr-29 Wheel will be attached once the build completes. Updated on each push. |
There was a problem hiding this comment.
Pull request overview
Adds end-to-end tenant member management (view/add/remove) to the Tenant Data Browser extension by introducing new server endpoints and a new “Manage Members” tab reachable from tenant nodes in the sidebar tree.
Changes:
- Added Python server REST endpoints for listing users, listing tenants, and tenant member CRUD with BERDL integration + mock fallback.
- Added a new JupyterLab main-area “Members” tab and a “Manage Members” action on tenant nodes.
- Added a small frontend management API client plus shared HTTP helpers for GET/POST/DELETE.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tenant_data_browser/mock_definitions.py | Adds mock implementations for user listing and tenant membership operations. |
| tenant_data_browser/mock_data.py | Introduces mock user list, tenant summaries, and tenant member fixtures. |
| tenant_data_browser/handlers.py | Adds authenticated REST handlers + routes for usernames, tenants, and tenant members CRUD. |
| tenant_data_browser/cdm_methods.py | Adds BERDL import wrappers for tenant management and user listing with mock fallback. |
| src/providers/berdlProvider.tsx | Adds “Manage Members” menu/button on tenant nodes to open the members tab. |
| src/membersTab.ts | Defines the command ID and target type for opening members tabs. |
| src/managementApi.ts | Implements client calls for usernames and tenant member CRUD using shared server helpers. |
| src/index.ts | Registers the members tab command and integrates layout restoration/tracking for the new tab type. |
| src/api.ts | Exposes serverGet and adds shared serverPost/serverDelete + improved error parsing. |
| src/TenantMembersTab.tsx | Implements the members management UI (list members, add via datalist, remove with confirmation). |
Comments suppressed due to low confidence (1)
tenant_data_browser/mock_definitions.py:220
remove_tenant_memberin mock mode does not actually remove the user fromMOCK_TENANT_MEMBERS. Since the UI refetches after deletion, the removed member will reappear under mocks. Consider updating the mock store to delete the matching entry (and possibly raising a 404-like error when the user isn’t present).
def remove_tenant_member(tenant_name, username):
"""
Mock function that simulates removing a member from a tenant.
Mimics berdl_notebook_utils.minio_governance.tenant_management.remove_tenant_member().
Args:
tenant_name (str): Name of the tenant.
username (str): Username to remove.
"""
time.sleep(MOCK_DELAY)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Add aria-label to remove-member button and username input (#1, #4) - Add Content-Type: application/json header to serverPost (#3) - Validate decoded path params in tenant handlers to reject encoded slashes and path traversal sequences (#5) - Mutate in-memory mock store on add/remove so refetch reflects changes in mock mode (#2)
Add `visible` predicate to IMenuItem so menu items can be conditionally shown per node. Use it to gate "Manage Members" behind steward status — fetched from the /tenants endpoint during tree initialization (best-effort, fails silently).
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
visiblepredicate onIMenuItem, gated byis_stewardflag from the/tenantsendpointberdl_notebook_utilsintegration and automatic mock fallbackAddMemberFormuses a<datalist>-based searchable dropdown populated from the user names API, filtering out existing membersmanagementApi.tsreuses sharedserverGet/serverPost/serverDeletefromapi.ts— no duplicated HTTP boilerplatearia-labelon remove button and username inputNew endpoints
/api/tenant-data-browser/users/names/api/tenant-data-browser/tenants/api/tenant-data-browser/tenants/{name}/members/api/tenant-data-browser/tenants/{name}/members/{user}/api/tenant-data-browser/tenants/{name}/members/{user}Test plan
berdl_notebook_utilsis not installed