Skip to content

Add ddev AI config block#23855

Open
lucia-sb wants to merge 3 commits into
loa/openmetrics-ai-genfrom
lucia-sb/ai-config-block
Open

Add ddev AI config block#23855
lucia-sb wants to merge 3 commits into
loa/openmetrics-ai-genfrom
lucia-sb/ai-config-block

Conversation

@lucia-sb
Copy link
Copy Markdown
Contributor

What does this PR do?

Adds an ai block 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 from DD_ANTHROPIC_API_KEY / ANTHROPIC_API_KEY, and config scrubbing now redacts ai.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 TestAI
  • ddev test -fs ddev

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Add qa/required if this PR needs QA validation, or qa/skip-qa if it does not. Exactly one of the two is required.
  • If you need to backport this PR to another branch, you can add the backport/<branch-name> label to the PR and it will automatically open a backport PR once this one is merged

@dd-octo-sts dd-octo-sts Bot added the ddev label May 28, 2026
@datadog-datadog-prod-us1-2
Copy link
Copy Markdown

datadog-datadog-prod-us1-2 Bot commented May 28, 2026

Pipelines  Tests  Code Coverage

Fix all issues with BitsAI

⚠️ Warnings

🚦 13 Pipeline jobs failed

PR | test / test (linux, ubuntu-22.04, ddev, ddev on Linux) / ddev on Linux   View in Datadog   GitHub Actions

🔧 Fix in code (Fix with Cursor). TypeError: Phase.__init__() got an unexpected keyword argument 'checkpoint_manager' in multiple tests in test_inspect_endpoint.py

PR | test / test (windows, windows-2022, ddev, ddev on Windows) / ddev on Windows   View in Datadog   GitHub Actions

🔧 Fix in code (Fix with Cursor). TypeError: Phase.__init__() got an unexpected keyword argument 'checkpoint_manager' at D:\a\integrations-core\integrations-core\ddev\tests\ai\flows\openmetrics\phases\test_inspect_endpoint.py:108

PR | test / test-minimum-base-package (linux, ubuntu-22.04, ddev, ddev on Linux) / minimum-base-package-ddev on Linux   View in Datadog   GitHub Actions

🔧 Fix in code (Fix with Cursor). 25 tests failed due to TypeError: Phase.__init__() got an unexpected keyword argument 'checkpoint_manager'.

View all 13 failed jobs.

🧪 20 Tests failed in 1 job

PR All | run   GitHub Actions

test_bulk_table from test_check.py   View in Datadog (Fix with Cursor)
HTTPSConnectionPool(host=&#39;ddintegrations.blob.core.windows.net&#39;, port=443): Max retries exceeded with url: /snmp/cisco-3850.snmprec (Caused by NameResolutionError(&#34;HTTPSConnection(host=&#39;ddintegrations.blob.core.windows.net&#39;, port=443): Failed to resolve &#39;ddintegrations.blob.core.windows.net&#39; ([Errno -2] Name or service not known)&#34;))
test_cast_metrics from test_check.py   View in Datadog (Fix with Cursor)
HTTPSConnectionPool(host=&#39;ddintegrations.blob.core.windows.net&#39;, port=443): Max retries exceeded with url: /snmp/cisco-3850.snmprec (Caused by NameResolutionError(&#34;HTTPSConnection(host=&#39;ddintegrations.blob.core.windows.net&#39;, port=443): Failed to resolve &#39;ddintegrations.blob.core.windows.net&#39; ([Errno -2] Name or service not known)&#34;))

View all 20 test failures

ℹ️ Info

No other issues found (see more)

❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 88.07%

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 8ddec69 | Docs | Datadog PR Page | Give us feedback!

@lucia-sb lucia-sb added the qa/skip-qa Automatically skip this PR for the next QA label May 28, 2026 — with ChatGPT Codex Connector
@codecov
Copy link
Copy Markdown

codecov Bot commented May 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.94%. Comparing base (9e89c6f) to head (a2c4292).
⚠️ Report is 11 commits behind head on master.

Additional details and impacted files
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lucia-sb lucia-sb changed the base branch from master to loa/goal-task May 28, 2026 09:14
@lucia-sb lucia-sb changed the base branch from loa/goal-task to master May 28, 2026 09:14
@lucia-sb lucia-sb force-pushed the lucia-sb/ai-config-block branch from a2c4292 to caf0728 Compare June 1, 2026 07:58
@lucia-sb lucia-sb changed the base branch from master to loa/openmetrics-ai-gen June 1, 2026 07:58
@luisorofino luisorofino force-pushed the loa/openmetrics-ai-gen branch from f319783 to 7dab3f7 Compare June 1, 2026 09:06
@lucia-sb lucia-sb force-pushed the lucia-sb/ai-config-block branch from b73d41f to 8ddec69 Compare June 1, 2026 10:49
@lucia-sb lucia-sb marked this pull request as ready for review June 1, 2026 10:49
@lucia-sb lucia-sb requested a review from a team as a code owner June 1, 2026 10:49
@dd-octo-sts
Copy link
Copy Markdown
Contributor

dd-octo-sts Bot commented Jun 1, 2026

Validation Report

All 21 validations passed.

Show details
Validation Description Status
agent-reqs Verify check versions match the Agent requirements file
ci Validate CI configuration and code coverage settings
codeowners Validate every integration has a CODEOWNERS entry
config Validate default configuration files against spec.yaml
dep Verify dependency pins are consistent and Agent-compatible
http Validate integrations use the HTTP wrapper correctly
imports Validate check imports do not use deprecated modules
integration-style Validate check code style conventions
jmx-metrics Validate JMX metrics definition files and config
labeler Validate PR labeler config matches integration directories
legacy-signature Validate no integration uses the legacy Agent check signature
license-headers Validate Python files have proper license headers
licenses Validate third-party license attribution list
metadata Validate metadata.csv metric definitions
models Validate configuration data models match spec.yaml
openmetrics Validate OpenMetrics integrations disable the metric limit
package Validate Python package metadata and naming
qa-label Validate the pull request declares whether it needs QA for the next Agent release
readmes Validate README files have required sections
saved-views Validate saved view JSON file structure and fields
version Validate version consistency between package and changelog

View full run

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 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):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

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

Labels

ddev qa/skip-qa Automatically skip this PR for the next QA team/agent-integrations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant