Repository navigation
Description
Problem Description
valkey.url has the default valkey://localhost:6379/0 (DEFAULT_VALKEY_URL in src/devops_cli/config/defaults.py:748, used by ValkeyConfig.url and ValkeyConfig.endpoint in src/devops_cli/config/settings.py). When a configuration file sets no URL, each cache client dials the loopback address. In the devcontainer no Valkey listens there, so each call fails, the circuit breaker opens, and each later call counts one error with the label error="open".
The owner rule of #1165 says that a client never falls back to an unconfigured service URL. This default is a fallback of that kind.
Evidence
Prometheus, 24 hours to 2026-11-27 15:40 UTC, sum by (job,error) (increase(devops_cli_valkey_cache_errors_total[24h])):
job="devops-cli",error="open": about 403,000.job="devops-cli",error="connection": about 535.- No other series. All of these come from one instance, the devcontainer, through the operations
get,hgetandset.
The roadmap Jobs and the Service have a configured URL and count no error in the same window. So the local default makes almost all of the series, which hides a real error of a cluster client.
Expected Behavior
With no valkey.url, the shared cache tier is off: the client makes no connection and counts no error, and the command works from its local tier as it does when the circuit is open. A command that needs Valkey (such as devops valkey) fails with an error that names valkey.url. The setting valkey.url has no default value.
Acceptance Criteria
- With
valkey.urlunset, a cache read and a cache write make no connection and add nothing todevops_cli_valkey_cache_errors_total. - With
valkey.urlunset,devops valkeyfails with an error that namesvalkey.url. -
DEFAULT_VALKEY_URLis gone, and the generated configuration documents show no default forvalkey.url.
Related
- fix(config): service clients use only configured urls and never fall back to an unconfigured localhost default #1165 (the owner rule and the first cleanup).
loki.urlkeeps a loopback default too (LokiConfig.urlinsrc/devops_cli/config/settings.py); a separate item can cover it.
Alternatives check of 2026-11-27: none.
Tool: none found.
Reason: Searches surfaced only general-purpose cache libraries (cashews, aiocache, diskcache) and unrelated docs; none removes a project's own default service URL, so the fix stays in this repo's settings and metrics.
Lacks:
- No library deletes a project's own DEFAULT_VALKEY_URL constant
- No optional remote tier that stays off when the URL is unset
- No guard that stops cache error counters while unconfigured
- No config schema that documents valkey.url without a default
Proposed design
Problem statement
The Valkey settings fall back to valkey://localhost:6379/0 when valkey.url is unset. In the devcontainer no Valkey listens there, so each cache call fails, the circuit opens, and devops_cli_valkey_cache_errors_total counts about 403,000 error="open" events in 24 hours. This hides real cluster errors. The change removes the default, keeps the remote cache tier off when the URL is unset, and makes devops valkey fail with an error that names valkey.url.
Acceptance criteria
Requirement: Unset URL disables the remote cache tier
When valkey.url is unset, the cache client MUST make no remote connection and MUST not increment devops_cli_valkey_cache_errors_total.
Scenario: Read and write with no URL
- WHEN a test builds the cache client with
valkey.urlunset and callsgetandset - THEN the client makes no remote connection and the error counter value stays the same
Requirement: Unset URL keeps the local cache tier
When valkey.url is unset, the cache MUST serve reads and writes from its local tier.
Scenario: Local round trip with no URL
- WHEN a test writes a value and reads it back through the cache with
valkey.urlunset - THEN both calls succeed from the local tier and no remote call is made
Requirement: devops valkey requires a URL
The devops valkey command MUST fail with an error that names valkey.url when the setting is unset.
Scenario: Valkey command with no URL
- WHEN a test invokes
devops valkeywithvalkey.urlunset - THEN the command exits non-zero and its error text contains
valkey.url
Requirement: The endpoint accessor refuses an unset URL
ValkeyConfig.endpoint MUST raise ConfigurationError naming valkey.url when the URL is unset or empty.
Scenario: Endpoint with no URL
- WHEN a test reads
endpointfromValkeyConfig()with novalkey.url - THEN the call raises
ConfigurationErrorand the message containsvalkey.url
Requirement: The default Valkey URL constant is removed
The configuration package MUST NOT define DEFAULT_VALKEY_URL.
Scenario: Default constant is absent
- WHEN a test imports
devops_cli.config.defaults - THEN the module has no attribute
DEFAULT_VALKEY_URL
Requirement: Valkey URL defaults to unset
ValkeyConfig.url MUST default to None.
Scenario: Settings with no URL
- WHEN a test builds
ValkeyConfig()with novalkey.url - THEN the
urlfield isNoneand the model field default isNone
Requirement: Configuration reference shows no Valkey default
The generated configuration reference MUST show valkey.url without a default value.
Scenario: Configuration reference rendering
- WHEN a test renders the configuration reference for
ValkeyConfig - THEN the
valkey.urlentry has no default value
Existing Tool Considered
The alternatives check in the issue body has verdict none and names no tool. It considered cashews, aiocache and diskcache, and none covers the need. The change is a small in-repo edit: remove DEFAULT_VALKEY_URL, default valkey.url to None, and skip the remote cache tier when it is unset. Cost: about 2,000 to 4,000 tokens to write, keep and fix, and less than one hour of elapsed work. It adds no dependency.
Key questions
- What should
ValkeyConfig.urldo when no configuration file sets a URL?: It should default toNone. Theendpointproperty should raiseConfigurationErrornamingvalkey.urlwhen the value is unset or empty. (best practice) [sources: src/devops_cli/config/settings.py, src/devops_cli/config/defaults.py:748]- Rejected: Keep
DEFAULT_VALKEY_URL. It makes each client dial loopback in the devcontainer, opens the circuit and hides real errors. It breaks the owner rule of fix(config): service clients use only configured urls and never fall back to an unconfigured localhost default #1165. - Chosen: Default to
Noneand raise inendpoint. It removes the fallback and givesdevops valkeyan error that names the setting. - Rejected: Default to
Noneand return no endpoint. Thedevops valkeycommand must fail with a clear error, not a silent no-op.
- Rejected: Keep
- How should the cache client act when
valkey.urlis unset?: It should skip the remote tier, serve reads and writes from the local tier, open no connection and add no cache error sample. (best practice) [sources: src/devops_cli/valkey/cache.py, src/devops_cli/telemetry/instruments.py, src/devops_cli/valkey/client.py]- Rejected: Dial
valkey://localhost:6379/0. No Valkey listens in the devcontainer. Each call fails, the circuit opens and the error counter hides real errors. - Rejected: Fail each cache operation. Commands should work from the local tier as they do when the circuit is open.
- Chosen: Skip the remote tier and use the local tier. It meets the expected behavior and stops the false
error="open"series.
- Rejected: Dial
- Where should the error for an unset
valkey.urlcome from?:ValkeyConfig.endpointis the shared accessor that parses the URL. It already takes the setting namevalkey.urlfor its error. [sources: src/devops_cli/config/settings.py] - Which component increments
devops_cli_valkey_cache_errors_total?: The counter is defined insrc/devops_cli/telemetry/instruments.py. The Valkey cache client and the shared listing store increment it. [sources: src/devops_cli/telemetry/instruments.py, src/devops_cli/valkey/cache.py, src/devops_cli/roadmap/stores/listing_shared.py]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 27, 2026
The default URL causes about 403,000 errors per day and hides real cluster-client errors in metrics.Both deal with fail-soft Valkey client behaviour when the service is unavailable, but #1992 shares one client with a short timeout while the candidate removes the default URL so no connection is attempted at all.devops-cli-service commentedon Nov 27, 2026
The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.
Searches (7)
Tools considered:
Searches run:
Sources:
devops-cli-service commentedon Nov 27, 2026
Next step: the stage job writes the plan of the item. See the section Proposed design of the body.
devops-cli-service commentedon Nov 28, 2026
Released in v0.232.5: https://github.com/dan-petty/devops-cli/releases/tag/v0.232.5
devops-cli-service commentedon Nov 28, 2026
Live since 2026-11-28 06:56 UTC