Skip to content

fix(cli): accept any --config / --override-config filename (#65)#76

Merged
pofallon merged 1 commit into
mainfrom
fix/65-cli-filename-validation
May 28, 2026
Merged

fix(cli): accept any --config / --override-config filename (#65)#76
pofallon merged 1 commit into
mainfrom
fix/65-cli-filename-validation

Conversation

@pofallon
Copy link
Copy Markdown
Contributor

Summary

  • Drop the deacon-specific filename allow-list on --config and --override-config. Upstream @devcontainers/cli treats both as plain paths; deacon now matches.
  • Three validators removed: read_configuration::validate_config_filename, shared::config_loader inline check, and the BuildRequest::validate filename branch.
  • SPEC.md updates: up/SPEC.md and completed-specs/build/SPEC.md no 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, .jsonc variants) keep working.

Closes #65. Unblocks configuration/extends-chain-cycle and doctor/gpu-host-requirements example scenarios per #74.

Test plan

  • make test-nextest-fast (2089 passing)
  • cargo fmt --all -- --check
  • cargo clippy --all-targets -- -D warnings
  • New unit tests:
    • test_read_configuration_arbitrary_config_filename_accepted
    • test_read_configuration_arbitrary_override_filename_accepted
    • test_build_request_accepts_any_config_filename (replaces the inverse assertion)

🤖 Generated with Claude Code

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>
@github-actions github-actions Bot added the docs Documentation changes label May 28, 2026
@pofallon pofallon merged commit d127019 into main May 28, 2026
10 checks passed
@pofallon pofallon deleted the fix/65-cli-filename-validation branch May 28, 2026 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI over-validates --config / --override-config filenames

1 participant