Skip to content

VsCode Tasks PR3: Leveraging vscode tasks and github copilot integration into SQL database projects #26303

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

Merged
merged 32 commits into from
Jun 3, 2025

Conversation

ssreerama
Copy link
Contributor

@ssreerama ssreerama commented May 14, 2025

This pull request introduces changes to enhance SQL project build configurations, add support for code analysis during builds, and improve the handling of file paths. The key updates include adding a new "Build With Code Analysis" command, modifying project creation workflows to allow configuration of default build tasks, and refactoring file path handling utilities.

Enhancements to SQL Project Build Configurations:

  • Added a new command sqlDatabaseProjects.buildWithCodeAnalysis for building SQL projects with code analysis, including updates to package.json for command registration, context menus, and task definitions. [1] [2] [3]
  • Introduced a tasksTemplate.json file to define default build tasks with an optional ConfigureDefaultBuild property.

Updates to Project Creation Workflow:

  • Modified the createProject method in IWorkspaceService and WorkspaceService to include a configureDefaultBuild parameter for setting default build configurations. [1] [2]
  • Updated the NewProjectDialog and NewProjectQuickpick workflows to prompt users about configuring the default build task. [1] [2] [3]

Improvements to File Path Handling:

  • Refactored utility functions to handle quoted and non-quoted file paths separately, ensuring compatibility with command-line arguments.

Localization and Constants:

  • Added localized strings for new build-related commands and prompts, such as confirmCreateProjectWithBuildTaskDialogName and buildWithCodeAnalysisTaskName.

Miscellaneous:

  • Registered the new sqlproj-problem-matcher for better error and warning tracking during builds.This pull request introduces several enhancements and new features for SQL project management, including support for configuring default build tasks, adding a "Build With Code Analysis" command, and improving file path handling. The changes span across constants, interfaces, dialogs, services, and package configurations, ensuring a more robust and user-friendly experience.

Enhancements to SQL Project Build Configuration:

  • Added a new configureDefaultBuild parameter to the createProject method in IWorkspaceService and its implementations, allowing users to set a default build task during project creation (interfaces.ts, workspaceService.ts). [1] [2]
  • Introduced a quick pick dialog in newProjectQuickpick.ts to prompt users for configuring SQL project builds as default, enhancing interactivity during project creation.
  • Added a tasksTemplate.json file to define a default build task with a problem matcher for SQL projects.

New "Build With Code Analysis" Feature:

  • Added a buildWithCodeAnalysis command to the package.json file, enabling users to build SQL projects with code analysis. [1] [2]
  • Updated the mainController.ts to register the buildWithCodeAnalysis command and pass a flag to the build method for this functionality.

Improvements in File Path Handling:

  • Refactored file path utilities in utils.ts to provide non-quoted path handling for better compatibility with command-line arguments.

Updates to Constants:

Package Configuration Enhancements:

  • Defined a new problem matcher and task definitions in package.json to support SQL project builds and code analysis. This PR introduces task-based integration for SQL Database Projects in Azure Data Studio, enabling users to run build and Build with code analysis, publish(yet to run through the tasks) operations through VS Code tasks. These tasks now stream output directly to the terminal, improving visibility, consistency, and developer experience.
  • Migrated the SQL project build process to use a VS Code terminal task.
  • Output is streamed live to the terminal, replacing the previous OutputChannel dependency.
  • Errors and warnings are now easier to trace and debug.
  • With the integration of code analysis tools (new option is introduced) and GitHub task problem matchers, users can now:
  • Identify build and publish errors directly in the terminal.
  • See warnings and suggestions inline.
  • Update their code accordingly with clearer diagnostics.

Below are the two parts(watch one after the other to understand the process) of complete testing video that involves, build, build with code analysis, dotnet build and dotnet publish, using tasks to run the build and build and code analysis and github copilot problem matcher usage.
SqlPRojTasksForPRNewDBProj_1
SqlPRojTasksForPRNewDBProj_2

@ssreerama ssreerama requested a review from zijchen May 20, 2025 15:47
@Charles-Gagnon Charles-Gagnon removed their request for review May 23, 2025 16:42
@ssreerama ssreerama changed the title Leveraging vscode tasks and github copilot integration into SQL database projects VsCode Tasks PR3: Leveraging vscode tasks and github copilot integration into SQL database projects May 24, 2025
@ssreerama ssreerama requested review from zijchen and Copilot May 27, 2025 20:29
Copy link
Contributor

@Copilot 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

This PR integrates VS Code tasks into SQL Database Projects by adding a “Build With Code Analysis” command, enabling default task configuration during project creation, and refining file path utilities.

  • Added a new sqlDatabaseProjects.buildWithCodeAnalysis command and wired it through MainController to run as a VS Code task
  • Introduced a configureDefaultBuild flag in project creation APIs and a tasksTemplate.json template for setting the build task as default
  • Refactored path‐quoting utilities in utils.ts and updated related tests to align with the new build‐argument format

