Fix project membership tab showing missing role bindings and duplicate prevention#17814
Open
wormza wants to merge 1 commit into
Open
Fix project membership tab showing missing role bindings and duplicate prevention#17814wormza wants to merge 1 commit into
wormza wants to merge 1 commit into
Conversation
…e prevention - Scope Norman PRTB fetch to current cluster's projects using repeated projectId_in query parameters. Norman's _in filter requires repeated params; comma-separated values are parsed as a single literal string by Go's net/url.ParseQuery and match nothing. - Set depaginate: true for Norman PRTBs in explorer.js. The fetch is now bounded by the cluster scope so full pagination is safe. The previous conditional (maxResourceCount: 5000) suppressed pagination at exactly the scale where scoping is needed most. - Fix rowsWithFakeProjects dropping projects with no role bindings. Placeholder rows were spread into the reduce input but immediately discarded (no userId/groupPrincipalId). They are now appended to the return value outside the reduce. - Prevent duplicate role assignments in AddProjectMemberDialog. Before creating a PRTB, filter selected roleTemplateIds against existing store entries keyed on projectId + roleTemplateId + principalId. Show an error if all roles are duplicates; a warning if some are.
richard-cox
requested changes
May 25, 2026
Member
richard-cox
left a comment
There was a problem hiding this comment.
Can you fill in the pr description template please
This was referenced May 26, 2026
Author
@richard-cox I have used the template now. |
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 #17808
Fixes #17809
Occurred changes and/or fixed issues
Three co-dependent bugs in
shell/components/ExplorerMembers.vueand related files caused the Project Membership tab to display incomplete data at scale and allowed duplicate role assignments to be created.Bug 1 — Missing role bindings at scale (#17808)
The Norman PRTB fetch loaded all bindings across every cluster globally (no filter), then filtered client-side. With 65+ clusters the API returns only the first ~200 of 5,000+ global PRTBs, of which perhaps 10–20 belong to the current cluster. Combined with
configureConditionalDepaginatesuppressing pagination when the global count exceeds 5,000, the tab appeared almost empty on large installations.Fixed by scoping the fetch to the current cluster's projects using repeated
projectId_inquery parameters. Note: Norman's Go backend usesnet/url.ParseQuerywhich does not split comma-separated values — each project ID must be a separate repeated parameter.depaginateis set totruebecause the result set is now bounded by the cluster scope.Bug 2 — Projects with no role bindings missing from table (#17808)
rowsWithFakeProjectsspread placeholder rows for empty projects into thereduceinput alongside real PRTB rows. Because fakeRows have nouserId/groupPrincipalId, the early-return guard silently dropped them and they never appeared in the output. Fixed by appending fakeRows directly to the return value outside the reduce.Bug 3 — Duplicate role assignments allowed (#17809)
AddProjectMemberDialog.vuedispatchedrancher/createfor every selectedroleTemplateIdwithout checking whether an identical binding already existed. Fixed by checking the loaded PRTBs in the store before creating, matching onprojectId+roleTemplateId+principalId. Shows an error if all selected roles are duplicates, or a warning and skips only duplicates if some are new.Technical notes summary
_infilter requires repeated query parameters, not comma-separated values.?projectId_in=a&projectId_in=bworks;?projectId_in=a,breturns zero results because Go'snet/url.ParseQuerytreats the comma-separated string as a single literal.depaginate: trueinexplorer.jsis safe here because the PRTB fetch is now scoped server-side to the current cluster's projects. The previous conditional depagination (maxResourceCount: 5000) was only necessary to avoid loading all global PRTBs — that risk is gone with scoping.AddProjectMemberDialog.vueis keyed onprojectId(not project display name), so projects with identical names in different clusters are correctly distinguished.Areas or cases that should be tested
Tested locally using Chrome against
https://rancher-di.rnd-odinpf.asgard.capi.Areas which could experience regressions
ExplorerMembers.vuecomponent; confirm they are unaffected by the PRTB scoping changeScreenshot/Video
Checklist
Admin,Standard UserandUser Base