Repository navigation
feat(links): add global cluster links list page - #696
omarelkashef wants to merge 2 commits into
Conversation
0be38fc to
ae066a4
Compare
|
@sophiecarroll Design review is needed for this PR. |
ae066a4 to
c356716
Compare
|
Looks great overall, just a few comments/questions.
|
1- Changing the icon proved to be a non-trivial task in LXD. It will be out of scope here. But we can create a follow up ticket. |
@sophiecarroll new screenshots |
c356716 to
0a6bb09
Compare
0a6bb09 to
68155ca
Compare
which vanilla component should we use?
I was just hovering over the name |
"Contextual menu" Let me know when you have new screenshots and it should be good to go from design |
|
@sophiecarroll newest screenshots:
|
Ok almost all done, just 2 things:
|
Everything is good, except the chevrons shouldn't have that grey box around them (background should match white of row). I'll go ahead and give my design +1 now! |
68155ca to
908642c
Compare
|
@omarelkashef , as the cluster link checkboxes are included on each row, do you plan to implement any kind of bulk actions in this same PR? Or is this ready for code/qa review already? |
Can you elaborate? If you check more than one box, you can bulk delete them. If you check the box next to the group itself, everything inside is selected. Yes, it is ready for QA and review. I will add some instructions. |
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
10 open issues
The goroutine closure captures the loop variablesindex(andclustervia later usage) from the… · New Using a react-router<Link>as theContextualMenutoggle will navigate away on click, which… The new NotFound error message is generic and uses an internal type name casing… · Newstrings.SplitSeqrequires a relatively recent Go toolchain; if this repo'sgo… · New The PR description frames a decision between (A) UI fan-out to per-cluster endpoints and (B) a new… · New Rendering as an anchor (element=\"a\") while also usingdisabledcan be problematic because… · New The contextual-menu toggle is aLinkthat navigates on click, which makes the addresses dropdown… · New A newhttp.Clientandhttp.Transportare created for every forwarded request, and keep-alives… If reading the request body fails (including the MaxBytesReader limit case), the request body is…activeUrlMatchessupports both substring andmatchPath, butignoreUrlMatchesonly checks… · New
Review effort: Lite
| for index, cluster := range clusters { | ||
| name := cluster.Name | ||
| workers.Go(func() error { | ||
| result := clusterLinksResult{links: []api.ClusterLink{}} | ||
| defer func() { | ||
| results[index] = result | ||
| }() |
|
Hi @omarelkashef could you please rebase and resolve conflicts ? |
Signed-off-by: Omar Elkashef <omarelkashef01@gmail.com>
cd913ff to
889d5c9
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
Approval is blocked by unresolved critical issues: concurrent token refreshes can race and invalidate sessions during fan-out retries, and the TypeScript interface contains a duplicate description member that causes a compile error.
2 open issues
8 resolved since last review
Using a react-router<Link>as theContextualMenutoggle will navigate away on click, which… The contextual-menu toggle is aLinkthat navigates on click, which makes the addresses dropdown… Rendering as an anchor (element=\"a\") while also usingdisabledcan be problematic because… The PR description frames a decision between (A) UI fan-out to per-cluster endpoints and (B) a new…strings.SplitSeqrequires a relatively recent Go toolchain; if this repo'sgo… The new NotFound error message is generic and uses an internal type name casing… A newhttp.Clientandhttp.Transportare created for every forwarded request, and keep-alives…activeUrlMatchessupports both substring andmatchPath, butignoreUrlMatchesonly checks…
Review effort: Lite
|
Commenting this from MM decisions:
|
kimanhou
left a comment
There was a problem hiding this comment.
This PR is really big, is there a way to divide it into smaller ones ?
Below some findings after doing QA:
The settings icon is still here, could you please remove it ?
The search and filter doesn't include "Cluster", only "Link type".
The edit icon on each row is missing.
On hover, the delete icon does not seem centered compared to its background.

@sophiecarroll
I didn't find any reference in the figma file when the target cluster is not enrolled in MCM. Should "unknown" be muted ?

That's what I understand from the design. @sophiecarroll ?
The icon sits too high. Or the background is too low maybe ? |
That was an oversight, I thought I had the edge case but I don't think I do–I'm not sure "unknown" is the best option for this I'm going to see what cluster permission denied patterns we have, also what does the tooltip say? |
The tooltip says "The linked cluster might not be enrolled in this cluster manager." This is not necessarily a permission error. It is when a link targets a cluster that is not in cluster manager. |
I was thinking about similar patterns where "it exists but we can't see it." Is it possible that we could not have permission to view a target cluster on a link in CM? Would this automatically return "-" if so? |
No, currently in cluster manager, you can either see all clusters or not at all. |
In that case, could we put "not registered" in the target cell? It seems like we either know the name because the cluster is registered, or we don't know the name because it's not registered. Is there any other reason we wouldn't know the name, if permission is not an issue? |
889d5c9 to
6a98b7e
Compare
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
6 open issues
The goroutine closure captures the loop variableindex(andcluster), which will be reused… · New The goroutine closure captures the loop variablesindex(andclustervia later usage) from the… The PR description’s Option B discusses adding a new aggregated endpoint (`GET… · New This uses newer Go features (maps.Cloneandstrings.SplitSeq). If this repo’s Go toolchain… · New The aria-label on the \"+N\" addresses button doesn’t match the control’s purpose (it reveals… · New If reading the request body fails (including the MaxBytesReader limit case), the request body is…
Review effort: Lite
There are cases where the cluster link has addresses that we do not know about and we can not do the matching so "Unregistered" announces something that might not be true. How about "Unidentified"? |
Signed-off-by: Omar Elkashef <omarelkashef01@gmail.com>
6a98b7e to
584cc1e
Compare
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
7 open issues
This goroutine closure depends onindex(and implicitly on loop-scoped values) inside… · New The goroutine closure captures the loop variablesindex(andclustervia later usage) from the… There’s a unit test forclusterLinksDeadline, but the new request-surface behavior for… · Newstrings.SplitSeqis relatively new and may not be available in the Go version this repo targets.… · New The PR description’s tradeoff section frames the decision as either UI fan-out or a new aggregated… · New The aria-label does not match the control’s purpose: this button reveals addresses, not 'cluster… · New If reading the request body fails (including the MaxBytesReader limit case), the request body is…
4 resolved since last review
The goroutine closure captures the loop variableindex(andcluster), which will be reused… The aria-label on the \"+N\" addresses button doesn’t match the control’s purpose (it reveals… This uses newer Go features (maps.Cloneandstrings.SplitSeq). If this repo’s Go toolchain… The PR description’s Option B discusses adding a new aggregated endpoint (`GET…
Review effort: Lite
|
Please rebase on main to resolve outstanding conflicts. Thank you for your time on this PR so far it's quite hefty!
|





















DO NOT REVIEW; THIS PR WILL BE SPLIT UP INTO SMALLER PRS
feat: add global cluster links list page WD-36618
QA
Screenshots
Pagination splits groups and group header wraps into new page
Tradeoff Brief: Backend aggregation for the cluster links page
Decision needed: Should the management API expose an aggregated
GET /1.0/cluster-linksendpoint, or should the UI keep fanning out oneGET /1.0/remote-cluster/{cluster}/cluster-linksrequest per tunnel-enabled cluster?Context: The new
/ui/cluster-linkpage lists links across all managed clusters. The management API only proxies per-cluster requests through the cluster-connector and tunnels to each LXD cluster. The UI currently uses React QueryuseQueries(one query per cluster), flattened and grouped client-side inuseClusterLinks.Option A — UI fan-out (current implementation)
One React Query per tunnel-enabled cluster; results flattened in
useClusterLinks.Pros
Cons
Option B — Backend aggregation endpoint
New top-level
GET /1.0/cluster-linkson the management API. The handler loads all clusters with details, fans out to each tunnel-enabled cluster concurrently (goroutines), and returns a grouped payload, e.g.{ cluster, links, error? }per cluster.Pros
useQuery; no fan-out hook.Cons
[clusters]invalidation mostly equalizes this).useClusterLinks— roughly doubling this PR's review surface.Comparison
useClusterLinksRecommendation
Keep Option B