Fix autoentity validation & CLI/Schema mismatch bugs#3416
Fix autoentity validation & CLI/Schema mismatch bugs#3416RubenCerna2079 wants to merge 6 commits intomainfrom
Conversation
There was a problem hiding this comment.
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-tooltotemplate.mcp.dml-toolsto 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. |
souvikghosh04
left a comment
There was a problem hiding this comment.
Added some comments
|
|
||
| // Update MCP options | ||
| if (!string.IsNullOrWhiteSpace(options.TemplateMcpDmlTool)) | ||
| if (!string.IsNullOrWhiteSpace(options.TemplateMcpDmlTools)) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Not certain if the changes really work for issue #3335
Why make this change?
autoentities.<def-name>.template.mcp.dml-tools, need to ensure that they are the same.dab validateproduces the wrong output message.What is this change?
For issue #3375:
AutoConfigOption.csfile so that it uses the proper name and changed the name of the variable to also match the schema in theConfigGenerator.cs.For issue #3335:
MsSqlMetadataProvider.csso that it is easier for the user to understand the error.ConfigGenerator.csso that instead of outputing an exception when dab throws an error it just logs the exception.How was this tested?
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