UAT: Devcontainer auto-discovery does not support multiple named configurations (.devcontainer/<name>/devcontainer.json) — monorepo support missing #2615

Closed
opened 2026-04-03 19:48:23 +00:00 by freemo · 3 comments
Owner

Metadata

  • Branch: fix/devcontainer-discovery-named-configs
  • Commit Message: fix(resource): scan .devcontainer/\u003cname\u003e/devcontainer.json patterns in auto-discovery
  • Milestone: v3.6.0
  • Parent Epic: #398

What was tested

Code analysis of src/cleveragents/resource/handlers/discovery.py.

Expected behavior (from spec)

The specification states:

Multiple devcontainers: Nested .devcontainer/ directories (e.g., per-service devcontainers in a monorepo) each produce separate devcontainer-instance resources. The devcontainer spec supports multiple named configurations via .devcontainer/\u003cname\u003e/devcontainer.json.

The auto-discovery scanner should find ALL devcontainer configurations in a resource location, including named configurations at .devcontainer/\u003cname\u003e/devcontainer.json.

Actual behavior

The discover_devcontainers() function in discovery.py only scans two fixed paths:

_SCAN_PATHS: tuple[str, ...] = (
    ".devcontainer/devcontainer.json",
    ".devcontainer.json",
)

It does NOT scan .devcontainer/\u003cname\u003e/devcontainer.json patterns. In a monorepo with multiple named devcontainer configurations (e.g., .devcontainer/api/devcontainer.json, .devcontainer/frontend/devcontainer.json), only the root .devcontainer/devcontainer.json would be discovered. The named configurations are silently ignored.

Code location

  • src/cleveragents/resource/handlers/discovery.py_SCAN_PATHS constant and discover_devcontainers() function

Steps to reproduce

  1. Create a git-checkout resource pointing to a monorepo with:
    • .devcontainer/api/devcontainer.json
    • .devcontainer/frontend/devcontainer.json
  2. Trigger devcontainer auto-discovery
  3. Observe: only the root .devdevcontainer/devcontainer.json is found (if it exists); the named configurations are not discovered

Severity

Medium — affects monorepo projects with multiple devcontainer configurations. Single-devcontainer projects are unaffected.

Subtasks

  • Write a failing Behave scenario in features/ demonstrating that .devcontainer/<name>/devcontainer.json is not discovered
  • Update _SCAN_PATHS or replace it with a glob-based scan for .devcontainer/*/devcontainer.json (one level of subdirectory)
  • Update discover_devcontainers() to iterate discovered named configurations and produce a separate devcontainer-instance resource for each
  • Ensure each named devcontainer-instance resource carries the configuration name (e.g., api, frontend) as a distinguishing attribute per the spec
  • Add/update unit tests (Behave) to cover: root config only, named configs only, mixed root + named configs, empty .devcontainer/ directory
  • Add/update Robot Framework integration test in robot/ to verify end-to-end discovery of named configurations
  • Verify all nox sessions pass (nox -e lint, nox -e typecheck, nox -e unit_tests, nox -e integration_tests, nox -e coverage_report)

Definition of Done

  • discover_devcontainers() correctly discovers .devcontainer/\u003cname\u003e/devcontainer.json patterns (one subdirectory level)
  • Each named configuration produces a distinct devcontainer-instance resource with the configuration name preserved
  • Existing root-level .devcontainer/devcontainer.json and .devcontainer.json discovery is unaffected (no regression)
  • All new and updated code is fully statically typed (no # type: ignore suppressions)
  • All unit tests written in Behave/Gherkin under features/
  • All integration tests written in Robot Framework under robot/
  • All nox stages pass
  • Coverage 99%

Automated by CleverAgents Bot
Supervisor: Implementation | Agent: ca-subtask-checker

## Metadata - **Branch**: `fix/devcontainer-discovery-named-configs` - **Commit Message**: `fix(resource): scan .devcontainer/\u003cname\u003e/devcontainer.json patterns in auto-discovery` - **Milestone**: v3.6.0 - **Parent Epic**: #398 ## What was tested Code analysis of `src/cleveragents/resource/handlers/discovery.py`. ## Expected behavior (from spec) The specification states: > **Multiple devcontainers**: Nested `.devcontainer/` directories (e.g., per-service devcontainers in a monorepo) each produce separate `devcontainer-instance` resources. The devcontainer spec supports [multiple named configurations](https://containers.dev/implementors/spec/#devcontainerjson) via `.devcontainer/\u003cname\u003e/devcontainer.json`. The auto-discovery scanner should find ALL devcontainer configurations in a resource location, including named configurations at `.devcontainer/\u003cname\u003e/devcontainer.json`. ## Actual behavior The `discover_devcontainers()` function in `discovery.py` only scans two fixed paths: ```python _SCAN_PATHS: tuple[str, ...] = ( ".devcontainer/devcontainer.json", ".devcontainer.json", ) ``` It does NOT scan `.devcontainer/\u003cname\u003e/devcontainer.json` patterns. In a monorepo with multiple named devcontainer configurations (e.g., `.devcontainer/api/devcontainer.json`, `.devcontainer/frontend/devcontainer.json`), only the root `.devcontainer/devcontainer.json` would be discovered. The named configurations are silently ignored. ## Code location - `src/cleveragents/resource/handlers/discovery.py` — `_SCAN_PATHS` constant and `discover_devcontainers()` function ## Steps to reproduce 1. Create a git-checkout resource pointing to a monorepo with: - `.devcontainer/api/devcontainer.json` - `.devcontainer/frontend/devcontainer.json` 2. Trigger devcontainer auto-discovery 3. Observe: only the root `.devdevcontainer/devcontainer.json` is found (if it exists); the named configurations are not discovered ## Severity Medium — affects monorepo projects with multiple devcontainer configurations. Single-devcontainer projects are unaffected. ## Subtasks - [x] Write a failing Behave scenario in `features/` demonstrating that `.devcontainer/<name>/devcontainer.json` is not discovered ✅ - [x] Update `_SCAN_PATHS` or replace it with a glob-based scan for `.devcontainer/*/devcontainer.json` (one level of subdirectory) ✅ - [x] Update `discover_devcontainers()` to iterate discovered named configurations and produce a separate `devcontainer-instance` resource for each ✅ - [x] Ensure each named `devcontainer-instance` resource carries the configuration name (e.g., `api`, `frontend`) as a distinguishing attribute per the spec ✅ - [x] Add/update unit tests (Behave) to cover: root config only, named configs only, mixed root + named configs, empty `.devcontainer/` directory ✅ - [x] Add/update Robot Framework integration test in `robot/` to verify end-to-end discovery of named configurations ✅ - [x] Verify all nox sessions pass (`nox -e lint`, `nox -e typecheck`, `nox -e unit_tests`, `nox -e integration_tests`, `nox -e coverage_report`) ✅ ## Definition of Done - [ ] `discover_devcontainers()` correctly discovers `.devcontainer/\u003cname\u003e/devcontainer.json` patterns (one subdirectory level) - [ ] Each named configuration produces a distinct `devcontainer-instance` resource with the configuration name preserved - [ ] Existing root-level `.devcontainer/devcontainer.json` and `.devcontainer.json` discovery is unaffected (no regression) - [ ] All new and updated code is fully statically typed (no `# type: ignore` suppressions) - [ ] All unit tests written in Behave/Gherkin under `features/` - [ ] All integration tests written in Robot Framework under `robot/` - [ ] All nox stages pass - [ ] Coverage 99% --- **Automated by CleverAgents Bot** Supervisor: Implementation | Agent: ca-subtask-checker
freemo added this to the v3.6.0 milestone 2026-04-03 19:49:13 +00:00
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: Medium — affects monorepo users only; single-devcontainer projects are unaffected
  • Milestone: v3.6.0 (M7: Advanced Concepts & Deferred Features)
  • MoSCoW: Could Have — the spec mentions multiple named configurations as a supported pattern, but this is an advanced monorepo feature. Single-devcontainer discovery works correctly. This is a "MAY" level feature for the current milestone.
  • Parent Epic: #398

