From 292e6a26b3d81748035d0081c162eb1ff2bd4e14 Mon Sep 17 00:00:00 2001 From: Juanpe Araque Date: Wed, 1 Jul 2026 10:15:32 +0200 Subject: [PATCH] Document ddev worktree override and running lint through ddev (#24201) --- AGENTS.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/AGENTS.md b/AGENTS.md index ed2bcbc2b45fb..3cb6d78b33000 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -71,6 +71,23 @@ ddev -x validate config -s ddev -x validate models -s ``` +## Worktrees + +When working in a git worktree (anything other than the primary checkout), run `ddev config override` as the first step after entering the directory. This writes a gitignored `.ddev.toml` that points the `core` repo at the current worktree. + +Without this override, `ddev` resolves `core` to whatever the global configuration points at, which is usually a different worktree. Every `ddev test`, `ddev test --lint`, and `ddev env` command would then run against the wrong checkout and produce misleading results. + +Verify the override took effect with `ddev config show`: the `[repos]` `core` entry should point at the current directory and be marked as an override. + +If `ddev config override` cannot write the file in your environment, create `.ddev.toml` by hand at the worktree root: + +```toml +repo = "core" + +[repos] +core = "" +``` + ## Testing Run unit and integration tests with `ddev --no-interactive test `. For example, for the pgbouncer integration, run `ddev --no-interactive test pgbouncer`. @@ -129,6 +146,8 @@ For E2E tests, `--recreate` performs `docker compose down --volumes` followed by Format code with `ddev test -fs `. For example, for the pgbouncer integration, run `ddev test -fs pgbouncer`. +Always run linting and formatting through `ddev`: use `ddev test -fs ` to fix issues and `ddev test --lint ` (or `-s`) to check them. Do not invoke `ruff`, `black`, or `mypy` directly. CI runs them inside `ddev`'s pinned hatch lint environment, and a different locally installed version can report different results, passing locally while failing CI or the other way around. + ## Changelog Management Changelog entries are required for any change to a file that is shipped with the Agent. This includes Python sources under `datadog_checks/`, `pyproject.toml`, and the integration's `conf.yaml.example`. Changes limited to tests, fixtures, or developer-only assets do not need a changelog entry.