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

Create Fleet: panel implementation #1161

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

JunyuQian
Copy link
Contributor

Description

This pull request introduces the basic panel implementation and required webview definitions for creating fleets in the VSCode extension.

Key Changes

  1. Added Fleet Management Capabilities:

    • Introduced ContainerServiceFleetClient to manage AKS fleets.
    • Implemented getAksFleetClient function in arm.ts to create a fleet client.
    • Added CreateFleetPanel and CreateFleetDataProvider classes in CreateFleetPanel.ts for handling fleet creation UI and logic.
  2. New Webview Definitions:

    • Created createFleet.ts under webviewDefinitions to define interfaces and message types related to fleet creation.
    • Updated webviewTypes.ts to include CreateFleetDefinition.
  3. UI Enhancements:

    • Added placeholder for createFleet in main.tsx and manualTest/main.tsx to ensure compilation and future implementation. The code in main.tsx is hardcoded to satisfy dependencies for the project to compile.

Changes

  • Files Modified:
    • src/commands/utils/arm.ts: Added ContainerServiceFleetClient and getAksFleetClient.
    • src/panels/CreateFleetPanel.ts: Created new panel and data provider for fleet creation.
    • src/webview-contract/webviewDefinitions/createFleet.ts: Defined types for fleet creation webview.
    • src/webview-contract/webviewTypes.ts: Added CreateFleetDefinition.
    • webview-ui/src/main.tsx: Added placeholder for fleet creation with hardcoded code to satisfy dependencies.
    • webview-ui/src/manualTest/main.tsx: Added placeholder for fleet creation test scenarios with hardcoded code to satisfy dependencies.

Testing

  • Placeholder components have been added to ensure dependencies are resolved during compilation.
  • Full implementation and test cases will be added in subsequent PRs.

Notes

  • The right-click entry point for createFleet is not yet visible to users to avoid incomplete experience.
  • The creation of resource groups is yet to be included.
  • Test cases are yet to be added.

@Tatsinnit Tatsinnit added enhancement 🚀 New feature or request or improvements on existing code. UX labels Jan 13, 2025
src/commands/utils/arm.ts Show resolved Hide resolved
src/panels/CreateFleetPanel.ts Outdated Show resolved Hide resolved
src/panels/CreateFleetPanel.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@tejhan tejhan left a comment

Choose a reason for hiding this comment

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

Setup of everything LGTM !👍, would say some descriptive comments for some functions could help (Like for the validation criteria being used). I'm assuming the ProgressEventTypes are placeholders for now & could be modified in further PR's.

src/panels/CreateFleetPanel.ts Outdated Show resolved Hide resolved
src/panels/CreateFleetPanel.ts Outdated Show resolved Hide resolved
src/panels/CreateFleetPanel.ts Outdated Show resolved Hide resolved
src/panels/CreateFleetPanel.ts Outdated Show resolved Hide resolved
};
}

getTelemetryDefinition(): TelemetryDefinition<typeof contentId> {
Copy link
Member

Choose a reason for hiding this comment

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

is typeof contentId going to work?
I don't know typescript well enough to answer that, but syntax wise, typeof contentId looks like it would return a string type, and not the value "createFleet". is that a problem?

Copy link

Choose a reason for hiding this comment

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

I was wondering that too, but I think it does make sense with typeof. When you look at how the generic type is used, it's matched up to the keys of this AllWebviewDefinitions object, which are themselves strings. You can in Typescript define a type which is just a union of string values (e.g. for an enum):

type colorEnum = "Red" | "Blue" | "Green"

So this is doing effectively the same thing as that, just with only a single legal value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 🚀 New feature or request or improvements on existing code. UX
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants