-
Notifications
You must be signed in to change notification settings - Fork 56
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
Showing Fleets in the Treeview #1237
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 7 out of 11 changed files in this pull request and generated no comments.
Files not reviewed (4)
- package.json: Language not supported
- src/commands/utils/arm.ts: Evaluated as low risk
- src/tree/aksClusterTreeItem.ts: Evaluated as low risk
- src/commands/utils/clusterfilter.ts: Evaluated as low risk
Here is the VSIX file for the webview test. Please let me know if there is any issue. Thank you :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested VSIX on Windows, Looks good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested v6 & everythings working great, LGTM 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, except few comments which can be handled as incremental PR's. Thank you @JunyuQian
Showing Fleets in the Treeview
This PR adds the Fleet resource to the treeview, based on @serbrech's initial work. The image below shows the final result of the treeview.
![treeview](https://private-user-images.githubusercontent.com/153477667/410351979-0245100d-60c9-437f-810e-99ff9e16c77c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2NDU5NTAsIm5iZiI6MTczOTY0NTY1MCwicGF0aCI6Ii8xNTM0Nzc2NjcvNDEwMzUxOTc5LTAyNDUxMDBkLTYwYzktNDM3Zi04MTBlLTk5ZmY5ZTE2Yzc3Yy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjE1JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxNVQxODU0MTBaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1jY2Q0ZTE3N2Q3ZjEzODFhZTQzODczYWVlMTgxMDU1YjU1YzYyMGZlYmU4ZDMxYTYzMjU5YzhhM2ZhYjEyYWIwJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.bbkQrtGuuXCv01jLnwlOT6j1lUCj7TBVm884Iovm0L4)
Due to the special characteristics that a Fleet can have member clusters from different subscriptions, the initial treeview design, which classifies clusters based on subscriptions, does not quite fit Fleets. The current design can be summarized into three cases below:
![design](https://private-user-images.githubusercontent.com/153477667/410352030-ec81ce96-febe-429e-afb9-676f7ce86602.jpeg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2NDU5NTAsIm5iZiI6MTczOTY0NTY1MCwicGF0aCI6Ii8xNTM0Nzc2NjcvNDEwMzUyMDMwLWVjODFjZTk2LWZlYmUtNDI5ZS1hZmI5LTY3NmY3Y2U4NjYwMi5qcGVnP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTVUMTg1NDEwWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MTU0MzU5MGQ2NzEwMTlmY2MxZWZlNWQxODA5NjA0ZWU3N2U1MzY5MWNkZWU1ODUzZWIzNjdhMmQ4NjY4MWM4NCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.6BThEIQm6gXq9iAGDU186Cl9jWkguJrkImUhb_neoq0)
Key Changes
New Files
fleet-tree-icon.png
: The fleet icon displayed in the treeview.fleetTreeItem.ts
: The class responsible for the Fleet node in the treeview. It includes thecreateFleetTreeNode
function and all necessary properties.Modified Files
package.json
&arm.ts
: Included the arm resource Graph API which is used to fetch resources in a more efficient way.azure-api-util.ts
: Modified theparseResource
function to enable parsing a member cluster to a cluster resource.azureResources.ts
: Defined theDefinedFleetMemberWithGroup
type and Fleet-related resource types. Added functions to retrieve all clusters and Fleets using Graph API and convert aFleetMember
to aDefinedFleetMemberWithGroup
.clusterfilter.ts
: Used Graph API to fetch all resources efficiently.config.ts
: Added the interface that fits to both clusters and Fleets.aksClusterTreeItem.ts
: Modified the parent node type so that the parent node of a cluster can be either a subscription or a Fleet.subscriptionTreeItem.ts
: Merged the cluster filter #1208 into the current PR. Added the process of fetching fleets and mapping members to their corresponding fleets before loading.Some known issues are:
Next Steps
hasMoreChildren
function infleetTreeItems.ts
, so that the resources will be loaded gradually (e.g., load 10 lines, and display the "load more" button), rather than load them all at once. Currently, in the testing environment, the number of resources is not quite big. But in reality, it should have the ability to handle a large amount of resources.Last but not least, a huge thank-you to @serbrech and @Tatsinnit, who provided immense assistance to this PR and spent hours peer-programming with me ❤️ Looking forward to moving on to the next feature!