Repository navigation
fix(config): config set reports an unknown key as unknown, not as a key that needs a value - #2465
Merged
Merged
Conversation
…ey that needs a value `devops config set` checks the key before it asks for a value, reads `--from-file` or loads the settings. A key that names no settings field with a value and no credential exits 1 with `Unknown config key: '<key>'`, the message of `devops config get`, and stores nothing. A second line names the known keys with a similar name, from `difflib.get_close_matches`. `devops config get` prints the same lines for a key that it cannot find. The known keys come from the fields of the `Settings` model and the credential set that `config set` already reads. A section, such as `ai`, holds no value, so `config set` reports it as an unknown key. Closes #2448
dan-petty
marked this pull request as ready for review
October 28, 2026 17:21
dan-petty
pushed a commit
that referenced
this pull request
Oct 28, 2026
🤖 I have created a release *beep* *boop* --- ## [0.10.0](v0.9.0...v0.10.0) (2026-10-28) ### Features * **review:** devops review intake hands the findings of a session on merged code to roadmap intake ([#2455](#2455)) ([a5c7b82](a5c7b82)) * **security:** devops k8s audit runs Popeye in the tool sandbox with a kube-api network profile that only reads the API server ([#2467](#2467)) ([e02c3fb](e02c3fb)) * **security:** the App's installation tokens carry only the permissions the roadmap jobs use ([#2482](#2482)) ([9599ef2](9599ef2)), closes [#2473](#2473) ### Bug Fixes * **config:** a config file that is not valid YAML stops the load with an error that quotes none of its text ([#2468](#2468)) ([91fe5dc](91fe5dc)) * **config:** config set reports an unknown key as unknown, not as a key that needs a value ([#2465](#2465)) ([8b650a6](8b650a6)) * **devcontainer:** run the checkout's devops in devcontainer terminals ([#2460](#2460)) ([abd2d41](abd2d41)) * **k8s:** loki runs from the grafana-community chart on loki 3.7.9, out of reach of CVE-2026-21729 ([#2470](#2470)) ([96c50c9](96c50c9)) * **security:** a credential keyword at the end of a line no longer masks the first word of the next line ([#2461](#2461)) ([b754a73](b754a73)) * **security:** a credential value is masked also when the next line starts with a parenthesis ([#2477](#2477)) ([ece25ca](ece25ca)), closes [#2471](#2471) * **security:** pin kubeconform and replace Checkov with Trivy's misconfiguration scan ([#2464](#2464)) ([960e357](960e357)) * **security:** refuse GCONV_PATH, SHELLOPTS, BASHOPTS and PS4 from a caller, and archive the merged security changes ([#2453](#2453)) ([1f9231d](1f9231d)) ### Code Refactoring * **ai:** chat_structured is the one structured-output path ([#2452](#2452)) ([3509732](3509732)) * **github:** pr check-readiness reads one merge-readiness verdict from github/ ([#2456](#2456)) ([16442c4](16442c4)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.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.
devops config setchecks the key before it asks for a value, reads--from-fileor loads the settings. A key that names no settings field with a value and no credential exits 1 withUnknown config key: '<key>', the message ofdevops config get, and stores nothing. A second line names the known keys with a similar name, from the standard library'sdifflib.get_close_matches, for examplefirecrawl.api_key, ai.api_key, qdrant.api_keyforfirecrawl.apikey.devops config getprints the same lines for a key that it cannot find.Before this change, an unknown key with no VALUE got the message of a known key that is not a credential,
<key> needs a VALUE; only a credential may be typed at a hidden prompt., and exit 2. With a VALUE it gotFailed to set '<key>': Unknown configuration key '<key>'., and with--from-fileit got<key> is not a credentialand exit 2. A person who typed a credential name that the install does not know, such astavily.api_keyafter #2410, read it as "this key is not a credential".The known keys come from the fields of the
Settingsmodel, at any depth, and the credential set_SECRET_FIELDS, whichconfig get,config setanddotted_setalready read (is_config_keyandsimilar_config_keysinsrc/devops_cli/config/settings.py). The change adds no registry, so it stays compatible with #2444. A section, such asai, holds no value, soconfig setreports it as an unknown key. The two messages are insrc/devops_cli/lang/en/messages.py, anddocs/CONFIGURATION.mddescribes the check.Fail-to-pass check run: https://github.com/dan-petty/devops-cli/actions/runs/40733472545/job/122975671355 (4 tests fail on the base tree and 1 test module does not import there).
Closes #2448
Change:
openspec/changes/archive/2026-10-28-2448-config-set-unknown-key/