Reviewed Changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/tools/buildHelper.ts Dropped explicit build <path> prefix and appended verbose flag via constants.detailedVerbose
src/test/buildHelper.test.ts Updated tests to match the new constructBuildArguments format
resources/templates/tasksTemplate.json Added placeholder @@ConfigureDefaultBuild@@ for default task
src/controllers/projectController.ts Added createVsCodeTask method and configureDefaultBuild support
src/common/utils.ts Split quoted vs non‐quoted path helpers (getNonQuotedPath)
src/common/constants.ts Introduced new constants for task type, problem matcher, and CLI flags
Comments suppressed due to low confidence (1)

extensions/sql-database-projects/src/test/buildHelper.test.ts:21

  • The test now only checks the prefix of the flags and no longer verifies that the project path is correctly included and quoted. Consider adding back an assertion for the full argument string to ensure path quoting remains correct.
should(resultArg).startWith('/p:NetCoreBuild=true /p:NETCoreTargetsPath="dummy\\dll path" /p:SystemDacpacsLocation="dummy\\dll path"');

@ssreerama ssreerama requested a review from Copilot May 31, 2025 04:20
Copy link
Contributor

@Copilot 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

This pull request enhances SQL Database Project build configurations by adding a new “Build With Code Analysis” command, supports default build task configuration during project creation, and improves file path handling utilities.

  • Introduces new task templates and commands in package.json and constants
  • Updates project creation workflows to include a configureDefaultBuild option
  • Refactors methods in controllers and tools to integrate VS Code tasks for build and code analysis

Reviewed Changes

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

Show a summary per file
File Description
netcoreTool.ts Refactored .NET Core installation verification into a dedicated method
buildHelper.ts Modified build argument construction to include detailed verbose output
templates.test.ts, buildHelper.test.ts, projectController.test.ts, publishDatabaseDialog.test.ts Updated tests to cover new default build task and adjusted expected values
projectProvider.ts, projectController.ts, createProjectFromDatabaseQuickpick.ts Added and propagated the configureDefaultBuild parameter throughout project creation and build workflows
mainController.ts Registered the new buildWithCodeAnalysis command
utils.ts Updated file path utility functions to return non-quoted values
constants.ts, tasksTemplate.json, package.json, package.nls.json Added new constants, task definitions, and localized strings to support build configuration changes

@ssreerama ssreerama added this to the June 2025 Release milestone Jun 2, 2025
@ssreerama ssreerama requested a review from Copilot June 2, 2025 21:55
Copy link
Contributor

@Copilot 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

This pull request integrates VS Code task support for SQL project builds, enhances build configurations including a new “Build With Code Analysis” command, and improves file path utility functions. Key changes include:

  • Refactoring build and project creation workflows to incorporate a configurable default build task.
  • Adding a new tasksTemplate.json and updating command registrations and test cases.
  • Updating utility functions and constants to support the new VS Code task-based build approach.

Reviewed Changes

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

Show a summary per file
File Description
extensions/sql-database-projects/src/tools/netcoreTool.ts Refactored .NET Core installation checks using verifyNetCoreInstallation.
extensions/sql-database-projects/src/tools/buildHelper.ts Updated build argument strings to align with the new VS Code tasks mechanism.
extensions/sql-database-projects/src/test/templates.test.ts Updated expected template count to reflect the new tasks.json template addition.
extensions/sql-database-projects/src/test/projectController.test.ts Added tests to verify creation of a default build tasks file when configureDefaultBuild is true.
extensions/sql-database-projects/src/test/dialogs/publishDatabaseDialog.test.ts Updated project creation tests to include the new configuration flag.
extensions/sql-database-projects/src/test/buildHelper.test.ts Adjusted build argument tests to the revised command string format.
extensions/sql-database-projects/src/templates/templates.ts Included the tasks.json template in the list of project templates.
extensions/sql-database-projects/src/projectProvider/projectProvider.ts Propagated the new configureDefaultBuild parameter to project creation.
extensions/sql-database-projects/src/dialogs/createProjectFromDatabaseQuickpick.ts Added a quick pick prompt to configure default build configuration during project creation.
extensions/sql-database-projects/src/controllers/projectController.ts Major update: integrates tasks file creation, VS Code task creation for build & code analysis, and flag usage.
extensions/sql-database-projects/src/controllers/mainController.ts Registered the new buildWithCodeAnalysis command alongside the standard build command.
extensions/sql-database-projects/src/common/utils.ts Revised file path quoting functions and introduced non-quoted variants.
extensions/sql-database-projects/src/common/constants.ts Introduced new constants for task definitions, problem matcher, and build-related parameters.
extensions/sql-database-projects/resources/templates/tasksTemplate.json New tasks template file to define the default build task with configurable default flag.
extensions/sql-database-projects/package.json and package.nls.json Registered new commands, updated menus, and added task definitions and problem matcher for SQL projects.

@ssreerama ssreerama merged commit 3e2b12a into main Jun 3, 2025
11 of 12 checks passed
@ssreerama ssreerama deleted the sai/sqlprojTasks branch June 3, 2025 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants