Skip to content

Background task viewer #21833

Merged
aasimkhan30 merged 22 commits intomainfrom
aasim/fix/backgroundTask1
Apr 8, 2026
Merged

Background task viewer #21833
aasimkhan30 merged 22 commits intomainfrom
aasim/fix/backgroundTask1

Conversation

@aasimkhan30
Copy link
Copy Markdown
Contributor

@aasimkhan30 aasimkhan30 commented Apr 7, 2026

Description

microsoft/sqltoolsservice@6.0.20260403.1...6.0.20260407.1
image

Adds a background task view to Object explorer pane. It will appear as new tree.
Fixes: #21711

  1. Shows a visual representation of tooltip, progress, for the task.
image 2. Vscode automatically shows the tree when a new background task starts. 3. Important information about task errors is also surfaced. image 4. Double clicking a task should should execute on successful action (Also available in context menu) image

Future PRs will contain:

  1. Viewing detailed logging information.
  2. Support for more tasks to use this viewer other than sql tasks.

Code Changes Checklist

  • New or updated unit tests added
  • All existing tests pass (npm run test)
  • Code follows contributing guidelines
  • Telemetry/logging updated if relevant
  • No regressions or UX breakage

Reviewers: Please read our reviewer guidelines

Aasim Khan added 15 commits April 2, 2026 10:02
- Added constants for background tasks and related commands in constants.ts.
- Integrated BackgroundTasksProvider and BackgroundTasksService in mainController.ts.
- Implemented background task initialization and handling in MainController.
- Enhanced SqlTasksService to register and manage background tasks.
- Created unit tests for BackgroundTasksProvider, MainController, and SqlTasksService to ensure functionality.
- Added logic for task completion, cancellation, and progress updates.
- Implemented UI updates for background tasks in the VSCode extension.
… fabric provisioning logic

- Updated `updateFabricProvisioningState` and `updateLocalContainersState` to use `publishDeploymentState` for state updates.
- Enhanced local containers reducer to handle step completion more effectively, allowing for progress tracking across multiple steps.
- Introduced new properties in `TaskInfo` and `TaskProgressInfo` for better task management and progress reporting.
- Added support for resuming deployments with `resumedDeploymentType` and `resumedWizardPageId` in deployment state.
- Implemented tests for background task synchronization and state updates in both local containers and fabric provisioning.
- Improved user feedback during deployment processes with detailed progress messages and telemetry events.
- Removed unused stubs and tests related to background task handling in fabricProvisioningHelpers and localContainersHelpers tests.
- Updated assertions to check for state updates instead of direct calls to publishDeploymentState.
- Cleaned up localization files by removing obsolete entries and adding necessary translations for background tasks.
…c and updating tests for command execution
…date icon handling to use theme icons instead
Copilot AI review requested due to automatic review settings April 7, 2026 18:38
@aasimkhan30 aasimkhan30 changed the title Aasim/fix/background task1 Background task viewer Apr 7, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a first-class Background Tasks tree view to the Object Explorer pane and wires SQL Tools Service task lifecycle events into it (progress, cancel, completed result actions), addressing #21711.

Changes:

  • Introduces BackgroundTasksService/BackgroundTasksProvider/nodes to model and render background tasks in a dedicated tree view.
  • Updates SqlTasksService to register/update/complete background tasks instead of using VS Code notification progress.
  • Adds localization strings + command contributions (open/cancel/clear-finished) and unit tests for new behavior.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
localization/xliff/vscode-mssql.xlf Adds new trans-units for background-task labels and elapsed-time formatting.
extensions/mssql/src/constants/locConstants.ts Introduces localized helpers for task tooltip/elapsed-time strings.
extensions/mssql/src/constants/constants.ts Adds view/command IDs for background tasks.
extensions/mssql/src/backgroundTasks/backgroundTasksService.ts Implements background task registry, update/complete/cancel, ordering, trimming.
extensions/mssql/src/backgroundTasks/backgroundTasksProvider.ts Implements TreeDataProvider + auto-reveal and periodic refresh for running tasks.
extensions/mssql/src/backgroundTasks/backgroundTaskNode.ts Defines tree nodes, tooltip/description formatting, icons, context values.
extensions/mssql/src/services/sqlTasksService.ts Integrates SQL task notifications with BackgroundTasksService and adds open/cancel handling.
extensions/mssql/src/controllers/mainController.ts Initializes the view + commands, implements double-click-to-open semantics.
extensions/mssql/package.json Contributes the tree view + commands/menus for background tasks.
extensions/mssql/package.nls.json Adds command/view display names for localization.
extensions/mssql/l10n/bundle.l10n.json Adds localized bundle entries for new background task strings.
extensions/mssql/test/unit/sqlTasksServiceBackgroundTasks.test.ts Adds unit tests validating SQL task → background task integration.
extensions/mssql/test/unit/backgroundTasksProvider.test.ts Adds unit tests for provider rendering, ordering, reveal, and commands.
extensions/mssql/test/unit/mainControllerBackgroundTasks.test.ts Adds unit test for double-click behavior.
extensions/mssql/test/unit/sqlTasksService.test.ts Enables sinon-chai assertions used by new tests.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 2026

PR Changes

Category Target Branch PR Branch Difference
vscode-mssql VSIX 77272 KB 77277 KB ⚪ 5 KB ( 0% )
sql-database-projects VSIX 6175 KB 6175 KB ⚪ 0 KB ( 0% )
data-workspace VSIX 535 KB 535 KB ⚪ 0 KB ( 0% )
keymap VSIX 7 KB 7 KB ⚪ 0 KB ( 0% )

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 7, 2026

Codecov Report

❌ Patch coverage is 86.07595% with 143 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.91%. Comparing base (f6bbba3) to head (04e0a9f).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
extensions/mssql/src/controllers/mainController.ts 37.66% 48 Missing ⚠️
...ns/mssql/src/backgroundTasks/backgroundTaskNode.ts 82.19% 34 Missing ⚠️
extensions/mssql/src/constants/locConstants.ts 65.71% 24 Missing ⚠️
...ssql/src/backgroundTasks/backgroundTasksService.ts 95.21% 18 Missing ⚠️
...sql/src/backgroundTasks/backgroundTasksProvider.ts 91.93% 10 Missing ⚠️
extensions/mssql/src/services/sqlTasksService.ts 95.48% 8 Missing ⚠️
...ensions/mssql/src/queryHistory/queryHistoryNode.ts 83.33% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #21833      +/-   ##
==========================================
+ Coverage   73.80%   73.91%   +0.11%     
==========================================
  Files         335      338       +3     
  Lines      101149   102102     +953     
  Branches     5821     5950     +129     
==========================================
+ Hits        74655    75472     +817     
- Misses      26494    26630     +136     
Files with missing lines Coverage Δ
extensions/mssql/src/configurations/config.ts 100.00% <100.00%> (ø)
extensions/mssql/src/constants/constants.ts 100.00% <100.00%> (ø)
...ensions/mssql/src/queryHistory/queryHistoryNode.ts 96.70% <83.33%> (-0.21%) ⬇️
extensions/mssql/src/services/sqlTasksService.ts 97.50% <95.48%> (+0.43%) ⬆️
...sql/src/backgroundTasks/backgroundTasksProvider.ts 91.93% <91.93%> (ø)
...ssql/src/backgroundTasks/backgroundTasksService.ts 95.21% <95.21%> (ø)
extensions/mssql/src/constants/locConstants.ts 75.50% <65.71%> (-0.21%) ⬇️
...ns/mssql/src/backgroundTasks/backgroundTaskNode.ts 82.19% <82.19%> (ø)
extensions/mssql/src/controllers/mainController.ts 35.45% <37.66%> (+0.06%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Benjin
Benjin previously approved these changes Apr 7, 2026
}

function applyTaskUpdate(task: BackgroundTaskEntry, update: BackgroundTaskUpdate): void {
if (Object.prototype.hasOwnProperty.call(update, "displayText") && update.displayText) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There's gotta be a way stick these in a loop

Copilot AI review requested due to automatic review settings April 7, 2026 23:52
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 16 out of 18 changed files in this pull request and generated 7 comments.

@aasimkhan30 aasimkhan30 merged commit 9639c06 into main Apr 8, 2026
3 checks passed
@aasimkhan30 aasimkhan30 deleted the aasim/fix/backgroundTask1 branch April 8, 2026 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: MSSQL Info notification hides data behind it

5 participants