Repository navigation
Follow-ups to #36952: query-string field names, team deny-rule cache, closed-team buttons - #37072
Conversation
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
|
| Count | Rule |
|---|---|
| 15 | react-hooks/exhaustive-deps |
| 2 | openmetadata-imports/no-lower-layer-page-imports |
All findings
| Location | Rule | Message | |
|---|---|---|---|
| 🟡 | src/components/Settings/Team/TeamDetails/TeamDetailsV1.tsx:73:1 |
openmetadata-imports/no-lower-layer-page-imports |
Pages are route-level composition modules. Move the shared implementation/type to a lower layer instead of importing a page from here. |
| 🟡 | src/components/Settings/Team/TeamDetails/TeamDetailsV1.tsx:74:1 |
openmetadata-imports/no-lower-layer-page-imports |
Pages are route-level composition modules. Move the shared implementation/type to a lower layer instead of importing a page from here. |
| 🟡 | src/components/Settings/Team/TeamDetails/TeamDetailsV1.tsx:237:5 |
react-hooks/exhaustive-deps |
React Hook useMemo has a missing dependency: 't'. Either include it or remove the dependency array. |
| 🟡 | src/components/Settings/Team/TeamDetails/TeamDetailsV1.tsx:340:5 |
react-hooks/exhaustive-deps |
React Hook useCallback has a missing dependency: 't'. Either include it or remove the dependency array. |
| 🟡 | src/components/Settings/Team/TeamDetails/TeamDetailsV1.tsx:562:6 |
react-hooks/exhaustive-deps |
React Hook useEffect has a missing dependency: 'isOrganization'. Either include it or remove the dependency array. |
| 🟡 | src/components/Settings/Team/TeamDetails/TeamDetailsV1.tsx:589:6 |
react-hooks/exhaustive-deps |
React Hook useCallback has a missing dependency: 'showModal'. Either include it or remove the dependency array. |
| 🟡 | src/components/Settings/Team/TeamDetails/TeamDetailsV1.tsx:600:6 |
react-hooks/exhaustive-deps |
React Hook useCallback has missing dependencies: 'currentTeam.name' and 'navigate'. Either include them or remove the dependency array. |
| 🟡 | src/components/Settings/Team/TeamDetails/TeamDetailsV1.tsx:639:6 |
react-hooks/exhaustive-deps |
React Hook useMemo has a missing dependency: 't'. Either include it or remove the dependency array. |
| 🟡 | src/components/Settings/Team/TeamDetails/TeamDetailsV1.tsx:694:5 |
react-hooks/exhaustive-deps |
React Hook useMemo has missing dependencies: 'IMPORT_EXPORT_MENU_ITEM', 'handleOpenToJoinToggle', 'handleReactiveTeam', 'isGroupType', and 't'. Either include t |
| 🟡 | src/components/Settings/Team/TeamDetails/TeamDetailsV1.tsx:794:6 |
react-hooks/exhaustive-deps |
React Hook useMemo has missing dependencies: 't' and 'teamAssetCounts'. Either include them or remove the dependency array. |
| 🟡 | src/components/Settings/Team/TeamDetails/TeamDetailsV1.tsx:819:5 |
react-hooks/exhaustive-deps |
React Hook useMemo has an unnecessary dependency: 'isTeamMemberLoading'. Either exclude it or remove the dependency array. |
| 🟡 | src/components/Settings/Team/TeamDetails/TeamDetailsV1.tsx:851:5 |
react-hooks/exhaustive-deps |
React Hook useMemo has missing dependencies: 'navigate' and 't'. Either include them or remove the dependency array. |
| 🟡 | src/components/Settings/Team/TeamDetails/TeamDetailsV1.tsx:930:5 |
react-hooks/exhaustive-deps |
React Hook useMemo has missing dependencies: 'fetchErrorPlaceHolder' and 't'. Either include them or remove the dependency array. |
| 🟡 | src/components/Settings/Team/TeamDetails/TeamDetailsV1.tsx:1005:5 |
react-hooks/exhaustive-deps |
React Hook useMemo has missing dependencies: 'fetchErrorPlaceHolder' and 't'. Either include them or remove the dependency array. |
| 🟡 | src/components/Settings/Team/TeamDetails/TeamDetailsV1.tsx:1038:6 |
react-hooks/exhaustive-deps |
React Hook useMemo has a missing dependency: 't'. Either include it or remove the dependency array. |
| 🟡 | src/components/Settings/Team/TeamDetails/TeamDetailsV1.tsx:1156:5 |
react-hooks/exhaustive-deps |
React Hook useMemo has missing dependencies: 'IMPORT_EXPORT_MENU_ITEM' and 't'. Either include them or remove the dependency array. Outer scope values like 'get |
| 🟡 | src/components/Settings/Team/TeamDetails/TeamDetailsV1.tsx:1275:5 |
react-hooks/exhaustive-deps |
React Hook useMemo has a missing dependency: 'isGroupType'. Either include it or remove the dependency array. |
Fix locally (fast - only checks files changed in this branch):
make ui-checkstyle-changed
|
… Members tab
The Members tab offered "Leave team" to every member and "Join team" to anyone
with EditAll on the team, but the server lets only admins join or leave a team
that is not joinable. It now follows the same rule as the team page: shown when
the team is joinable or the user is an admin.
Leaving also went through DELETE /teams/{id}/users/{userId}, which needs
EditUsers on the team, so a member who did not own it got a 403 even on a
joinable team. Leaving now patches the user's own teams, as joining does and as
the team page does, and the stored current user is updated from the response so
a join followed by a leave patches from the right team list.
# Conflicts: # openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/Profile/tabs/members/MembersTeamDetail.test.tsx # openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/Profile/tabs/members/MembersTeamDetail.tsx
…nt teams The patch was diffed against the stored current user, whose teams can lag the server: the user may have been added to the team from the Users tab or another session. Leaving then sent an empty patch and reported success, or, since the patch removes by index, could remove a different team. Joining could add at an index the server's list does not have. The handler now fetches the user's teams and builds the patch from that copy.
Code Review ✅ Approved 1 closed / 1 findings🔴 High risk · Updating escaped-field checks and team deny-rule caching affects access enforcement; stale or mismatched decisions could expose private fields or denied rows. Follow-up fixes for team membership handling: the Members tab leave flow now builds its patch from the user's current teams, so a stale store no longer reports false success. No open issues remain. ✅ 1 closed✅ Edge Case: Leave builds patch from cached user teams; stale store reports false success
VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |



