Skip to content

feat: add cds config command for persisted project defaults - #537

Open
RonaldHensbergen wants to merge 1 commit into
mainfrom
feat/383-config-defaults
Open

feat: add cds config command for persisted project defaults#537
RonaldHensbergen wants to merge 1 commit into
mainfrom
feat/383-config-defaults

Conversation

@RonaldHensbergen

Copy link
Copy Markdown
Owner

Summary

Implements #383: a cds config subcommand family to manage persisted project-level defaults in .cds/config.json (or CDS_CONFIG_PATH), generalizing the existing single-purpose cds use command.

  • cds config get <key> / set <key> <value> / unset <key> / list
  • Supported keys: profile, environment, security.strict
  • cds config set environment <name> validates the overlay exists for the configured default profile (reusing resolve_profile), mirroring the existing cds use profile validation
  • cds config set security.strict true forces the production security rule class (infer_profile_class override) regardless of the profile's declared environment
  • A saved environment default is applied whenever --environment is omitted, for all commands that already accept --environment (validate, plan, render, up, test, preflight, init, security); an explicit --environment flag always takes precedence, and rendering a saved Plan file still rejects an explicit --environment (a config-derived default is silently ignored there, since the overlay was already baked into the plan)
  • cds use is unchanged / kept as the profile-only convenience command; both now share _read_config/_write_config
  • README updated: new command table row + "Project defaults" section + precedence notes

Testing

  • python -m unittest discover -s tests -p "test_*.py" -v — 561 tests, all pass
  • make lint — passes

Resolves #383

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add cds config command for persisted project defaults (profile, mode/environment, security policy)

2 participants