Skip to content

Conversation

@ssreerama
Copy link
Contributor

@ssreerama ssreerama commented Oct 22, 2025

Pull Request Template – vscode-mssql

Description

This PR introduces support for updating deployment options within the Publish Project workflow:

  • Advanced Options Drawer
    • An Advanced Options button is added at the bottom of the dialog.
    • Clicking it opens a mini drawer with expandable/collapsible option groups, along with Reset and OK buttons.
  • Available Option Groups
    • Currently includes General, Ignore, and Exclude Object Types.
  • Profile Integration
    • Users can save and reload deployment options using the Publish Profile select and save buttons.
  • Action Buttons
    • Reset restores options to their initial state.
    • OK or ‘X’ applies or clears selections and closes the drawer.
  • Testing:
    • Added tests to validate option selection and loading from profiles.

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

4 AdvancedOptions

@ssreerama ssreerama changed the base branch from main to sai/vscodePublishDialog_3ServerConnection October 22, 2025 20:23
@ssreerama ssreerama changed the title Sai/vscode publish dialog 4 advanced option Publish Dialog - Advanced deployment options Oct 28, 2025
@ssreerama ssreerama requested a review from Copilot October 29, 2025 03:50
Copy link

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 adds an "Advanced Deployment Options" drawer to the Publish Project dialog, allowing users to configure deployment options through a UI instead of manually editing XML profiles. The implementation includes support for loading, modifying, and saving deployment options with the publish profile.

Key changes:

  • New advanced deployment options drawer component with search and categorized options (General, Ignore, Exclude Object Types)
  • State management for deployment options including a new updateDeploymentOptions reducer
  • Integration with DacFx service to load and save deployment options from/to publish profiles

Reviewed Changes

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

Show a summary per file
File Description
test/unit/publishProjectWebViewController.test.ts Added tests for updateDeploymentOptions reducer, profile loading with deployment options, and option grouping
src/sharedInterfaces/publishDialog.ts Added defaultDeploymentOptions to state and updateDeploymentOptions to reducers/provider interface
src/reactviews/pages/PublishProject/publishProjectStateProvider.tsx Implemented updateDeploymentOptions action in state provider
src/reactviews/pages/PublishProject/publishProject.tsx Added Advanced button and drawer integration to the main dialog
src/reactviews/pages/PublishProject/components/advancedDeploymentOptionsDrawer.tsx New component implementing the advanced options drawer with search, categorization, and local change tracking
src/reactviews/common/locConstants.ts Added localized strings for advanced options UI
src/publishProject/publishProjectWebViewController.ts Implemented updateDeploymentOptions reducer and improved profile loading with deployment options support
src/constants/locConstants.ts Added backend localized string constants
localization/xliff/vscode-mssql.xlf Added translation units for new strings
localization/l10n/bundle.l10n.json Added English translations for new strings

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +206 to +209
if (value && !excludedTypes.includes(optionName)) {
excludedTypes.push(optionName);
} else if (!value && excludedTypes.includes(optionName)) {
excludedTypes.splice(excludedTypes.indexOf(optionName), 1);
Copy link

Copilot AI Oct 29, 2025

Choose a reason for hiding this comment

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

The code compares optionName (lowercase key from objectTypesDictionary) with items in excludedTypes array (which contains display names like 'Users', 'Logins') using a case-sensitive comparison. This is inconsistent with the loading logic at line 146 which uses case-insensitive comparison. The comparison should be case-insensitive and compare against the display name from objectTypesDictionary, not the key. Update to: const displayName = updatedOptions.objectTypesDictionary[optionName]; if (value && !excludedTypes.some(t => t.toLowerCase() === displayName.toLowerCase())) { excludedTypes.push(displayName); } else if (!value) { const index = excludedTypes.findIndex(t => t.toLowerCase() === displayName.toLowerCase()); if (index !== -1) excludedTypes.splice(index, 1); }

Suggested change
if (value && !excludedTypes.includes(optionName)) {
excludedTypes.push(optionName);
} else if (!value && excludedTypes.includes(optionName)) {
excludedTypes.splice(excludedTypes.indexOf(optionName), 1);
const displayName = updatedOptions.objectTypesDictionary[optionName];
if (value && !excludedTypes.some(t => t.toLowerCase() === displayName.toLowerCase())) {
excludedTypes.push(displayName);
} else if (!value) {
const index = excludedTypes.findIndex(t => t.toLowerCase() === displayName.toLowerCase());
if (index !== -1) excludedTypes.splice(index, 1);

Copilot uses AI. Check for mistakes.
}

return groups;
}, [state.deploymentOptions, localChanges, loc, getCurrentValue]);
Copy link

Copilot AI Oct 29, 2025

Choose a reason for hiding this comment

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

The useMemo dependency array includes getCurrentValue which is a function defined within the component (line 79). This function is recreated on every render, causing the memo to recompute unnecessarily. Either move getCurrentValue inside the useMemo, or memoize it with useCallback.

Copilot uses AI. Check for mistakes.
return groups;
}, [state.deploymentOptions, localChanges, loc, getCurrentValue]);

// Options change handler, inserts and removed the changed option in localChanges
Copy link

Copilot AI Oct 29, 2025

Choose a reason for hiding this comment

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

Corrected spelling of 'removed' to 'removes' for grammatical correctness in the comment.

Suggested change
// Options change handler, inserts and removed the changed option in localChanges
// Options change handler, inserts and removes the changed option in localChanges

Copilot uses AI. Check for mistakes.
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