Fix Schema Compare object type filtering to respect "Include Object Types" settings #19734
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
Schema Compare Private Preview was not always respecting the "Include Object Types" settings. When users unchecked object types like "Permissions", "Application Roles", and "Users" in the schema compare options, these objects would still appear in the comparison results, causing unwanted deployment scripts to be generated.
As shown in the issue, even with "Permissions" unchecked, a Permission object was still visible in the comparison results with a "Delete" action:
Root Cause
The
getAllObjectTypeDifferences
method inschemaCompareWebViewController.ts
was only filtering differences bySchemaDifferenceType.Object
but was not applying theexcludeObjectTypes
filter from the deployment options. There was even a TODO comment acknowledging this missing functionality.Solution
If "Permissions" are set to be included in the "Include Object Types" settings, then Permission types will appear as shown here:

If "Permissions" are set to not be included in the "Include Object Types" settings, then Permission types will not appear as shown here:

Modified the
getAllObjectTypeDifferences
method to:deploymentOptions
parameterexcludeObjectTypes
arrayChanges Made
Core Implementation:
getAllObjectTypeDifferences
method signature and implementationschemaCompare
method to pass deployment optionsTests Added:
Example
Before the fix:
After the fix:
Impact
Fixes #19255.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
update.code.visualstudio.com
node ./out/test/unit/runTest.js
(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.