Add dab auto-config-simulate CLI command#3189
Merged
anushakolan merged 14 commits intomainfrom Mar 9, 2026
Merged
Conversation
Co-authored-by: RubenCerna2079 <32799214+RubenCerna2079@users.noreply.github.com>
…doc comment Co-authored-by: RubenCerna2079 <32799214+RubenCerna2079@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add CLI command dab auto-config-simulate
Add Mar 3, 2026
dab autoentities-simulate CLI command
dab autoentities-simulate CLI commanddab auto-config-simulate CLI command
Aniruddh25
requested changes
Mar 9, 2026
…ateTests, fix tuple naming Co-authored-by: Aniruddh25 <3513779+Aniruddh25@users.noreply.github.com>
…le output, CSV output, no-match) Co-authored-by: Aniruddh25 <3513779+Aniruddh25@users.noreply.github.com>
Contributor
Author
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Contributor
|
/azp run |
|
Azure Pipelines successfully started running 6 pipeline(s). |
Aniruddh25
reviewed
Mar 9, 2026
Aniruddh25
reviewed
Mar 9, 2026
Aniruddh25
approved these changes
Mar 9, 2026
…est per review feedback Co-authored-by: Aniruddh25 <3513779+Aniruddh25@users.noreply.github.com>
…per review feedback Co-authored-by: Aniruddh25 <3513779+Aniruddh25@users.noreply.github.com>
Aniruddh25
approved these changes
Mar 9, 2026
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 6 pipeline(s). |
anushakolan
approved these changes
Mar 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Why make this change?
Developers using autoentities needed a way to preview which database objects would be matched by their filter definitions before committing changes to the config.
What is this change?
New
auto-config-simulateverb that connects to the MSSQL database, executes the autoentities pattern-match query for each filter definition, and outputs results.New files:
src/Cli/Commands/AutoConfigSimulateOptions.cs— defines theauto-config-simulateverb with optional--output/-oflagsrc/Cli.Tests/AutoConfigSimulateTests.cs— unit and integration tests for the simulate commandConfigGenerator.csadditions:TrySimulateAutoentities— loads config (with env-var resolution), validates MSSQL + autoentities present, opens aSqlConnection, and runsMsSqlQueryBuilder.BuildGetAutoentitiesQuery()for each defined filter using explicitSqlParameterinstances withSqlDbType.NVarCharWriteSimulationResultsToConsole— prints grouped output with match counts and alignedentity → schema.objectlinesWriteSimulationResultsToCsvFile— writes RFC 4180-compliant CSV (values are properly quoted/escaped)QuoteCsvValue— helper that wraps and escapes commas, quotes, and newlines in CSV fieldsProgram.cs: registersAutoConfigSimulateOptionsin the parser.How was this tested?
AutoConfigSimulateTests.cscovers: filter matching a known table with console output, filter matching a known table with CSV file output, and filter matching no tables (all marked[TestCategory("MsSql")], skip gracefully whenMSSQL_SA_PASSWORDis not set).AutoConfigSimulateTests.cscovers: no autoentities defined.Sample Request(s)
Console output (default):
CSV file output:
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.