Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/github_actions/actions/cache-3
Browse files Browse the repository at this point in the history
  • Loading branch information
kburtram committed Jun 29, 2023
2 parents d4b5c56 + 562a0ce commit 9604417
Show file tree
Hide file tree
Showing 143 changed files with 4,522 additions and 1,922 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion .github/workflows/on-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Process Label Action
uses: hramos/label-actions@v1
uses: hramos/label-actions@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
63 changes: 32 additions & 31 deletions build/azure-pipelines/linux/sql-product-build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,37 +200,38 @@ steps:
version: 5.0.x
installationPath: $(Agent.ToolsDirectory)/dotnet

- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
inputs:
ConnectedServiceName: 'Code Signing'
FolderPath: '$(Build.SourcesDirectory)/.build'
Pattern: 'extensions/*.vsix,langpacks/*.vsix'
signConfigType: inlineSignParams
inlineOperation: |
[
{
"keyCode": "CP-233016",
"operationSetCode": "OpcSign",
"parameters": [
{
"parameterName": "FileDigest",
"parameterValue": "/fd \"SHA256\""
}
],
"toolName": "sign",
"toolVersion": "1.0"
},
{
"keyCode": "CP-233016",
"operationSetCode": "OpcVerify",
"parameters": [],
"toolName": "sign",
"toolVersion": "1.0"
}
]
SessionTimeout: 120
displayName: 'Signing Extensions and Langpacks'
condition: and(succeeded(), eq(variables['signed'], true))
# {{SQL CARBON TODO}} - disable extension signing while investigating build break
# - task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
# inputs:
# ConnectedServiceName: 'Code Signing'
# FolderPath: '$(Build.SourcesDirectory)/.build'
# Pattern: 'extensions/*.vsix,langpacks/*.vsix'
# signConfigType: inlineSignParams
# inlineOperation: |
# [
# {
# "keyCode": "CP-233016",
# "operationSetCode": "OpcSign",
# "parameters": [
# {
# "parameterName": "FileDigest",
# "parameterValue": "/fd \"SHA256\""
# }
# ],
# "toolName": "sign",
# "toolVersion": "1.0"
# },
# {
# "keyCode": "CP-233016",
# "operationSetCode": "OpcVerify",
# "parameters": [],
# "toolName": "sign",
# "toolVersion": "1.0"
# }
# ]
# SessionTimeout: 120
# displayName: 'Signing Extensions and Langpacks'
# condition: and(succeeded(), eq(variables['signed'], true))

- script: |
set -e
Expand Down
4 changes: 3 additions & 1 deletion extensions/azurecore/src/azureResource/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ export enum AzureResourceItemType {
azureMonitor = 'azure.resource.itemType.azureMonitor',
azureMonitorContainer = 'azure.resource.itemType.azureMonitorContainer',
cosmosDBMongoAccount = 'azure.resource.itemType.cosmosDBMongoAccount',
cosmosDBMongoCluster = 'azure.resource.itemType.cosmosDBMongoCluster'
cosmosDBMongoCluster = 'azure.resource.itemType.cosmosDBMongoCluster',
cosmosDBPostgresAccount = 'azure.resource.itemType.cosmosDBPostgresAccount',
cosmosDBPostgresCluster = 'azure.resource.itemType.cosmosDBPostgresCluster'
}

export enum AzureResourceServiceNames {
Expand Down
6 changes: 0 additions & 6 deletions extensions/azurecore/src/azureResource/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,6 @@ export interface IAzureResourceCacheService {
update<T>(key: string, value: T): Promise<void>;
}


export interface IAzureResourceNodeWithProviderId {
resourceProviderId: string;
resourceNode: azureResource.IAzureResourceNode;
}

export interface IAzureResourceDbService<S extends GraphData, T extends GraphData> extends azureResource.IAzureResourceService {
convertDatabaseResource(resource: T, server?: S): azureResource.AzureResource | undefined;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ export class AzureMonitorTreeDataProvider extends ResourceTreeDataProviderBase<G
};
}