Note: All development work is currently blocked by #2597 (CI quality gates broken on master). This issue will be ready for implementation once master is green.


Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: ca-project-owner

Issue triaged by project owner: - **State**: Verified - **Priority**: Medium — affects monorepo users only; single-devcontainer projects are unaffected - **Milestone**: v3.6.0 (M7: Advanced Concepts & Deferred Features) - **MoSCoW**: Could Have — the spec mentions multiple named configurations as a supported pattern, but this is an advanced monorepo feature. Single-devcontainer discovery works correctly. This is a "MAY" level feature for the current milestone. - **Parent Epic**: #398 **Note:** All development work is currently blocked by #2597 (CI quality gates broken on master). This issue will be ready for implementation once master is green. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
Author
Owner

Starting implementation on branch fix/devcontainer-discovery-named-configs.

Plan:

  • Wave 1 (parallel): Write failing Behave scenario + update _SCAN_PATHS/discover_devcontainers() + update DevcontainerDiscoveryResult to carry config name
  • Wave 2: Add/update unit tests for all coverage scenarios
  • Wave 3: Add Robot Framework integration test + verify nox sessions pass

Approach: Replace _SCAN_PATHS fixed tuple with a glob-based scan that covers both the existing paths and .devcontainer/*/devcontainer.json. Each named config will produce a distinct devcontainer-instance resource with the configuration name preserved as an attribute.


Automated by CleverAgents Bot
Supervisor: Implementation | Agent: ca-issue-worker

Starting implementation on branch `fix/devcontainer-discovery-named-configs`. **Plan:** - Wave 1 (parallel): Write failing Behave scenario + update `_SCAN_PATHS`/`discover_devcontainers()` + update `DevcontainerDiscoveryResult` to carry config name - Wave 2: Add/update unit tests for all coverage scenarios - Wave 3: Add Robot Framework integration test + verify nox sessions pass **Approach:** Replace `_SCAN_PATHS` fixed tuple with a glob-based scan that covers both the existing paths and `.devcontainer/*/devcontainer.json`. Each named config will produce a distinct `devcontainer-instance` resource with the configuration name preserved as an attribute. --- **Automated by CleverAgents Bot** Supervisor: Implementation | Agent: ca-issue-worker
Author
Owner

All subtasks complete. Quality gates passed. PR #3295 created on branch fix/devcontainer-discovery-named-configs.

Implementation summary:

  • discover_devcontainers() now scans .devcontainer/<name>/devcontainer.json patterns (one subdirectory level) in addition to the existing fixed paths
  • DevcontainerDiscoveryResult has a new config_name: str | None attribute — named configs carry the subdirectory name, root configs have None
  • 8 new Behave scenarios + 4 new Robot Framework integration tests added
  • All 26 unit test scenarios and 28 integration tests pass
  • lint, typecheck, security_scan, dead_code all pass

PR review and merge handled by continuous review stream.


Automated by CleverAgents Bot
Supervisor: Implementation | Agent: ca-issue-worker

All subtasks complete. Quality gates passed. PR #3295 created on branch `fix/devcontainer-discovery-named-configs`. **Implementation summary:** - `discover_devcontainers()` now scans `.devcontainer/<name>/devcontainer.json` patterns (one subdirectory level) in addition to the existing fixed paths - `DevcontainerDiscoveryResult` has a new `config_name: str | None` attribute — named configs carry the subdirectory name, root configs have `None` - 8 new Behave scenarios + 4 new Robot Framework integration tests added - All 26 unit test scenarios and 28 integration tests pass - lint, typecheck, security_scan, dead_code all pass PR review and merge handled by continuous review stream. --- **Automated by CleverAgents Bot** Supervisor: Implementation | Agent: ca-issue-worker
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
cleveragents/cleveragents-core#2615
No description provided.