Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions l10n/bundle.l10n.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"\"registerAzureUtilsExtensionVariables\" must be called before using the vscode-azext-azureutils package.": "\"registerAzureUtilsExtensionVariables\" must be called before using the vscode-azext-azureutils package.",
"\"registerUIExtensionVariables\" must be called before using the vscode-azureextensionui package.": "\"registerUIExtensionVariables\" must be called before using the vscode-azureextensionui package.",
"(recently used)": "(recently used)",
"{0} completed successfully": "{0} completed successfully",
"{0} failed: {1}": "{0} failed: {1}",
"{0} was stopped": "{0} was stopped",
"{countMany} documents have been deleted.": "{countMany} documents have been deleted.",
"{countOne} document has been deleted.": "{countOne} document has been deleted.",
"{documentCount} documents exported…": "{documentCount} documents exported…",
Expand All @@ -19,6 +22,8 @@
"⚠ TLS/SSL Disabled": "⚠ TLS/SSL Disabled",
"✅ **Security:** TLS/SSL Enabled": "✅ **Security:** TLS/SSL Enabled",
"$(add) Create...": "$(add) Create...",
"$(check) Success": "$(check) Success",
"$(error) Failure": "$(error) Failure",
"$(info) Some storage accounts were filtered because of their sku. Learn more...": "$(info) Some storage accounts were filtered because of their sku. Learn more...",
"$(keyboard) Manually enter error": "$(keyboard) Manually enter error",
"$(plus) Create new {0}...": "$(plus) Create new {0}...",
Expand Down Expand Up @@ -70,6 +75,7 @@
"Choose a Virtual Machine…": "Choose a Virtual Machine…",
"Choose the data migration provider…": "Choose the data migration provider…",
"Choose the migration action…": "Choose the migration action…",
"Choose whether the task should succeed or fail": "Choose whether the task should succeed or fail",
"Choose your provider…": "Choose your provider…",
"Choose your Service Provider": "Choose your Service Provider",
"Click here to retry": "Click here to retry",
Expand Down Expand Up @@ -123,6 +129,8 @@
"Delete database \"{databaseId}\" and its contents?": "Delete database \"{databaseId}\" and its contents?",
"Delete selected document(s)": "Delete selected document(s)",
"Deleting...": "Deleting...",
"Demo Task {0}": "Demo Task {0}",
"Demo Task Configuration": "Demo Task Configuration",
"Disable TLS/SSL (Not recommended)": "Disable TLS/SSL (Not recommended)",
"Disable TLS/SSL checks when connecting.": "Disable TLS/SSL checks when connecting.",
"Do not rely on case to distinguish between databases. For example, you cannot use two databases with names like, salesData and SalesData.": "Do not rely on case to distinguish between databases. For example, you cannot use two databases with names like, salesData and SalesData.",
Expand Down Expand Up @@ -370,6 +378,7 @@
"Started executable: \"{command}\". Connecting to host…": "Started executable: \"{command}\". Connecting to host…",
"Starting executable: \"{command}\"": "Starting executable: \"{command}\"",
"Starts with mongodb:// or mongodb+srv://": "Starts with mongodb:// or mongodb+srv://",
"Stopping {0}": "Stopping {0}",
"Stopping task...": "Stopping task...",
"subscription": "subscription",
"Successfully created resource group \"{0}\".": "Successfully created resource group \"{0}\".",
Expand All @@ -385,6 +394,9 @@
"Task failed": "Task failed",
"Task is running": "Task is running",
"Task stopped": "Task stopped",
"Task stopped during initialization": "Task stopped during initialization",
"Task will complete successfully": "Task will complete successfully",
"Task will fail at a random step for testing": "Task will fail at a random step for testing",
"Task with ID {0} already exists": "Task with ID {0} already exists",
"Task with ID {0} not found": "Task with ID {0} not found",
"The \"{databaseId}\" database has been deleted.": "The \"{databaseId}\" database has been deleted.",
Expand Down
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,12 @@
"title": "Refresh",
"icon": "$(refresh)"
},
{
"//": "[Testing] Start Demo Task",
"category": "DocumentDB",
"command": "vscode-documentdb.command.testing.startDemoTask",
"title": "Start Demo Task"
},
{
"//": "[DiscoveryView] Enable Registry",
"category": "DocumentDB",
Expand Down
38 changes: 37 additions & 1 deletion src/documentdb/ClustersExtension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,17 @@ import { ext } from '../extensionVariables';
import { AzureVMDiscoveryProvider } from '../plugins/service-azure-vm/AzureVMDiscoveryProvider';
import { AzureDiscoveryProvider } from '../plugins/service-azure/AzureDiscoveryProvider';
import { DiscoveryService } from '../services/discoveryServices';
import { TaskReportingService } from '../services/taskReportingService';
import { TaskService } from '../services/taskService';
import { DemoTask } from '../services/tasks/DemoTask';
import { MongoVCoreBranchDataProvider } from '../tree/azure-resources-view/documentdb/mongo-vcore/MongoVCoreBranchDataProvider';
import { ConnectionsBranchDataProvider } from '../tree/connections-view/ConnectionsBranchDataProvider';
import { DiscoveryBranchDataProvider } from '../tree/discovery-view/DiscoveryBranchDataProvider';
import { WorkspaceResourceType } from '../tree/workspace-api/SharedWorkspaceResourceProvider';
import { ClustersWorkspaceBranchDataProvider } from '../tree/workspace-view/documentdb/ClustersWorkbenchBranchDataProvider';
import { Views } from './Views';
import { enableMongoVCoreSupport, enableWorkspaceSupport } from './activationConditions';
import { registerScrapbookCommands } from './scrapbook/registerScrapbookCommands';
import { Views } from './Views';

export class ClustersExtension implements vscode.Disposable {
dispose(): Promise<void> {
Expand Down Expand Up @@ -128,6 +131,9 @@ export class ClustersExtension implements vscode.Disposable {
this.registerConnectionsTree(activateContext);
this.registerDiscoveryTree(activateContext);

// Initialize TaskService and TaskReportingService
TaskReportingService.attach(TaskService);

//// General Commands:

registerCommandWithTreeNodeUnwrapping('vscode-documentdb.command.refresh', refreshTreeElement);
Expand Down Expand Up @@ -254,6 +260,36 @@ export class ClustersExtension implements vscode.Disposable {
'vscode-documentdb.command.exportDocuments',
exportEntireCollection,
);

// Testing command for DemoTask
registerCommand('vscode-documentdb.command.testing.startDemoTask', async (_context: IActionContext) => {
const failureOptions = [
{
label: vscode.l10n.t('$(check) Success'),
description: vscode.l10n.t('Task will complete successfully'),
shouldFail: false,
},
{
label: vscode.l10n.t('$(error) Failure'),
description: vscode.l10n.t('Task will fail at a random step for testing'),
shouldFail: true,
},
];

const selectedOption = await vscode.window.showQuickPick(failureOptions, {
title: vscode.l10n.t('Demo Task Configuration'),
placeHolder: vscode.l10n.t('Choose whether the task should succeed or fail'),
});

if (!selectedOption) {
return; // User cancelled
}

const task = new DemoTask(vscode.l10n.t('Demo Task {0}', Date.now()), selectedOption.shouldFail);
TaskService.registerTask(task);
void task.start();
});

// This is an optional task - if it fails, we don't want to break extension activation,
// but we should log the error for diagnostics
try {
Expand Down
Loading