Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jul 11, 2025

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:

Issue Screenshot

Root Cause

The getAllObjectTypeDifferences method in schemaCompareWebViewController.ts was only filtering differences by SchemaDifferenceType.Object but was not applying the excludeObjectTypes 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:
image

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

Modified the getAllObjectTypeDifferences method to:

  1. Accept an optional deploymentOptions parameter
  2. Check if object types are present in the excludeObjectTypes array
  3. Filter out differences for excluded object types using case-insensitive matching
  4. Updated the caller to pass the deployment options

Changes Made

Core Implementation:

  • Updated getAllObjectTypeDifferences method signature and implementation
  • Added object type exclusion logic with case-insensitive matching
  • Updated the schemaCompare method to pass deployment options

Tests Added:

  • Test for filtering excluded object types (Permission, ApplicationRole)
  • Test for including all object types when no exclusions are set
  • Test for case-insensitive matching of excluded object types

Example

Before the fix:

Results: [Table, Permission, ApplicationRole, Procedure]
❌ Permission objects shown despite being unchecked

After the fix:

Results: [Table, Procedure]
✅ Permission objects correctly filtered out

Impact

  • Users can now safely rely on "Include Object Types" settings
  • No more unwanted deployment scripts for excluded object types
  • Eliminates the need for manual script editing to remove permissions, roles, and users
  • Preserves existing behavior when deployment options are not provided

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
    • Triggering command: 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.

@Copilot Copilot AI changed the title [WIP] Schema Compare Private Preview Not Always Respecting "Include Object Types" Fix Schema Compare object type filtering to respect "Include Object Types" settings Jul 11, 2025
@Copilot Copilot AI requested a review from lewis-sanchez July 11, 2025 07:20
Copilot finished work on behalf of lewis-sanchez July 11, 2025 07:20
Copy link

github-actions bot commented Jul 11, 2025

PR Changes

Category Main Branch PR Branch Difference
Code Coverage 59.68% 59.80% ⚪ 0.00%
VSIX Size 15522 KB 15531 KB ⚪ 9 KB ( 0% )
Webview Bundle Size 3804 KB 3792 KB ⚪ -12 KB ( 0% )

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.

Schema Compare Private Preview Not Always Respecting "Include Object Types"
2 participants