Skip to content

Conversation

@souvikghosh04
Copy link
Contributor

@souvikghosh04 souvikghosh04 commented Nov 5, 2025

Why make this change?

This PR addresses the issue where with serialization of dml-tools property for user-provided (non-default) values. This is a follow up to the fix made for the functionality of dml-tools property- #2927

What is this change?

If dml-tools is not configured, this property should not be serialized. Serialization should only be done for user provided configuration. So, any value explicitly set or configured by the user for dml-tools will be serialized.
dml-tools can either have either of the below values-

  • A boolean value- true or false. This is a global value to enable or disable all DML tools and UserProvidedAllTools is written in JSON
  • A dictionary object of individual tool name and boolean values. This contains individual tool specific values and only the specified tools will be taken for JSON writing and unspecified tool names will be ignored.

How was this tested?

  • Integration Tests
  • Unit Tests
  • Manual Tests

Sample scenarios for testing-

Scenario 1: Enable all tools using a single boolean value

"dml-tools": true

Note: default is true so even if dml-tools unspecified it will default to true.

Scenario 2: Disable execute-entities only and keep other tools enabled as default.

      "dml-tools": {
        "execute-entities":  false
      }

Scenario 3: Use full list of tools and enable or disable them

      "dml-tools": {
        "execute-entity": true,
        "delete-record": false,
        "update-record": false,
        "read-records": false,
        "describe-entities": true
      }

@souvikghosh04
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 6 pipeline(s).

@souvikghosh04
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 6 pipeline(s).

@souvikghosh04 souvikghosh04 changed the title user provided serialization fixes for dml-tools property User provided serialization fixes for dml-tools property Nov 5, 2025
@souvikghosh04
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 6 pipeline(s).

@souvikghosh04
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 6 pipeline(s).

@souvikghosh04
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 6 pipeline(s).

@souvikghosh04
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 6 pipeline(s).

@souvikghosh04
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 6 pipeline(s).

@souvikghosh04 souvikghosh04 changed the title User provided serialization fixes for dml-tools property User provided dml-tools property serialization Nov 5, 2025
@souvikghosh04 souvikghosh04 self-assigned this Nov 5, 2025
@souvikghosh04 souvikghosh04 added this to the Nov 2025 milestone Nov 5, 2025
@souvikghosh04 souvikghosh04 added bug Something isn't working mcp-server mssql an issue thats specific to mssql labels Nov 5, 2025
@souvikghosh04 souvikghosh04 moved this from Todo to In Progress in Data API builder Nov 5, 2025
@souvikghosh04
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 6 pipeline(s).

@souvikghosh04 souvikghosh04 marked this pull request as ready for review November 6, 2025 10:10
Copilot AI review requested due to automatic review settings November 6, 2025 10:10
Copy link
Contributor

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 refactors how the DML tools configuration tracks user-provided values to fix serialization behavior. When DML tools are not explicitly configured by users, they should not be serialized to the config file, maintaining cleaner default configurations.

Key changes:

  • Renamed UserProvidedAllToolsEnabled to UserProvidedAllTools for consistency and clarity
  • Modified the Default property to avoid setting UserProvided flags, ensuring default configurations don't serialize DML tools
  • Updated FromBoolean method to only set allToolsEnabled parameter and let individual tools inherit from it
  • Changed McpRuntimeOptions to use bool? for the Enabled parameter to support nullable defaults

Reviewed Changes

Copilot reviewed 45 out of 45 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/Config/ObjectModel/DmlToolsConfig.cs Renamed property, updated Default and FromBoolean methods to fix user-provided tracking logic
src/Config/ObjectModel/McpRuntimeOptions.cs Changed Enabled parameter to nullable to support proper default handling
src/Config/Converters/DmlToolsConfigConverter.cs Updated property reference to use renamed UserProvidedAllTools, fixed control flow to use separate if statements
src/Cli.Tests/ConfigGeneratorTests.cs Removed explicit DML tools configuration from test to reflect new default behavior
Multiple snapshot files Updated expected test snapshots to reflect new serialization behavior with UserProvided flags all set to false

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

@souvikghosh04
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 6 pipeline(s).

@souvikghosh04 souvikghosh04 moved this from In Progress to Review In Progress in Data API builder Nov 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working mcp-server mssql an issue thats specific to mssql

Projects

Status: Review In Progress

Development

Successfully merging this pull request may close these issues.

3 participants