Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 30, 2026

Why make this change?

Implements CLI command to configure autoentities definitions via command line. Previously, users had to manually edit the config file to add or modify autoentities entries.

What is this change?

Added autoentities-configure command that upserts autoentities definitions with support for:

  • Pattern matching rules (--patterns.include, --patterns.exclude, --patterns.name)
  • Template configuration for REST, GraphQL, MCP, Health, Cache endpoints
  • Permissions using standard role:actions format

Implementation:

  • AutoentitiesConfigureOptions.cs - Command options class following existing CLI patterns
  • ConfigGenerator.TryConfigureAutoentities() - Main handler with builder methods for patterns, template, and permissions
  • Registered command in Program.cs parser

Bug fixes:

  • AutoentityConverter and AutoentityTemplateConverter - Added missing MCP options serialization logic that prevented MCP settings from persisting to config file

How was this tested?

  • Unit Tests
  • Integration Tests

Added 8 unit tests covering:

  • Create/update operations with patterns and template options
  • Permission parsing with multiple actions
  • Error handling for invalid enum values
  • Multiple coexisting definitions

Sample Request(s)

# Create new definition with patterns and permissions
dab autoentities-configure my-def \
  --patterns.include "dbo.%" "sys.%" \
  --patterns.exclude "dbo.internal%" \
  --patterns.name "{schema}_{table}" \
  --permissions "anonymous:read"

# Configure template options
dab autoentities-configure my-def \
  --template.rest.enabled true \
  --template.cache.enabled true \
  --template.cache.ttl-seconds 30 \
  --template.cache.level L1L2

# Update existing definition (upsert behavior)
dab autoentities-configure my-def \
  --template.mcp.dml-tool false \
  --permissions "authenticated:create,read,update,delete"

Result in config:

{
  "autoentities": {
    "my-def": {
      "patterns": {
        "include": ["dbo.%", "sys.%"],
        "exclude": ["dbo.internal%"],
        "name": "{schema}_{table}"
      },
      "template": {
        "rest": { "enabled": true },
        "mcp": false,
        "cache": {
          "enabled": true,
          "ttl-seconds": 30,
          "level": "l1l2"
        }
      },
      "permissions": [
        {
          "role": "authenticated",
          "actions": [
            { "action": "create" },
            { "action": "read" },
            { "action": "update" },
            { "action": "delete" }
          ]
        }
      ]
    }
  }
}
Original prompt

This section details on the original issue you should resolve

<issue_title>Add CLI command dab autoentities configure</issue_title>
<issue_description>New CLI commands need to be added in order to allow the users to change the autoentities properties inside of the config file.
Introduce a new autoentities configure subcommand that operates like an upsert.
These commands need to follow the existing coding pattern that we have for the other CLI commands

dab autoentities configure {definition-name} --patterns.include value
dab autoentities configure {definition-name} --patterns.exclude value
dab autoentities configure {definition-name} --patterns.name value

dab autoentities configure {definition-name} --template.mcp.dml-tool value
dab autoentities configure {definition-name} --template.rest.enabled value
dab autoentities configure {definition-name} --template.graphql.enabled value
dab autoentities configure {definition-name} --template.cache.enabled value
dab autoentities configure {definition-name} --template.cache.ttl-seconds value
dab autoentities configure {definition-name} --template.cache.level value
dab autoentities configure {definition-name} --template.health.enabled value

dab autoentities configure {definition-name} --permissions role:actions
```</issue_description>

## Comments on the Issue (you are @copilot in this section)

<comments>
</comments>


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits January 30, 2026 20:14
Co-authored-by: RubenCerna2079 <32799214+RubenCerna2079@users.noreply.github.com>
Co-authored-by: RubenCerna2079 <32799214+RubenCerna2079@users.noreply.github.com>
Co-authored-by: RubenCerna2079 <32799214+RubenCerna2079@users.noreply.github.com>
Copilot AI changed the title [WIP] Add CLI command dab autoentities configure Jan 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants