fix(cli): accept any --config / --override-config filename (#65)#76
Merged
Conversation
Upstream @devcontainers/cli treats --config and --override-config as plain paths and does not enforce a filename allow-list. Deacon's three validators (read_configuration, shared/config_loader, build/BuildRequest) rejected anything outside devcontainer.json/.devcontainer.json(c), which prevented a handful of spec-coverage examples from passing an alternate filename to --config when they had a legitimate reason to (cycle test fixtures, gpu-true.json, override.onCreate.json, etc.). Drop all three validators. The loader still surfaces a file-not-found error if the path is bogus. The two SPEC.md files (up, build) that encoded the legacy gate are updated to match the upstream contract. Tests: - test_read_configuration_arbitrary_config_filename_accepted - test_read_configuration_arbitrary_override_filename_accepted - test_build_request_accepts_any_config_filename (replaces the symmetric "rejected" assertion the old behavior had) Closes #65. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.
Summary
--configand--override-config. Upstream@devcontainers/clitreats both as plain paths; deacon now matches.read_configuration::validate_config_filename,shared::config_loaderinline check, and theBuildRequest::validatefilename branch.up/SPEC.mdandcompleted-specs/build/SPEC.mdno longer state the filename gate.The loader still surfaces a file-not-found error if the path is bogus. Existing canonical filenames (
devcontainer.json,.devcontainer.json,.jsoncvariants) keep working.Closes #65. Unblocks
configuration/extends-chain-cycleanddoctor/gpu-host-requirementsexample scenarios per #74.Test plan
make test-nextest-fast(2089 passing)cargo fmt --all -- --checkcargo clippy --all-targets -- -D warningstest_read_configuration_arbitrary_config_filename_acceptedtest_read_configuration_arbitrary_override_filename_acceptedtest_build_request_accepts_any_config_filename(replaces the inverse assertion)🤖 Generated with Claude Code