public async getRootChildren(): Promise<TreeItem[]> {
return [{
public async getRootChild(): Promise<TreeItem> {
return {
id: AzureMonitorTreeDataProvider.containerId,
label: AzureMonitorTreeDataProvider.containerLabel,
iconPath: this._extensionContext.asAbsolutePath('resources/logAnalyticsWorkspaces.svg'),
collapsibleState: TreeItemCollapsibleState.Collapsed,
contextValue: AzureResourceItemType.databaseServerContainer
}];
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class CosmosDbMongoService extends ResourceServiceBase<DbServerGraphData>

public convertServerResource(resource: DbServerGraphData): AzureResourceMongoDatabaseServer | undefined {
let host = resource.name;
const isServer = resource.type === azureResource.AzureResourceType.cosmosDbCluster;
const isServer = resource.type === azureResource.AzureResourceType.cosmosDbMongoCluster;
if (isServer) {
const url = new URL(resource.properties.connectionString);
host = url.hostname;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class CosmosDbMongoTreeDataProvider extends ResourceTreeDataProviderBase<
public getTreeItemForResource(databaseServer: AzureResourceMongoDatabaseServer, account: azdata.Account): azdata.TreeItem {
return {
id: `${AzureResourcePrefixes.cosmosdb}${account.key.accountId}${databaseServer.tenant}${databaseServer.id ?? databaseServer.name}`,
label: `${databaseServer.name} (CosmosDB Mongo API)`,
label: this.browseConnectionMode ? `${databaseServer.name} (${CosmosDbMongoTreeDataProvider.CONTAINER_LABEL}, ${databaseServer.subscription.name})` : `${databaseServer.name}`,
iconPath: this._extensionContext.asAbsolutePath('resources/cosmosDb.svg'),
collapsibleState: TreeItemCollapsibleState.None,
contextValue: AzureResourceItemType.cosmosDBMongoAccount,
Expand Down Expand Up @@ -58,13 +58,13 @@ export class CosmosDbMongoTreeDataProvider extends ResourceTreeDataProviderBase<
};
}

public async getRootChildren(): Promise<azdata.TreeItem[]> {
return [{
public async getRootChild(): Promise<azdata.TreeItem> {
return {
id: CosmosDbMongoTreeDataProvider.CONTAINER_ID,
label: CosmosDbMongoTreeDataProvider.CONTAINER_LABEL,
iconPath: this._extensionContext.asAbsolutePath('resources/cosmosDb.svg'),
collapsibleState: TreeItemCollapsibleState.Collapsed,
contextValue: AzureResourceItemType.databaseServerContainer
}];
};
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/


import { ResourceServiceBase } from '../../resourceTreeDataProviderBase';
import { azureResource } from 'azurecore';
import { cosmosPostgresDbQuery } from '../../queryStringConstants';
import { DbServerGraphData } from '../../../interfaces';
import { COSMOSDB_POSTGRES_PROVIDER_ID } from '../../../../constants';

export interface AzureResourcePostgresDatabaseServer extends azureResource.AzureResourceDatabaseServer {
isServer: boolean;
}

export class CosmosDbPostgresService extends ResourceServiceBase<DbServerGraphData> {
public override queryFilter: string = cosmosPostgresDbQuery;

public convertServerResource(resource: DbServerGraphData): AzureResourcePostgresDatabaseServer | undefined {
let host = resource.name;
const isServer = resource.type === azureResource.AzureResourceType.cosmosDbPostgresCluster;
if (isServer) {
const url = new URL(resource.properties.connectionString);
host = url.hostname;
}
return {
id: resource.id,
name: resource.name,
provider: COSMOSDB_POSTGRES_PROVIDER_ID,
isServer: isServer,
fullName: host,
loginName: resource.properties.administratorLogin,
defaultDatabaseName: '',
tenant: resource.tenantId,
subscription: {
id: resource.subscriptionId,
name: resource.subscriptionName || ''
}
};
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { TreeItemCollapsibleState, ExtensionContext } from 'vscode';
import * as nls from 'vscode-nls';
const localize = nls.loadMessageBundle();

import { AzureResourceItemType, AzureResourcePrefixes, pgsqlProvider } from '../../../constants';
import { AzureResourcePostgresDatabaseServer } from './cosmosDbPostgresService';
import { generateGuid } from '../../../utils';
import { DbServerGraphData, GraphData } from '../../../interfaces';
import { ResourceTreeDataProviderBase } from '../../resourceTreeDataProviderBase';
import { AzureAccountProperties, azureResource } from 'azurecore';
import * as azdata from 'azdata';

export class CosmosDbPostgresTreeDataProvider extends ResourceTreeDataProviderBase<GraphData, DbServerGraphData> {
private static readonly CONTAINER_ID = 'azure.resource.providers.databaseServer.treeDataProvider.cosmosDbPostgresContainer';
private static readonly CONTAINER_LABEL = localize('azure.resource.providers.databaseServer.treeDataProvider.cosmosDbPostgresContainerLabel', "Azure CosmosDB for PostgreSQL Cluster");

public constructor(
databaseServerService: azureResource.IAzureResourceService,
private _extensionContext: ExtensionContext
) {
super(databaseServerService);
}

public getTreeItemForResource(databaseServer: AzureResourcePostgresDatabaseServer, account: azdata.Account): azdata.TreeItem {
return {
id: `${AzureResourcePrefixes.cosmosdb}${account.key.accountId}${databaseServer.tenant}${databaseServer.id ?? databaseServer.name}`,
label: this.browseConnectionMode ? `${databaseServer.name} ${CosmosDbPostgresTreeDataProvider.CONTAINER_LABEL}, ${databaseServer.subscription.name})` : databaseServer.name,
iconPath: this._extensionContext.asAbsolutePath('resources/cosmosDb.svg'),
collapsibleState: TreeItemCollapsibleState.None,
contextValue: AzureResourceItemType.cosmosDBPostgresAccount,
payload: {
id: generateGuid(),
connectionName: databaseServer.name,
serverName: databaseServer.fullName,
userName: databaseServer.loginName,
password: '',
authenticationType: databaseServer.isServer ? azdata.connection.AuthenticationType.SqlLogin : azdata.connection.AuthenticationType.AzureMFA,
savePassword: true,
groupFullName: '',
groupId: '',
providerName: pgsqlProvider,
saveProfile: false,
options: {
isServer: databaseServer.isServer,
},
azureAccount: account.key.accountId,
azureTenantId: databaseServer.tenant,
azureResourceId: databaseServer.id,
azurePortalEndpoint: (account.properties as AzureAccountProperties).providerSettings.settings.portalEndpoint
},
childProvider: pgsqlProvider,
type: azdata.ExtensionNodeType.Server
};
}

public async getRootChild(): Promise<azdata.TreeItem> {
return {
id: CosmosDbPostgresTreeDataProvider.CONTAINER_ID,
label: CosmosDbPostgresTreeDataProvider.CONTAINER_LABEL,
iconPath: this._extensionContext.asAbsolutePath('resources/cosmosDb.svg'),
collapsibleState: TreeItemCollapsibleState.Collapsed,
contextValue: AzureResourceItemType.databaseServerContainer
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ export class AzureResourceDatabaseTreeDataProvider extends ResourceTreeDataProvi
};
}

public async getRootChildren(): Promise<TreeItem[]> {
return [{
public async getRootChild(): Promise<TreeItem> {
return {
id: AzureResourceDatabaseTreeDataProvider.containerId,
label: AzureResourceDatabaseTreeDataProvider.containerLabel,
iconPath: this._extensionContext.asAbsolutePath('resources/sqlDatabase.svg'),
collapsibleState: vscode.TreeItemCollapsibleState.Collapsed,
contextValue: AzureResourceItemType.databaseContainer
}];
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ export class AzureResourceDatabaseServerTreeDataProvider extends ResourceTreeDat
};
}

public async getRootChildren(): Promise<TreeItem[]> {
return [{
public async getRootChild(): Promise<TreeItem> {
return {
id: AzureResourceDatabaseServerTreeDataProvider.containerId,
label: AzureResourceDatabaseServerTreeDataProvider.containerLabel,
iconPath: this._extensionContext.asAbsolutePath('resources/sqlServer.svg'),
collapsibleState: vscode.TreeItemCollapsibleState.Collapsed,
contextValue: AzureResourceItemType.databaseServerContainer
}];
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ export class KustoTreeDataProvider extends ResourceTreeDataProviderBase<GraphDat
};
}

public async getRootChildren(): Promise<TreeItem[]> {
return [{
public async getRootChild(): Promise<TreeItem> {
return {
id: KustoTreeDataProvider.containerId,
label: KustoTreeDataProvider.containerLabel,
iconPath: this._extensionContext.asAbsolutePath('resources/dataExplorerClusterDb.svg'),
collapsibleState: TreeItemCollapsibleState.Collapsed,
contextValue: AzureResourceItemType.databaseServerContainer
}];
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ export class MysqlFlexibleServerTreeDataProvider extends ResourceTreeDataProvide
};
}

public async getRootChildren(): Promise<TreeItem[]> {
return [{
public async getRootChild(): Promise<TreeItem> {
return {
id: MysqlFlexibleServerTreeDataProvider.CONTAINER_ID,
label: MysqlFlexibleServerTreeDataProvider.CONTAINER_LABEL,
iconPath: this._extensionContext.asAbsolutePath('resources/mysqlDatabase.svg'),
collapsibleState: TreeItemCollapsibleState.Collapsed,
contextValue: AzureResourceItemType.databaseServerContainer
}];
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ export class PostgresServerArcTreeDataProvider extends ResourceTreeDataProviderB
};
}

public async getRootChildren(): Promise<TreeItem[]> {
return [{
public async getRootChild(): Promise<TreeItem> {
return {
id: PostgresServerArcTreeDataProvider.containerId,
label: PostgresServerArcTreeDataProvider.containerLabel,
iconPath: this._extensionContext.asAbsolutePath('resources/azureArcPostgresServer.svg'),
collapsibleState: TreeItemCollapsibleState.Collapsed,
contextValue: AzureResourceItemType.databaseServerContainer
}];
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ export class PostgresFlexibleServerTreeDataProvider extends ResourceTreeDataProv
};
}

public async getRootChildren(): Promise<TreeItem[]> {
return [{
public async getRootChild(): Promise<TreeItem> {
return {
id: PostgresFlexibleServerTreeDataProvider.containerId,
label: PostgresFlexibleServerTreeDataProvider.containerLabel,
iconPath: this._extensionContext.asAbsolutePath('resources/postgresServer.svg'),
collapsibleState: TreeItemCollapsibleState.Collapsed,
contextValue: AzureResourceItemType.databaseServerContainer
}];
};
}
}
Loading

0 comments on commit 9604417

Please sign in to comment.