DacPac Dialog Bug Fixes and Feature Flag Implementation#20505
DacPac Dialog Bug Fixes and Feature Flag Implementation#20505allancascante merged 86 commits intomainfrom
Conversation
…rm.tsx Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Pull Request Overview
This PR enhances the DACPAC/BACPAC dialog functionality by implementing experimental feature gating, improving user experience with application version validation and success notifications, and updating terminology from "Deploy" to "Publish" for consistency.
- Implements experimental feature flag to conditionally register and display DACPAC/BACPAC commands
- Adds application version format validation (n.n.n or n.n.n.n) for Extract operations
- Introduces success notifications with "Reveal in Explorer" actions for Extract/Export operations
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/controllers/mainController.ts | Conditionally registers DACPAC commands based on experimental features flag and sets VS Code context for menu visibility |
| src/controllers/dacpacDialogWebviewController.ts | Adds success notifications for all operations, filters system databases from listings, and updates terminology in comments |
| src/reactviews/pages/DacpacDialog/dacpacDialogForm.tsx | Implements application version validation, reorders UI sections for better UX, and adds Learn More link |
| src/reactviews/pages/DacpacDialog/ApplicationInfoSection.tsx | Adds validation support with error display for application version field |
| src/reactviews/common/locConstants.ts | Updates terminology from "Deploy DACPAC" to "Publish DACPAC" and adds validation message |
| src/constants/locConstants.ts | Adds new localized success messages and validation error message |
| package.json | Updates menu visibility condition to include experimental features check |
| test/unit/mainController.test.ts | Updates tests to handle conditional command registration based on experimental features |
| test/unit/dacpacDialogWebviewController.test.ts | Updates test descriptions to use "Publish" terminology and adds stub for notification messages |
| localization/xliff/vscode-mssql.xlf | Updates localization entries for terminology changes and new messages |
| localization/l10n/bundle.l10n.json | Updates localization bundle with new and updated strings |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
PR Changes
|
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (67.64%) is below the target coverage (70.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #20505 +/- ##
=======================================
Coverage 57.59% 57.60%
=======================================
Files 207 207
Lines 18798 18826 +28
Branches 1175 1178 +3
=======================================
+ Hits 10827 10845 +18
- Misses 7971 7981 +10
🚀 New features to boost your workflow:
|
| LocConstants.DacpacDialog.RevealInExplorer, | ||
| ) | ||
| .then((selection) => { | ||
| if (selection === LocConstants.DacpacDialog.RevealInExplorer) { |
There was a problem hiding this comment.
This should be "Reveal in Finder" on macOS and "Open Containing Folder" on Linux. #20511
| registerDacPacCommand(Constants.cmdDacpacDialog, DacPacDialogOperationType.Deploy); | ||
| registerDacPacCommand(Constants.cmdDeployDacpac, DacPacDialogOperationType.Deploy); | ||
| registerDacPacCommand(Constants.cmdExtractDacpac, DacPacDialogOperationType.Extract); | ||
| registerDacPacCommand(Constants.cmdImportBacpac, DacPacDialogOperationType.Import); | ||
| registerDacPacCommand(Constants.cmdExportBacpac, DacPacDialogOperationType.Export); |
There was a problem hiding this comment.
These commands need to be added to package.json's contributes/menus/commandPalette section with:
{
"command": "mssql.launchDacpacDialog",
"when": "mssql.enableExperimentalFeatures"
},
As is, these still show up in the command palette, but error out because the flag being off means they aren't actually registered.
| @@ -570,7 +570,7 @@ | |||
| }, | |||
| { | |||
There was a problem hiding this comment.
For follow-up: we should rename the commands so that they're grouped as a feature, e.g.:
mssql.launchDacpacDialog -> mssql.dacpacDialog.launch
mssql.deployDacpac -> mssql.dacpacDialog.deploy
| await vscode.commands.executeCommand( | ||
| "setContext", | ||
| "mssql.experimentalFeaturesEnabled", | ||
| this.isExperimentalEnabled, | ||
| ); |
There was a problem hiding this comment.
This shouldn't be necessary for boolean config options. Look in package.json for "when": "mssql.enableRichExperiences"
There was a problem hiding this comment.
this is needed to hide the menu option on OE
| <Field | ||
| label={locConstants.dacpacDialog.applicationVersionLabel} | ||
| validationMessage={versionValidation?.message} | ||
| validationState={versionValidation?.severity === "error" ? "error" : "none"}> |
There was a problem hiding this comment.
Why not just validationState={versionValidation?.severity}? All of versionValidation?.severity's potential values (error, warning, undefined) are valid for validationState.
| // Regex to match n.n.n.n format where n is one or more digits | ||
| // Allows 3 or 4 parts (1.0.0 or 1.0.0.0) | ||
| const versionRegex = /^\d+\.\d+\.\d+(\.\d+)?$/; |
| <div className={classes.description}>{locConstants.dacpacDialog.subtitle}</div> | ||
| <div className={classes.description}> | ||
| {locConstants.dacpacDialog.subtitle}{" "} | ||
| <Link href="https://learn.microsoft.com/en-us/sql/tools/sql-database-projects/concepts/data-tier-applications/overview?view=sql-server-ver17"> |
There was a problem hiding this comment.
We should extract this to src\reactviews\common\constants.ts
Description
This PR addresses critical bug fixes identified during code review and implements a feature flag to gate the Data-tier Application dialog behind experimental features. This allows for controlled rollout and user opt-in while ensuring stability of the core extension.
Changes in this PR:
Enable the Feature:
{ "mssql.enableExperimentalFeatures": true}
After enabling, reload VS Code. The "Data-tier Applications..." menu item will appear in Object Explorer for Server and Database nodes. And the operations for the quick lunch for Data-tier will be available also.
Shows filename in notification message for clarity
Users can quickly locate exported files without searching file system
Consistent terminology: "Deploy", "Extract", "Import", "Export"
Code Changes Checklist
npm run test)Reviewers: Please read our reviewer guidelines