fix(agent/agentcontainers): discover devcontainer configs in .devcontainer subfolders#26365
Draft
schnell3526 wants to merge 1 commit into
Draft
fix(agent/agentcontainers): discover devcontainer configs in .devcontainer subfolders#26365schnell3526 wants to merge 1 commit into
schnell3526 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Project discovery only matched the
.devcontainer/devcontainer.jsonand.devcontainer.jsonpath suffixes, so configurations in sub-folders (.devcontainer/<folder>/devcontainer.json), which both the dev container spec and Coder's documentation list as a supported location for monorepos, were never discovered and never appeared as dev container cards in the dashboard.Extend the matching in
discoverDevcontainersInProjectto also accept configurations one level deep inside the.devcontainerdirectory. SinceknownDevcontainersis keyed by workspace folder and can only represent one configuration per project, configurations are now collected during the walk and the highest precedence one wins:.devcontainer/devcontainer.json, then.devcontainer.json, then sub-folder configurations (ties broken by walk order). A warning is logged when a configuration is ignored. This also makes the choice between the two conventional locations deterministic and spec-aligned; previously it depended on lexical walk order, which preferred.devcontainer.json.Properly representing multiple configurations per project (multiple cards per repo, distinct sub-agent names) requires reworking the workspace folder keying and is left as a follow-up, see the discussion in the issue.
Closes #26363