Repository navigation
refactor(config): each setting declares its variable on its settings field, and the option, variable and secret registries are derived from it - #2466
Merged
Conversation
Owner
Author
|
Test evidence:
Pending a person: review the diff in tuicr ( |
dan-petty
marked this pull request as ready for review
October 28, 2026 17:21
…field Six hand-written registries described the settings and disagreed: the key constants and secret maps in `config/options.py`, the variable map and the 79 hand-written specs in `config/env.py`, the credential table in `security/secrets.py`, the keyring names in `k8s/cluster_secrets.py`, `_CHILD_DATA_ENV_MAP`, and the 29 rows of `devops config show`. `devops config env` and `docs/ENV_VARS.md` missed 13 variables that devops-cli reads. A settings field now declares that a variable sets it with a `Variable` marker and its description with `Field(description=...)`. The variable is `DEVOPS_CLI_` and the dotted key in upper case; `ai.tasks` declares the segment `TASK`, so the task variables keep their names. A credential is one entry of `CREDENTIALS`. Every list of settings, variables and keyring entries is derived from these two declarations, and the registries are deleted. `devops config show` prints every declared setting and credential, and has `--format` and `--json`. The 10 options that code reads and that had no variable get one by the rule.
dan-petty
force-pushed
the
refactor/2444-settings-field-declaration
branch
from
October 28, 2026 18:21
33fd0cd to
1088670
Compare
dan-petty
pushed a commit
that referenced
this pull request
Oct 28, 2026
🤖 I have created a release *beep* *boop* --- ## [0.10.1](v0.10.0...v0.10.1) (2026-10-28) ### Bug Fixes * **ai:** a reply names its server by the origin of the URL called, so a password in an AI URL stays out of every record ([#2488](#2488)) ([3ec083f](3ec083f)), closes [#1110](#1110) * **ai:** the AI service clients dial through the egress-checked factory and check the address at the connect ([#2484](#2484)) ([08d70ca](08d70ca)) ### Code Refactoring * **config:** each setting declares its variable on its settings field, and the option, variable and secret registries are derived from it ([#2466](#2466)) ([daaffc6](daaffc6)) --- 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>
11 tasks
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.
Six hand-written registries described the settings, and they disagreed: the key constants, the secret set and the keyring map in
config/options.py; the variable map and the 79 hand-written specs inconfig/env.py; the credential table insecurity/secrets.py; the keyring names ink8s/cluster_secrets.py;_CHILD_DATA_ENV_MAPinconfig/settings.py; and the 29 rows ofdevops config show.devops config envanddocs/ENV_VARS.mddid not show 13 variables that devops-cli reads, and 13 options read no variable.This is part 1 of #1000. Each setting is now declared once:
Variablemarker inAnnotatedmetadata, and its description withField(description=...). The variable isDEVOPS_CLI_and the dotted key in upper case, with_for.. Thetasksfield ofaideclares the segmentTASK, so the 17 task variables keep their names. Each task field ofai.tasksnames the fields of the shared task model that a variable sets.CREDENTIALSinconfig/env.py: its key, description, other variables, whether the config file may hold it, and its keyring name when that is not the key with_for..setting_variables(),option_env_vars(),env_var_for_option(),secret_keys(),keyring_names()andget_all_env_var_specs()derive every list. The env overrides, the data directory variables,build_secret_registry(),KeyringSource.for_credential(), thedevops configcommands, the docs generator and the workspace route read them.config/options.py, theENV_*constants of settings,OPTION_TO_ENV_VAR,ENV_VAR_TO_OPTION, the spec list,_CHILD_DATA_ENV_MAPand the_rowlines are deleted. Code names a setting by its dotted key.What a person sees:
devops config showprints every setting that a variable sets and every credential, sorted by key, and has--formatand--json. A credential shows as set or not set.devops config envanddocs/ENV_VARS.mdlist the 7 setting variables and the 6 credential variables that they missed.ai.reference_model,ai.reference_embedding_model,ai.reference_provider,ai.hardware_cost_usd,telemetry.capture_llm_content,sandbox.exclude_home_dir,cloudflare.public_ip_bypassandcloudflare.access.allowed_emails,bypass_ipsandpublic_ip_bypass. No file in the repository sets one of these names. The 3 options that no code reads get none (fix(config): telemetry.logfire, cloudflare.access.enabled and cloudflare.access.idp are settings that no code reads #2457).tests/test_config_declarations.pyholds the set of variables, the keyring names and the secret keys to their values before the change, with the 10 added variables.Closes #2444
Change:
openspec/changes/archive/2026-10-28-2444-settings-field-declaration/