Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 24, 2025

Implements telemetry tracking for DACPAC/BACPAC operations (Deploy, Extract, Import, Export) to enable monitoring of operation success rates, durations, and failure patterns.

Changes

  • Telemetry enums (src/sharedInterfaces/telemetry.ts)

    • Added DataTierApplication view
    • Added actions: DeployDacpac, ExtractDacpac, ImportBacpac, ExportBacpac
  • Operation tracking (src/controllers/dataTierApplicationWebviewController.ts)

    • Wrapped all 4 DAC operations with startActivity() telemetry
    • Captures duration, success/failure status, database name, and error details
    • Tracks operation-specific context (e.g., isNewDatabase for Deploy, hasApplicationName for Extract)
  • Test utilities (test/unit/utils.ts)

    • Extended stubTelemetry() to stub startActivity with mock activity object

Example

private async handleDeployDacpac(params: DeployDacpacParams): Promise<DataTierApplicationResult> {
    const activity = startActivity(
        TelemetryViews.DataTierApplication,
        TelemetryActions.DeployDacpac,
        undefined,
        { isNewDatabase: params.isNewDatabase.toString() }
    );

    try {
        const result = await this.dacFxService.deployDacpac(...);
        if (result.success) {
            activity.end(ActivityStatus.Succeeded, { databaseName: params.databaseName });
        } else {
            activity.endFailed(new Error(result.errorMessage || "Unknown error"), ...);
        }
        return appResult;
    } catch (error) {
        activity.endFailed(error, ...);
        // error handling
    }
}

Telemetry data includes operation timing, database context, and detailed error information for debugging production issues.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • update.code.visualstudio.com
    • Triggering command: /usr/local/bin/node ./out/test/unit/runTest.js --grep DataTierApplicationWebviewController (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

implement this.

[Chronological Review: The conversation began with user requests for changes and improvements to the data-tier application in the vscode-mssql repository. The user expressed concerns about validation errors, connection handling, and user experience issues. The conversation progressed through various requests for refactoring, error handling, and telemetry implementation, with the user providing specific feedback on functionality and expected behavior.]

[Intent Mapping:

  1. "Application Name and Application Version on extract operation should not be required" - User wants to simplify the extract operation.
  2. "I think validationErrors and setValidationErrors cannot be a record..." - User questions the data structure used for validation errors.
  3. "now after a successful operation we have to clear the form" - User requests functionality to clear the form after operations.
  4. "version value is in 3 places it should go to a constant" - User suggests refactoring to improve code maintainability.
  5. "remove the MessageBar on errorMessage successMessage or inOperationInProgress" - User wants to streamline error messaging.
  6. "in that form the drop down must be replaced with a radio button group..." - User requests a UI change.
  7. "now after clearing the form on a successful operation the respective server node in the object explorer must reload..." - User wants to ensure UI reflects the latest state after operations.
  8. "schema compare loads only active connections..." - User points out issues with connection handling.
  9. "functionality speaking what would be lost if we implement this refactoring?" - User seeks clarification on potential impacts of proposed changes.
  10. "your analysis is not right; those changes don't address the problem I see..." - User provides feedback on previous suggestions.
  11. "run the tests and fix the failures due to the changes" - User requests testing and debugging.
  12. "now have to add telemetry based on this..." - User requests telemetry implementation for tracking operations.
  13. "implement this." - User asks for the telemetry to be added.]

[Technical Inventory:

  • Technologies: TypeScript, React, VS Code API
  • Concepts: Validation handling, error reporting, UI components (radio buttons, dropdowns), telemetry logging
  • Tools: VS Code Telemetry Reporter, testing frameworks]

[Code Archaeology:

  • Files discussed:
    • dataTierApplicationForm.tsx: UI form handling
    • dacFxService.ts: Service layer for DAC operations
    • dataTierApplicationWebviewController.ts: Controller logic for handling operations
  • Key functions: loadConnections, handleServerChange, telemetry logging functions]

[Progress Assessment:

  • Completed Tasks: User feedback has been addressed in various areas, including validation and UI changes.
  • Partially Complete Work: Telemetry implementation is pending, and testing needs to be completed.
  • Validated Outcomes: Some UI changes and error handling improvements have been confirmed.]

[Context Validation: All critical information for continuation is captured, including user requests for functionality, refactoring, and telemetry.]

[Recent Commands Analysis:

  • Last Agent Commands: User requested to "run the tests and fix the failures due to the changes" and "now have to add telemetry based on this..."
  • Tool Results Summary: No specific tool results were provided in the recent commands, but the context indicates a need for testing and telemetry implementation.
  • Pre-Summary State: The agent was actively working on implementing telemetry and addressing user feedback when the token budget was exceeded.
  • Operation Context: The recent commands were executed to ensure the application meets user expectations and to enhance functionality through telemetry.]
1. Conversation Overview: - Primary Objectives: User requested various improvements to the data-tier application, including simplifying operations, enhancing error handling, and implementing telemetry. - Session Context: The conversation flowed from initial requests for changes to detailed discussions about functionality, user experience, and code structure. - User Intent Evolution: The user’s needs evolved from general improvements to specific requests for refactoring and telemetry implementation.
  1. Technical Foundation:
  • TypeScript: Used for application development.
  • React: Framework for building the UI components.
  • VS Code API: Utilized for integrating with the VS Code environment.
  1. Codebase Status:
  • dataTierApplicationForm.tsx:
    • Purpose: Handles the UI for data-tier operations.
    • Current State: Edits made to improve validation and user experience.
    • Key Code Segments: Functions for handling form submissions and validation.
  • dacFxService.ts:
    • Purpose: Manages DAC operations.
    • Current State: Needs review for connection handling logic.
  • dataTierApplicationWebviewController.ts:
    • Purpose: Controls the logic for the webview.
    • Current State: R...

Created from VS Code via the GitHub Pull Request extension.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Implement improvements for data-tier application Add telemetry tracking for Data-Tier Application operations Oct 24, 2025
Copilot AI requested a review from allancascante October 24, 2025 22:37
Copilot finished work on behalf of allancascante October 24, 2025 22:37
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.

2 participants