Repository navigation
Description
Problem Description
When a push has no value for a key of a managed credential, devops k8s push-secrets names the store command devops config set <option> (_store_hint, src/devops_cli/k8s/secret_push.py). For a multi-line credential, such as a PEM key or an OpenSSH private key, that command with no --from-file reads the value at a hidden prompt (typer.prompt(..., hide_input=True) in _value_or_prompt, src/devops_cli/commands/config.py), which reads one line. So a person who follows the hint stores only the first line of the key. The credentials of this form are service.github_app.private_key, renovate.github_app_private_key, argocd.github_app_private_key and infra.ssh_private_key (#7428).
Reproduction Steps
- Run
uv run devops k8s push-secrets --plan --only devops/infra-ssh-keywith no keyring valueinfra_ssh_private_keyand no live Secret (after fix(infra): push-secrets has no row for the infra-drift SSH key #7428). - Read the warning:
store it with devops config set infra.ssh_private_key.
Expected vs Actual Behavior
Expected: for a multi-line credential, the hint names devops config set <option> --from-file <key-file>, as k8s/README.md (Cluster Secrets) does.
Actual: the hint names devops config set <option>, whose hidden prompt takes one line.
Environment Diagnostics
devops-cli 0.226.0, read in the source of main on 2026-11-27.
Logs, Traces, or Terminal Output
devops/infra-ssh-key id_ed25519: keyring infra_ssh_private_key is empty and devops/infra-ssh-key id_ed25519 holds no value; store it with devops config set infra.ssh_private_key
Source
Source: #7434
Alternatives check of 2026-11-27: none.
Tool: none found.
Reason: Searches found only unrelated documentation pages and no tool or library for this. The need is an internal change to the hint text that _store_hint prints, so no external tool covers it.
Lacks:
- A hint naming
--from-filefor multi-line credentials - A per-option flag that marks a value as multi-line
- Store commands that accept a key file instead of a hidden one-line prompt
Proposed design
Problem statement
The push hint for an empty keyring credential always names devops config set <option>. That command reads one line at a hidden prompt. A person who follows the hint for a multi-line private key stores only the first line. The fix makes the hint name --from-file <key-file> for the four multi-line credentials. It keeps the current hint for single-line credentials.
Acceptance criteria
Requirement: Multi-line source hint
_store_hint SHALL append --from-file <key-file> to the store hint of a keyring source whose multi_line flag is true.
Scenario: Multi-line keyring source
- WHEN a test calls
_store_hintwith aKeyringSourceforinfra.ssh_private_keyandmulti_line=True - THEN the returned string is "; store it with
devops config set infra.ssh_private_key --from-file <key-file>"
Requirement: Single-line source hint
_store_hint MUST keep the store hint of a keyring source whose multi_line flag is false unchanged.
Scenario: Single-line keyring source
- WHEN a test calls
_store_hintwith aKeyringSourceforexample.tokenandmulti_line=False - THEN the returned string is "; store it with
devops config set example.token"
Requirement: Private-key rows marked multi-line
The cluster Secret table MUST set multi_line=True on the KeyringSource of each of the four private-key credentials.
Scenario: Private-key source flags
- WHEN a test reads
CLUSTER_SECRETSand collects theKeyringSourcerows forservice.github_app.private_key,renovate.github_app_private_key,argocd.github_app_private_keyandinfra.ssh_private_key - THEN each collected source has
multi_lineset toTrue
Requirement: Missing private-key message
The missing-value message for a multi-line keyring credential MUST include the file-based store hint.
Scenario: Missing infra SSH key
- WHEN a test calls
_missing_hintfor theinfra.ssh_private_keyentry with an empty keyring and no live Secret - THEN the message contains "; store it with
devops config set infra.ssh_private_key --from-file <key-file>"
Existing Tool Considered
The alternatives check in the issue body records the verdict none and Tool: none found; no open, maintained tool or library covers this internal hint text. The proposal adds the multi_line flag and the file hint. devops config set already accepts a key file. The written cost is about 400 tokens and under one hour to build and test; the code has no ongoing fix cost.
Key questions
- Why does the current hint store only the first line of a private key?:
_value_or_promptreads a value withtyper.prompt(..., hide_input=True), which returns one line.set_valuealready has a--from-fileoption that calls_secret_from_fileandread_secret_inputfor the full text. [sources: src/devops_cli/commands/config.py:214, src/devops_cli/commands/config.py] - How should
_store_hintknow that a credential is multi-line?: Add amulti_lineboolean field toKeyringSource, defaultFalse, and set it on the four private-key rows._store_hintappends--from-file <key-file>when the field is true. (best practice) [sources: src/devops_cli/k8s/secret_push.py:344, src/devops_cli/k8s/cluster_secrets.py, src/devops_cli/commands/config.py]- Chosen: Add a
multi_lineflag toKeyringSource. The table already declares each credential source, so the flag stays next to the key and avoids a second hard-coded list. - Rejected: Keep a constant set of option names in
secret_push.py. It duplicates table data and a new multi-line key can be missed. - Rejected: Detect multi-line from the option name. A name heuristic is brittle and does not state the fact.
- Chosen: Add a
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 27, 2026
Both concern devops k8s push-secrets, but #741 adds the command and #7434 fixes its hint text for multi-line keys.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 (5)
Searches run:
Sources:
devops-cli-service commentedon Nov 28, 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.241.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.241.0
devops-cli-service commentedon Nov 29, 2026
Live since 2026-11-29 00:41 UTC