Skip to content

Add missing CLI options for dab configure, add, and update#3409

Open
souvikghosh04 wants to merge 10 commits intomainfrom
Usr/sogh/grp1-dab-configure
Open

Add missing CLI options for dab configure, add, and update#3409
souvikghosh04 wants to merge 10 commits intomainfrom
Usr/sogh/grp1-dab-configure

Conversation

@souvikghosh04
Copy link
Copy Markdown
Contributor

@souvikghosh04 souvikghosh04 commented Apr 3, 2026

What

Adds missing CLI options and fixes schema issues for dab configure, dab add, and dab update commands.

Issues Fixed

Issue Description Fix Location
#3337 Missing runtime.pagination.max-page-size ConfigureOptions, ConfigGenerator
#3338 Missing runtime.pagination.default-page-size ConfigureOptions, ConfigGenerator
#3339 Missing runtime.pagination.next-link-relative ConfigureOptions, ConfigGenerator
#3340 Missing runtime.host.max-response-size-mb ConfigureOptions, ConfigGenerator
#3341 Missing runtime.health.* (enabled, cache-ttl-seconds, max-query-parallelism, roles) ConfigureOptions, ConfigGenerator
#3342 Missing data-source-files ConfigureOptions, ConfigGenerator
#3343 Missing runtime.telemetry.log-level ConfigureOptions, ConfigGenerator
#3377 --cache.ttl should be --cache.ttl-seconds EntityOptions
#3383 Missing data-source.user-delegated-auth.provider ConfigureOptions, ConfigGenerator
#3384 Missing data-source.health.threshold-ms ConfigureOptions, ConfigGenerator
#3385 Missing data-source.health.enabled ConfigureOptions, ConfigGenerator
#3386 Dup of #3339 (same fix)
#3387 Dup of #3340 (same fix)
#3388 Missing entity health.enabled EntityOptions, Utils, ConfigGenerator
#3389 Missing entity cache.level EntityOptions, Utils, ConfigGenerator
#3390 Schema object-description to description dab.draft.schema.json
#3395 cosmosdb_postgresql missing from help text ConfigureOptions
  • ConfigureOptions.cs - 15 new options
  • EntityOptions.cs - Renamed cache.ttl to cache.ttl-seconds; added cache.level, health.enabled
  • AddOptions.cs / UpdateOptions.cs - Pass new entity params
  • ConfigGenerator.cs - Processing for all new options in configure, add, update flows
  • Utils.cs - Updated ConstructCacheOptions; added ConstructEntityHealthOptions
  • dab.draft.schema.json - Renamed object-description to description

Tests

  • Unit tests
  • New tests added

Adds 15 new dab configure options (pagination, health, host max-response-size, data-source-files, data-source health, user-delegated-auth provider, telemetry log-level), renames cache.ttl to cache.ttl-seconds, adds entity-level cache.level and health.enabled options, renames schema source.object-description to source.description, and updates cosmosdb_postgresql in help text. Includes unit tests for all new options.
Fixes #3337 #3338 #3339 #3340 #3341 #3342 #3343 #3377 #3383 #3384 #3385 #3386 #3387 #3388 #3389 #3390 #3395
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 closes CLI coverage gaps by adding missing dab configure, dab add, and dab update options so more runtime/entity configuration can be set via CLI and correctly reflected in generated runtime config.

Changes:

  • Added new dab configure options for runtime pagination, runtime health, host max response size, telemetry log-level, data-source health, user-delegated-auth provider, and data-source-files.
  • Extended dab add/update entity options to support cache.level and health.enabled, and renamed cache.ttl to cache.ttl-seconds.
  • Updated config generation/merge logic and schema property naming (source.object-descriptionsource.description).

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/Cli/Utils.cs Extends entity cache option construction to include cache level; adds entity health option construction.
src/Cli/ConfigGenerator.cs Wires new CLI options into add/update/configure flows and merges them into RuntimeConfig.
src/Cli/Commands/ConfigureOptions.cs Adds new configure CLI options and updates database-type help text.
src/Cli/Commands/EntityOptions.cs Adds --cache.level, --health.enabled, renames --cache.ttl to --cache.ttl-seconds.
src/Cli/Commands/AddOptions.cs Plumbs new entity options into dab add.
src/Cli/Commands/UpdateOptions.cs Plumbs new entity options into dab update.
src/Cli.Tests/ConfigureOptionsTests.cs Adds test coverage for new configure options.
src/Cli.Tests/UpdateEntityTests.cs Adds test coverage for updating entity cache level and health enabled.
src/Cli.Tests/AddEntityTests.cs Updates test option construction for new entity option parameters.
schemas/dab.draft.schema.json Fixes schema property name under entity source object.

Comment thread src/Cli/Utils.cs Outdated
Comment thread src/Cli/ConfigGenerator.cs Outdated
Comment thread src/Cli/ConfigGenerator.cs
Comment thread src/Cli/ConfigGenerator.cs
Comment thread src/Cli/ConfigGenerator.cs
Comment thread src/Cli/ConfigGenerator.cs
…, validate inputs

- Use EntityCacheOptions constructor instead of 'with' to set UserProvided* flags
- Preserve existing entity cache on update when no cache options provided
- Use PaginationOptions constructor for validation and UserProvided flags
- Auto-set health enabled=true when any health sub-option is provided
- Create new dictionary copy for telemetry log-level merge (immutability)
- Reject empty namespace keys in --runtime.telemetry.log-level input
- Add test for empty namespace rejection
Comment thread src/Cli/Commands/EntityOptions.cs
Comment thread src/Cli/Commands/ConfigureOptions.cs
Comment thread src/Cli/Commands/ConfigureOptions.cs Outdated
Comment thread src/Cli/ConfigGenerator.cs Outdated
…ostgreSQL, rename pagination variable

- Rename CacheTtl property/param to CacheTtlSeconds in EntityOptions,
  AddOptions, UpdateOptions, Utils, ConfigGenerator, and tests to match
  the CLI option name cache.ttl-seconds
- Remove CosmosDB_PostgreSQL from configure --database-type HelpText
  since it is not a confirmed supported database type
- Rename 'existing' local variable to 'currentPagination' in
  ConfigGenerator.cs for clarity
@souvikghosh04 souvikghosh04 moved this from In Progress to Review In Progress in Data API builder Apr 8, 2026
Copy link
Copy Markdown
Contributor

@RubenCerna2079 RubenCerna2079 left a comment

Choose a reason for hiding this comment

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

LGTM! Approving assuming comment will be addressed.

Comment thread src/Cli.Tests/ConfigureOptionsTests.cs
@anushakolan
Copy link
Copy Markdown
Contributor

anushakolan commented Apr 15, 2026

Can you also add the newly supported commands which you have added on top of each test, to the PR description?

@anushakolan
Copy link
Copy Markdown
Contributor

Do we know why so many options were missing from the CLI?

@@ -1590,5 +1590,275 @@ public void TestUpdateUserDelegatedAuthDatabaseAudience()
Assert.AreEqual(true, (bool?)userDelegatedAuthSection["enabled"]);
Assert.AreEqual("EntraId", (string?)userDelegatedAuthSection["provider"]);
}
Copy link
Copy Markdown
Contributor

@anushakolan anushakolan Apr 16, 2026

Choose a reason for hiding this comment

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

Tests look great, can we add a small set of negative tests for documented ranges (page sizes < 1, threshold-ms <= 0, max-query-parallelism outside 1–8) + invalid telemetry level token (e.g. Default:NotALevel) to lock validation behavior?

@anushakolan
Copy link
Copy Markdown
Contributor

Looks good to me. I’ve added a few comments that would be helpful to discuss or address. I don’t want to hold up this PR because of them, but please make sure to resolve and close those comments.

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

Labels

assign-for-review cli config changes related to config

Projects

Status: Review In Progress

Development

Successfully merging this pull request may close these issues.

Missing CLI options for dab configure, add and update (Group 1)

4 participants