Add ddev AI config block#23855
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files🚀 New features to boost your workflow:
|
a2c4292 to
caf0728
Compare
f319783 to
7dab3f7
Compare
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
b73d41f to
8ddec69
Compare
Validation ReportAll 21 validations passed. Show details
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8ddec6947b
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if self._field_flow_dirs is FIELD_TO_PARSE: | ||
| if 'flow_dirs' in self.raw_data: | ||
| flow_dirs = self.raw_data['flow_dirs'] | ||
| if not isinstance(flow_dirs, list): |
There was a problem hiding this comment.
Accept tomlkit arrays for flow_dirs
When flow_dirs comes from an actual config file, load_toml_data() parses it with tomlkit.loads(), so the value is a tomlkit.items.Array rather than a built-in list. This check therefore rejects a valid TOML entry such as the default flow_dirs = []; for example ddev config set ... calls RootConfig(config).parse_fields() during validation and will abort with ai -> flow_dirs must be an array after loading the restored config. Please unwrap/normalize TOML arrays or accept the sequence type tomlkit returns here.
Useful? React with 👍 / 👎.
What does this PR do?
Adds an
aiblock to the ddev root configuration model with support for an Anthropic API key and configurable flow directories. The Anthropic key can come from config or fromDD_ANTHROPIC_API_KEY/ANTHROPIC_API_KEY, and config scrubbing now redactsai.anthropic_api_key.Motivation
This gives ddev a structured place to store AI-related configuration while keeping API keys out of scrubbed config output.
Validated with:
ddev --no-interactive test ddev -- -k TestAIddev test -fs ddevReview checklist (to be filled by reviewers)
qa/requiredif this PR needs QA validation, orqa/skip-qaif it does not. Exactly one of the two is required.backport/<branch-name>label to the PR and it will automatically open a backport PR once this one is merged