Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Network view should group pods into higher level workload (#5468) #8996

Merged

Conversation

keithchong
Copy link
Contributor

@keithchong keithchong commented Apr 5, 2022

Signed-off-by: Keith Chong kykchong@redhat.com

Fixes #5468. This Pod Group applies to both the Details Network view and the Tree view. The Pod Group is made available to the tree-based views so that it can be integrated with the Tree Expansion support. eg. the Pod Group can be the collapsed state for the higher level workload, and when you expand it, it will expand out the Pods.

Notes:

At a high level, the general solution involves flagging all potential Pod Groups (that is, “parents” of pods in the graph views). It piggy backs on the existing logic (loops) when gathering up the graph nodes. Once a pod is found, it can be a graph node, or not, and it depends on the property setting showCompactNodes, which I’m using to turn the feature on and off. The pod is then added to the pod group and it continues on with the next iteration of the loop.

I initially wanted to make the pod group look like the pod group from the Pods view. But it was better to try to make it look like the existing nodes in the tree and network views so that the animation transition looks smoother.

  • See sample videos and screenshots below
  • Changing to reparent to RS can come later.
  • No QuickStart Buttons
  • In details tree view, Grouped Nodes feature supersedes this (unless we want a separate toolbar button for this)
  • For the Network View, I marked the Pod Group type as parentResource since that seems like the suitable fit. I could not create a new type, otherwise it will show up in the Pods View filter.
  • Moved PodView’s deletePopup to utils.tsx so it can be reused
  • Pod Height and layout adjusts accordingly when more rows are added to accommodate more pods

Note on DCO:

If the DCO action in the integration test fails, one or more of your commits are not signed off. Please click on the Details link next to the DCO action for instructions on how to resolve this.

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • Optional. My organization is added to USERS.md.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).

@codecov
Copy link

codecov bot commented Apr 5, 2022

Codecov Report

Merging #8996 (9ffbe39) into master (b587e0c) will decrease coverage by 0.01%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #8996      +/-   ##
==========================================
- Coverage   46.06%   46.04%   -0.02%     
==========================================
  Files         217      217              
  Lines       25908    25912       +4     
==========================================
- Hits        11934    11931       -3     
- Misses      12317    12323       +6     
- Partials     1657     1658       +1     
Impacted Files Coverage Δ
applicationset/services/scm_provider/github.go 75.29% <0.00%> (-5.89%) ⬇️
server/server.go 54.12% <0.00%> (-0.11%) ⬇️
util/settings/settings.go 48.16% <0.00%> (+0.05%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b587e0c...9ffbe39. Read the comment docs.

@keithchong
Copy link
Contributor Author

Simple-TreeView.mov
Simple-NetworkView.mov

@keithchong
Copy link
Contributor Author

Canary-TreeView.mov
Canary-NetworkView.mov

@keithchong
Copy link
Contributor Author

CertManager-TreeView.mov
CertManager-NetworkView.mov

@keithchong
Copy link
Contributor Author

canary

cert-manager

prometheus-operator

Copy link
Contributor

@ciiay ciiay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!! Since the grouped pod view looks very similar to the Pods view, is there a simple way to make it partially reusable component? Just curious.

Copy link
Member

@rbreeze rbreeze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of small things, otherwise looks good. I also agree with @ciiay 's comment about potentially factoring out the inner pod component into a shared component between this and pod view. That can perhaps be done later though.

Thanks!

@keithchong keithchong force-pushed the 5468-PodGroupForTreeAndNetworkViews branch from fa4e090 to ad60d47 Compare May 6, 2022 21:50
@keithchong
Copy link
Contributor Author

keithchong commented May 9, 2022

Hi @rbreeze , sorry about the delay. I've rebased and resolved the review comments. Please re-review/merge?

@keithchong
Copy link
Contributor Author

I opened #9338 to track the two review comments to pull out the pod group into a common component so that both the Tree view and the Pods view can use.

@keithchong keithchong force-pushed the 5468-PodGroupForTreeAndNetworkViews branch from ad60d47 to 9ffbe39 Compare May 9, 2022 20:40
Copy link
Member

@rbreeze rbreeze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @keithchong!

@keithchong
Copy link
Contributor Author

Thanks @rbreeze

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Network view should group pods into higher level workload
3 participants