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

Add V2 workspace tree view #388

Merged
merged 26 commits into from
Oct 4, 2022
Merged

Add V2 workspace tree view #388

merged 26 commits into from
Oct 4, 2022

Conversation

philliphoff
Copy link
Member

Adds a basic implementation of the V2 workspace tree view. This is mostly a refactoring of the application (i.e. resources) tree view into common base types that work across both. Despite the number of files changed (mostly due to naming), most of the logic is the same as used by the application tree view, just made more generic.

Notable changes (and open for discussion):

We need an expanded "contribution registration" mechanism to accommodate both application and workspace resource providers. Here's what I propose (by way of an example package.json):

  • Contributions are split into application and workspace sections, with each having resource provider (i.e. resources) and brand data provider (i.e. branches) sections. Providers are specified using an object that contains (today) just a type property (but could be expanded in the future, such as to help differentiate kinds, etc.).
{
    "contributes": {
        "x-azResourcesV2": {
            "application": {
                "branches": [
                    {
                        "type": "microsoft.storage/storageaccounts"
                    }
                ]
            },
            "workspace": {
                "resources": [
                    {
                        "type": "ms-azuretools.vscode-azurestorage"
                    }
                ],
                "branches": [
                    {
                        "type": "ms-azuretools.vscode-azurestorage"
                    }
                ]
            }
        }
}

Screenshot 2022-09-15 at 16 18 18

@philliphoff philliphoff requested a review from a team as a code owner September 15, 2022 23:34
Comment on lines 12 to 19
readonly application: {
readonly branches?: { type: string }[];
readonly resources?: { type: string }[];
}
readonly workspace: {
readonly branches?: { type: string }[];
readonly resources?: { type: string }[];
}
Copy link
Member

Choose a reason for hiding this comment

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

For application branches and resources, I think type should be an AzExtResourceType.

For workspace branches and resources, it can be an arbitrary string.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't disagree necessarily, but I think I'd like to address this as a follow up PR so as to not get mixed up with all the rest, and give me time to think about this.

src/tree/v2/application/ResourceGroupsTreeDataProvider.ts Outdated Show resolved Hide resolved
src/tree/v2/ResourceTreeDataProviderBase.ts Show resolved Hide resolved
src/api/v2/ResourceGroupsExtensionManager.ts Outdated Show resolved Hide resolved
src/api/v2/ResourceGroupsExtensionManager.ts Outdated Show resolved Hide resolved
src/api/v2/ResourceGroupsExtensionManager.ts Outdated Show resolved Hide resolved
src/api/v2/ResourceGroupsExtensionManager.ts Outdated Show resolved Hide resolved
src/api/v2/WorkspaceResourceProviderManager.ts Outdated Show resolved Hide resolved
src/api/v2/WorkspaceResourceProviderManager.ts Outdated Show resolved Hide resolved
src/api/v2/ApplicationResourceProviderManager.ts Outdated Show resolved Hide resolved
@alexweininger alexweininger mentioned this pull request Sep 21, 2022
66 tasks
src/api/v2/v2AzureResourcesApi.ts Outdated Show resolved Hide resolved
src/api/v2/v2AzureResourcesApi.ts Outdated Show resolved Hide resolved
src/api/v2/v2AzureResourcesApi.ts Show resolved Hide resolved
@philliphoff philliphoff merged commit 1767955 into api-v2 Oct 4, 2022
@philliphoff philliphoff deleted the philliphoff-v2-workspaces branch October 4, 2022 17:45
@microsoft microsoft locked and limited conversation to collaborators Nov 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants