Skip to content

Fix autoentity validation & CLI/Schema mismatch bugs#3416

Open
RubenCerna2079 wants to merge 6 commits intomainfrom
dev/rubencerna/fix-autoentities-bugs
Open

Fix autoentity validation & CLI/Schema mismatch bugs#3416
RubenCerna2079 wants to merge 6 commits intomainfrom
dev/rubencerna/fix-autoentities-bugs

Conversation

@RubenCerna2079
Copy link
Copy Markdown
Contributor

Why make this change?

What is this change?

For issue #3375:

  • We changed the AutoConfigOption.cs file so that it uses the proper name and changed the name of the variable to also match the schema in the ConfigGenerator.cs.

For issue #3335:

  • We changed the log message in MsSqlMetadataProvider.cs so that it is easier for the user to understand the error.
  • We also added a try-catch to the validation logic in the ConfigGenerator.cs so that instead of outputing an exception when dab throws an error it just logs the exception.

How was this tested?

  • Integration Tests
  • Unit Tests
  • Local Testing
    The issues were related to mismatches or to the output of log messages that can only be tested locally.

Sample Request(s)

dab auto-config --template.mcp.dml-tools true/false
dab validate --config test.json

Copy link
Copy Markdown
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 addresses two CLI/autoentities bugs in Data API builder: aligning the dab auto-config option naming with the JSON schema and improving dab validate behavior/error messaging when autoentity generation fails due to conflicts.

Changes:

  • Renames the CLI option from template.mcp.dml-tool to template.mcp.dml-tools to match the schema and updates related wiring in config generation.
  • Updates the autoentity/entity name conflict message in the MSSQL metadata provider to be more actionable.
  • Wraps CLI validation in try/catch to avoid unhandled exceptions and log errors instead.

Reviewed changes

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

File Description
src/Core/Services/MetadataProviders/MsSqlMetadataProvider.cs Updates conflict exception text for autoentity generation.
src/Cli/ConfigGenerator.cs Adds exception handling to IsConfigValid and renames template MCP dml-tools option usage.
src/Cli/Commands/AutoConfigOptions.cs Renames the CLI option to template.mcp.dml-tools and updates the corresponding property.

@RubenCerna2079 RubenCerna2079 changed the title Dev/rubencerna/fix autoentities bugs Fix autoentity bugs Apr 6, 2026
@RubenCerna2079 RubenCerna2079 changed the title Fix autoentity bugs Fix autoentity validation & CLI/Schema mismatch bugs Apr 6, 2026
Copy link
Copy Markdown
Contributor

@souvikghosh04 souvikghosh04 left a comment

Choose a reason for hiding this comment

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

Added some comments


// Update MCP options
if (!string.IsNullOrWhiteSpace(options.TemplateMcpDmlTool))
if (!string.IsNullOrWhiteSpace(options.TemplateMcpDmlTools))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The PR description says:

"We also added a try-catch to the validation logic in the ConfigGenerator.cs so that instead of outputing an exception when dab throws an error it just logs the exception."

Where is this try-catch?

Copy link
Copy Markdown
Collaborator

@Aniruddh25 Aniruddh25 left a comment

Choose a reason for hiding this comment

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

Not certain if the changes really work for issue #3335

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Review In Progress

Development

Successfully merging this pull request may close these issues.

[Bug]: Invalid CLI dab auto-config --template.mcp.dml-tool [Bug]: autoentities and dab validate

4 participants