Describe your changes:
Related: open-metadata/openmetadata-collate#8018
Three small follow-ups to PR #36952, one commit each.
1. Query-string field names are read the way the search engine reads them (
PrivateFieldReferences)The search guard reads the field names in a query string to decide whether a search names a private field. It now resolves escapes in a field name exactly as Lucene's classic query parser does (
QueryParserBase.discardEscapeChar), including the four-hex-digit unicode escape. So the name the guard checks is the name the engine searches. A field name with an escape Lucene refuses (truncated or not hex) is treated as naming a private field, the same way the guard already treats DSL it cannot read.2. The team deny-rule answer expires (
RowDecisionGate)The gate caches, per policy generation, whether any policy attached to a team has a deny rule for a resource. The generation counter lives in each server, and with no cache provider there is no invalidation between servers. So the cached answer now also expires after
SubjectCache.POLICIES_TTL(2 minutes), the same bound as the compiled policies it is read beside. A policy change made on one server reaches the listings of the others within that bound, as it already does for item reads.3. The team page offers joining or leaving a closed team only to admins (
TeamDetailsV1)Since PR #36952, joining or leaving a team that is not joinable is admin-only on the server. The team page already hid "Join team" for such teams, but still showed "Leave team" to every member, and the click failed with a 403. Both buttons now follow the same rule: shown when the team is joinable or the user is an admin.
The three ADRs are updated to match.
Screenshots:
The team page of a Group team that is not joinable, signed in as a member who is not an admin.
Before: the page offers "Leave Team".
Before: confirming it fails with a 403.
After: neither "Join Team" nor "Leave Team" is offered.
Type of change:
Checklist:
Tests:
PrivateFieldReferencesTest: field names come out with escapes resolved, and refused escapes count as naming a private field. Expected values were checked against Lucene 9.5'sQueryParseron the same inputs.RowDecisionGateTest.theTeamDenyAnswerExpiresLikeTheCompiledPolicies: uses a fake ticker.TeamDetailsV1.test.tsx: a non-admin member sees "Leave team" on a joinable team and neither button on a closed one. The closed-team test fails without the change.PrivateFieldReferencesTest,RowDecisionGateTest,PrivateSearchFieldsTest,ElasticSearchPrivateFieldsTest,OpenSearchPrivateFieldsTest,SubjectCacheTest,RBACConditionEvaluatorCacheTest(48 tests), and theTeamDetailsV1Jest suite (16 tests).TeamDetailsV1.tsxswitched back to main for the "before" screenshots.Summary by Gitar
teamsviaupdateUserDetailinstead of callingdeleteUserFromTeam, and syncs the stored current user.This will update automatically on new commits.