Skip to content

fix(config): report a clear error for merge-key unset - #2828

Merged
dan-petty merged 1 commit into
mainfrom
fix/2656-devops-config-unset-stops-with-a
Oct 31, 2026
Merged

dan-petty merged 1 commit into
mainfrom
fix/2656-devops-config-unset-stops-with-a

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

Raise a ConfigurationError when devops config unset targets a key that comes from a YAML merge key, instead of stopping with a TypeError traceback.

  • Check whether node.lc.key(dotted) is None in _find in src/devops_cli/config/round_trip.py.
  • Raise ConfigurationError naming the file and the YAML merge key when line position is None.
  • Pass the file name through find to _find so the error message names the target file.
  • Add unit test in tests/test_round_trip.py and integration test in tests/config/test_config_key_removal.py.
  • Verified with fail-to-pass check (devops ci fail-to-pass --base origin/main).

Change: openspec/changes/archive/2026-10-31-2656-devops-config-unset-stops-with-a/
Closes #2656

Raise a ConfigurationError when devops config unset targets a key that comes from a YAML merge key, instead of stopping with a TypeError traceback.

- Check whether node.lc.key(dotted) is None in _find in src/devops_cli/config/round_trip.py.
- Raise ConfigurationError naming the file and the YAML merge key when line position is None.
- Pass the file name through find to _find so the error message names the target file.
- Add unit test in tests/test_round_trip.py and integration test in tests/config/test_config_key_removal.py.
- Verified with fail-to-pass check (devops ci fail-to-pass --base origin/main).

Change: openspec/changes/archive/2026-10-31-2656-devops-config-unset-stops-with-a/
Closes #2656
@dan-petty dan-petty added type/bug Type bug: the code does not do what it must scope/config Settings, OS Keyring, environment variables, and defaults labels Oct 31, 2026
@dan-petty
dan-petty marked this pull request as ready for review October 31, 2026 03:32
@dan-petty
dan-petty merged commit 7514766 into main Oct 31, 2026
19 checks passed
@dan-petty
dan-petty deleted the fix/2656-devops-config-unset-stops-with-a branch October 31, 2026 03:33
dan-petty pushed a commit that referenced this pull request Oct 31, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.25.0](v0.24.0...v0.25.0)
(2026-10-31)


### Features

* **gh:** preview requests in dry run for api, status, secrets
([#2832](#2832))
([9baf3dd](9baf3dd)),
closes [#2237](#2237)
* **gh:** preview requests in dry run for issues, labels, runs
([#2826](#2826))
([c58a50d](c58a50d)),
closes [#2235](#2235)


### Bug Fixes

* **config:** preserve file mode on write and copy
([#2831](#2831))
([8028319](8028319)),
closes [#2745](#2745)
* **config:** report a clear error for merge-key unset
([#2828](#2828))
([7514766](7514766)),
closes [#2656](#2656)

---
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/config Settings, OS Keyring, environment variables, and defaults type/bug Type bug: the code does not do what it must

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(config): devops config unset stops with a TypeError for a key that a YAML merge key gives

1 participant