diff --git a/README.md b/README.md index 125ec0e52d..3683acf606 100644 --- a/README.md +++ b/README.md @@ -206,7 +206,7 @@ The roadmap lives on GitHub: the issues are its items, their labels hold their S | | `devops k8s logs [OPTIONS] ` | Stream pod logs or execute LogQL queries across cluster log streams. | | | `devops k8s bootstrap [OPTIONS]` | Bootstrap homelab Kubernetes cluster with Minikube, Calico, and ingress. | | | `devops k8s bootstrap-openwebui [OPTIONS]` | Bootstrap or activate a local administrator account for Open-WebUI. | -| | `devops k8s deploy-stack [OPTIONS]` | Deploy infrastructure or LLM stack (Ollama, WebUI, Qdrant, Valkey) to Kubernetes. | +| | `devops k8s deploy-stack [OPTIONS]` | Deploy one stack (infra, llm, logging, devops, gitea) or all of them to Kubernetes with Helm and Kustomize. | | | `devops k8s sync-secrets [OPTIONS]` | Copy chart-generated admin credentials (Argo CD, Grafana) from the cluster into the OS keyring. | | | `devops k8s push-secrets [OPTIONS]` | Write the cluster's Secrets from the OS keyring (workstation keyring → cluster, the reverse of sync-secrets). Adopts live values the keyring lacks, generates the ones nobody types, and never replaces a live value without --rotate. | | | `devops k8s run-job [OPTIONS] ` | Run a devops command as a Job in namespace devops, from CronJob devops-cli's template with only its arguments changed, follow its log and exit with its exit code. | diff --git a/docs/CLI_REFERENCE.md b/docs/CLI_REFERENCE.md index 0b8523308c..35d8fb4677 100644 --- a/docs/CLI_REFERENCE.md +++ b/docs/CLI_REFERENCE.md @@ -562,7 +562,7 @@ devops devcontainer bootstrap-k8s [OPTIONS] | Option / Flag | Type | Default | Description | |---|---|---|---| | `--workspace`, `-w` | `path` | `.` | Workspace root directory path. | -| `--stack`, `-s` | `string` | `infra` | Kubernetes stack to deploy (e.g. infra, llm, monitoring, all). | +| `--stack`, `-s` | `string` | `infra` | Kubernetes stack to deploy: infra | llm | logging | devops | gitea | all. | | `--dry-run` | `boolean` | - | Preview execution plan without mutating external state. | --- @@ -905,13 +905,11 @@ devops k8s bootstrap-openwebui [OPTIONS] ### `devops k8s deploy-stack` -**Deploy infrastructure or LLM stack (Ollama, WebUI, Qdrant, Valkey) to Kubernetes.** +**Deploy one stack (infra, llm, logging, devops, gitea) or all of them to Kubernetes with Helm and Kustomize.** -Deploy infrastructure or LLM stack (Ollama, WebUI, Qdrant, Valkey) to Kubernetes. +Deploy one stack (infra, llm, logging, devops, gitea) or all of them to Kubernetes with Helm and Kustomize. -Right after the namespaces, it pushes the Secrets of the base rows, its stacks and every -detached stack whose namespace exists (`devops k8s push-secrets`), before anything that -reads them. A locked or missing keyring stops it before it applies anything. +Right after the namespaces, it pushes the Secrets of the base rows, its stacks and every detached stack whose namespace exists (`devops k8s push-secrets`), before anything that reads them. A locked or missing keyring stops it before it applies anything. ```bash devops k8s deploy-stack [OPTIONS] diff --git a/docs/MCP_TOOLS.md b/docs/MCP_TOOLS.md index 2a522bd5e2..abfdcae1b6 100644 --- a/docs/MCP_TOOLS.md +++ b/docs/MCP_TOOLS.md @@ -77,7 +77,7 @@ The `devops-cli` FastMCP server exposes DevOps automation and AI review capabili | [`k8s_bootstrap`](#k8s-bootstrap) | `false` | Bootstrap homelab Kubernetes cluster with Minikube, Calico, and ingress. | | [`k8s_chaos`](#k8s-chaos) | `false` | Run resilience and chaos experiments against Kubernetes workloads. | | [`k8s_create_tls_secret`](#k8s-create-tls-secret) | `false` | Create or update a kubernetes.io/tls secret from certificate and private key files. | -| [`k8s_deploy_stack`](#k8s-deploy-stack) | `false` | Deploy infrastructure or LLM stack (Ollama, WebUI, Qdrant, Valkey) to Kubernetes. Right after the namespaces, it pushes the Secrets of the base rows, its stacks and every detached stack whose namespace exists (`devops k8s push-secrets`), before anything that reads them. A locked or missing keyring stops it before it applies anything. | +| [`k8s_deploy_stack`](#k8s-deploy-stack) | `false` | Deploy one stack (infra, llm, logging, devops, gitea) or all of them to Kubernetes with Helm and Kustomize. Right after the namespaces, it pushes the Secrets of the base rows, its stacks and every detached stack whose namespace exists (`devops k8s push-secrets`), before anything that reads them. A locked or missing keyring stops it before it applies anything. | | [`k8s_diff_helm`](#k8s-diff-helm) | `true` | Preview Kubernetes manifest diffs before executing a Helm upgrade. | | [`k8s_doctor`](#k8s-doctor) | `false` | Diagnose Kubernetes cluster deployment health, correlate failures, and recommend remediations. | | [`k8s_enable_tls`](#k8s-enable-tls) | `false` | Generate Homelab certificates and apply TLS secrets across Kubernetes cluster namespaces. | @@ -1239,11 +1239,9 @@ Create or update a kubernetes.io/tls secret from certificate and private key fil ### `k8s_deploy_stack` -Deploy infrastructure or LLM stack (Ollama, WebUI, Qdrant, Valkey) to Kubernetes. +Deploy one stack (infra, llm, logging, devops, gitea) or all of them to Kubernetes with Helm and Kustomize. -Right after the namespaces, it pushes the Secrets of the base rows, its stacks and every -detached stack whose namespace exists (`devops k8s push-secrets`), before anything that -reads them. A locked or missing keyring stops it before it applies anything. +Right after the namespaces, it pushes the Secrets of the base rows, its stacks and every detached stack whose namespace exists (`devops k8s push-secrets`), before anything that reads them. A locked or missing keyring stops it before it applies anything. **Annotations:** `readOnlyHint: false` diff --git a/docs/commands/devcontainer.md b/docs/commands/devcontainer.md index 214cca6625..0ed0c7a7aa 100644 --- a/docs/commands/devcontainer.md +++ b/docs/commands/devcontainer.md @@ -167,7 +167,7 @@ devops devcontainer bootstrap-k8s [OPTIONS] | Option / Flag | Type | Default | Description | |---|---|---|---| | `--workspace`, `-w` | `path` | `.` | Workspace root directory path. | -| `--stack`, `-s` | `string` | `infra` | Kubernetes stack to deploy (e.g. infra, llm, monitoring, all). | +| `--stack`, `-s` | `string` | `infra` | Kubernetes stack to deploy: infra | llm | logging | devops | gitea | all. | | `--dry-run` | `boolean` | - | Preview execution plan without mutating external state. | --- diff --git a/docs/commands/k8s.md b/docs/commands/k8s.md index 18616d2d2b..4f320d2c3b 100644 --- a/docs/commands/k8s.md +++ b/docs/commands/k8s.md @@ -179,13 +179,11 @@ devops k8s bootstrap-openwebui [OPTIONS] ## `devops k8s deploy-stack` -**Deploy infrastructure or LLM stack (Ollama, WebUI, Qdrant, Valkey) to Kubernetes.** +**Deploy one stack (infra, llm, logging, devops, gitea) or all of them to Kubernetes with Helm and Kustomize.** -Deploy infrastructure or LLM stack (Ollama, WebUI, Qdrant, Valkey) to Kubernetes. +Deploy one stack (infra, llm, logging, devops, gitea) or all of them to Kubernetes with Helm and Kustomize. -Right after the namespaces, it pushes the Secrets of the base rows, its stacks and every -detached stack whose namespace exists (`devops k8s push-secrets`), before anything that -reads them. A locked or missing keyring stops it before it applies anything. +Right after the namespaces, it pushes the Secrets of the base rows, its stacks and every detached stack whose namespace exists (`devops k8s push-secrets`), before anything that reads them. A locked or missing keyring stops it before it applies anything. ```bash devops k8s deploy-stack [OPTIONS] diff --git a/k8s/README.md b/k8s/README.md index 0901f4fd51..bfb40d598a 100644 --- a/k8s/README.md +++ b/k8s/README.md @@ -528,6 +528,8 @@ Every Secret the stacks read comes from the workstation's OS keyring. `devops k8 - The keyring must be unlocked (`devops devcontainer unlock-keyring`); a locked or missing keyring stops the push before anything is read or written, and stops deploy-stack before it applies anything. - A value the keyring lacks but the cluster holds is adopted into the keyring, so a first push changes nothing live. Only values nobody types are generated, and each is stored in the keyring before it is pushed. - Typed values are stored at a hidden prompt: `devops config set cloudflare.tunnel_token` or `devops config set gitea.admin_password`. +- A derived entry is built from other values of the same push, such as a connection string from a user and a password. The push resolves every other entry first, then fills each field of the entry's template with the value of its input, quoted with `urllib.parse.quote(..., safe="")`. It never adopts, generates or stores a derived value, and a live value that differs needs `--rotate`. `--plan` names the source as `derived from` and its inputs, and `--dry-run` shows a placeholder. +- A row may name its Secret type, such as `kubernetes.io/basic-auth`. The default is `Opaque`. Kubernetes cannot change the type of an existing Secret, so a row names its type before its first push. - `DEVOPS_CLI_SERVICE_GITHUB_APP_PRIVATE_KEY` is the private key of GitHub App `devops-cli-service`, which the roadmap Service and the cluster Jobs act as ([ADR 0015](../docs/adr/0015-roadmap-jobs-act-as-a-github-app-on-the-personal-account.md)). Store it with `devops config set service.github_app.private_key --from-file `. A pod whose environment holds the key acts as the App: it mints an installation token, mints a new one before the token expires, and gives the current token to each gh and git child as GH_TOKEN. A workstation keeps the key only in the keyring, so a workstation run keeps the gh login of its person. - `argocd/argocd-notifications-secret` holds the GitHub App that Argo CD's GitHub notifier acts as. Its `service.github` refers to the keys as `$github-appID`, `$github-installationID` and `$github-privateKey`. Store the values with `devops config set argocd.github_app_id `, `devops config set argocd.github_app_installation_id ` and `devops config set argocd.github_app_private_key --from-file `, then run `devops k8s push-secrets --only argocd/argocd-notifications-secret`. The Argo CD values set `notifications.secret.create: false`, so the chart never creates a Secret of the same name, and the `homelab` project ignores the pushed Secret as an orphan. - `devops` rows are pushed wherever namespace `devops` exists, also by every deploy-stack run. `devops k8s deploy-stack --no-push-secrets` skips the push on a cluster without a keyring. diff --git a/openspec/changes/archive/2026-10-29-2008-stack-names-secret-type-derived/.openspec.yaml b/openspec/changes/archive/2026-10-29-2008-stack-names-secret-type-derived/.openspec.yaml new file mode 100644 index 0000000000..5c99d6d744 --- /dev/null +++ b/openspec/changes/archive/2026-10-29-2008-stack-names-secret-type-derived/.openspec.yaml @@ -0,0 +1,2 @@ +schema: spec-driven +created: 2026-10-29 diff --git a/openspec/changes/archive/2026-10-29-2008-stack-names-secret-type-derived/design.md b/openspec/changes/archive/2026-10-29-2008-stack-names-secret-type-derived/design.md new file mode 100644 index 0000000000..9d9628c1d8 --- /dev/null +++ b/openspec/changes/archive/2026-10-29-2008-stack-names-secret-type-derived/design.md @@ -0,0 +1,49 @@ +# Design + +## Stack names + +`config/constants.py` holds three names: + +- `CONST_K8S_STACKS`: `infra`, `llm`, `logging`, `devops` and `gitea`, in deploy order. This is the one place that names a stack. +- `CONST_K8S_ALL_STACKS`: `all`. +- `CONST_K8S_VALID_STACKS`: `(*CONST_K8S_STACKS, CONST_K8S_ALL_STACKS)`. + +`_resolve_stacks` returns `list(CONST_K8S_STACKS)` for `all` and `[stack]` for a name in `CONST_K8S_STACKS`. The help texts are f-strings over the same constants. deploy-stack is registered with `help=HELP.k8s.deploy_stack`, as push-secrets is, so its summary comes from the catalog. + +Rejected: + +- The tuple in `networking.py`, as the issue proposes. `networking.py` imports `HELP` from `devops_cli.lang`, and the help texts need the tuple. A tuple in `networking.py` makes an import cycle. #2157 moved the tuple to `constants.py` for that reason. +- `all` in the deploy order tuple, with `_resolve_stacks` removing it again. Then every reader must know that one value is a selector and not a stack. Two names make the difference clear. + +## Derived entries + +```python +DerivedSource( + "postgres://{user}:{password}@:5432/", + {"user": LiteralSource(""), "password": KeyringSource("")}, +) +``` + +- `template` is a `str.format` template. Each field names one input. The value of each input is quoted with `urllib.parse.quote(value, safe="")` before it fills its field. +- An input is a `KeyringSource`, a `SettingSource` or a `LiteralSource`. An input is not a derived source. +- `plan_push` resolves every entry that is not derived, for every Secret, in table order. It then resolves the derived entries. Thus a derived entry sees each value that the push adopts or generates for an input (`_Sources.plan_store`), whatever the order of the entries and of the rows. +- An input with no value makes the derived entry missing when it is required, and skipped when it is optional. The message names the input and the `devops config set` command of a managed option. +- A derived value is compared with the live value as any other value is: `created`, `unchanged`, `rotated`, or `differs` when `--rotate` is not given. +- A derived value is never adopted, generated or stored in the keyring. It has no `store_key`, and the dry run lists no keyring write for it. +- The source label is `derived from `. `--plan`, the push output and the dry run's placeholder use it. No label holds a value. +- The dry run lists the keyring reads of the derived inputs after the reads of every other entry, in the order that `plan_push` makes them. +- `keyring_only_keys` also counts the keyring inputs of a derived entry. + +Rejected: + +- Inputs that name other keys of the same Secret. The hooks of #1392 and #1393 are in the keyring and are not keys of their Secrets, so such inputs could not build them. +- A derived value that replaces a differing live value without `--rotate`. The push help says that a live value is never replaced without `--rotate`, and a derived value can hold a credential. +- `string.Template` instead of `str.format`. Both are in the standard library. The other help texts and messages of the project use `str.format` fields. + +## Secret type + +`ClusterSecret.secret_type` is a `Literal` of the types the table uses: `Opaque` (the default) and `kubernetes.io/basic-auth`. A row that needs another built-in type adds it to the `Literal`. `_secret_manifest` writes the row's type, so the push and the dry run carry it. + +Rejected: + +- A free `str`. Kubernetes accepts any non-empty type as a custom type, so a typo such as `kubernetes.io/basic_auth` would go to the cluster without an error. A `Literal` lets mypy find it. diff --git a/openspec/changes/archive/2026-10-29-2008-stack-names-secret-type-derived/proposal.md b/openspec/changes/archive/2026-10-29-2008-stack-names-secret-type-derived/proposal.md new file mode 100644 index 0000000000..2309637d91 --- /dev/null +++ b/openspec/changes/archive/2026-10-29-2008-stack-names-secret-type-derived/proposal.md @@ -0,0 +1,55 @@ +# Proposal + +## Why + +Issue #2008: the stack names of the k8s commands are written in more than one place, so a new stack can be left out of `all` or out of a help text. The cluster Secret push table cannot build a value from other values of the same push, and every pushed Secret has the type `Opaque`. The Mattermost database Secret of #1391 needs both features: it is of type `kubernetes.io/basic-auth`, and its connection string is built from its user and password. The alert and deploy hooks of #1392 and #1393 are URLs built from the in-cluster Mattermost address and a hook ID in the keyring. + +## What Changes + +- `config/constants.py` declares the stack names once, in deploy order, as `CONST_K8S_STACKS`. `CONST_K8S_ALL_STACKS` is `all`, and `CONST_K8S_VALID_STACKS` is the stacks followed by `all`. +- `_resolve_stacks` takes `all` and the valid names from those constants and holds no stack literal. `stack_lifecycle.py` keeps no `VALID_STACKS` of its own. The k8s package exports the one in `networking.py`. +- Every help text that lists stacks takes them from the constants: the `--stack` help of the stack commands (`HELP.k8s.stack`), the deploy-stack summary, the `--stack` help of `push-secrets` and the `--stack` help of `devops devcontainer bootstrap-k8s`. deploy-stack is registered with `HELP.k8s.deploy_stack`, which nothing used before, and that summary now names every stack instead of "infrastructure or LLM". +- The push table gets a fourth source, `DerivedSource`. It is a URL template whose fields are other sources. The push resolves every other entry first. It then fills each field with its source's value, quoted with `urllib.parse.quote(..., safe="")`. A derived value is compared with the live value as any other value is. It is never adopted, generated or stored in the keyring. `--plan` and the output name its source as `derived from `, and `--dry-run` shows a placeholder. +- A table row may name its Secret type. The default is `Opaque`. The pushed manifest and the dry run's manifest carry the type of the row. +- `CONST_K8S_MATTERMOST_URL` holds the in-cluster base URL `http://mattermost.mattermost.svc.cluster.local:8065`, for the rows of #1391, #1392 and #1393. +- No manifest under `k8s/` changes, and the table gets no new row. +- The help texts and the push behavior are observable, so the change carries deltas in `k8s-stack-help` and `stack-credential-sync`. +- This change fits one pull request. + +## Capabilities + +### Modified Capabilities + +- `k8s-stack-help`: one declaration of the stack names feeds `_resolve_stacks` and every help text that lists stacks. +- `stack-credential-sync`: the push writes derived entries and the Secret type of each row. + +## Impact + +- `src/devops_cli/config/constants.py`, `src/devops_cli/commands/k8s/networking.py`, `src/devops_cli/commands/k8s/stack_lifecycle.py`, `src/devops_cli/commands/k8s/__init__.py`, `src/devops_cli/commands/k8s/cluster_secret_push.py`, `src/devops_cli/lang/en/help.py`. +- `src/devops_cli/k8s/cluster_secrets.py`, `src/devops_cli/k8s/secret_push.py`. +- `tests/test_k8s_push_secrets.py`, `tests/test_k8s_networking.py`, `tests/test_k8s_devops_stack.py`, `tests/test_k8s_logging_stack.py`. +- `k8s/README.md`. `devops docs generate --sync-readme` rewrites the generated command and MCP documents. + +## Feasibility + +Checked on `main` at a408dee1, which holds #2608. + +- Done already, so dropped from this change: + - #2157 and #2388 moved the tuple to `CONST_K8S_VALID_STACKS` in `config/constants.py`. `networking.py:66` and `stack_lifecycle.py:289` now bind to it, not to their own literals. + - `HELP.k8s.stack` (`lang/en/help.py:412`) is built from that tuple. + - The post-Helm table `_POST_HELM_BY_STACK` exists (`stack_lifecycle.py:280-283`). +- Still open: + - `_resolve_stacks` (`networking.py:69-79`) repeats the five names as literals. + - `stack_lifecycle.py:289` keeps a second `VALID_STACKS`, which nothing in the module reads. + - `HELP.k8s.deploy_stack` (`help.py:330`) says "infra, llm, all", and no command reads it. deploy-stack's summary is its docstring, "Deploy infrastructure or LLM stack". + - `HELP.k8s.push_stack` (`help.py:336-338`) lists the stacks as literals. + - `HELP.devcontainer.stack` (`help.py:809`) names `monitoring`, which is not a stack. +- Where the one tuple lives: the issue names `networking.py`. `lang/en/help.py` builds the help texts from the tuple, and `networking.py` imports `HELP`. A tuple in `networking.py` would make an import cycle, so the tuple stays in `config/constants.py`. The refinement of the issue proposes the same place. +- `secret_push.py:480` writes `"type": "Opaque"` for every Secret. `cluster_secrets.py` has three sources, `KeyringSource`, `SettingSource` and `LiteralSource`, and none of them builds a value from another. +- `_Sources.plan_store` already lets a later entry read a value that the push adopts or generates as the keyring's own value. A derived entry that is resolved after every other entry therefore sees the password that #1391's row adopts or generates. +- Kubernetes (`pkg/apis/core/validation/validation.go`, `ValidateSecret`): a Secret of type `kubernetes.io/basic-auth` must hold `username` or `password` and may hold other keys. The `type` of a Secret cannot change after it is created, so a row names its type before its first push. +- Python 3.14.10 (the project needs 3.14 or later): `urllib.parse.quote(value, safe="")` quotes `/`, `:`, `@`, `?`, `#` and `%`, so a credential in the user-info part of a URL keeps its characters. `urllib.parse.urlsplit` and `unquote` give the user and password back unchanged (checked with a user `mat/ter:m@st` and a password `p@ss:w/rd?#%`). + +## Existing Tool Considered + +The Kubernetes Secret `type` field and its built-in type `kubernetes.io/basic-auth` carry the Secret type. Python's `str.format` and `urllib.parse.quote` build and quote a derived value. No library is added. The push keeps its own planner, because no open tool writes Secrets from the OS keyring with this adopt, generate and rotate behavior: the table and the planner came with #741. The change deletes the stack literals of `_resolve_stacks`, the second `VALID_STACKS` in `stack_lifecycle.py`, the stack literals of three help texts and the hard-coded `Opaque` type. diff --git a/openspec/changes/archive/2026-10-29-2008-stack-names-secret-type-derived/specs/k8s-stack-help/spec.md b/openspec/changes/archive/2026-10-29-2008-stack-names-secret-type-derived/specs/k8s-stack-help/spec.md new file mode 100644 index 0000000000..4173921aee --- /dev/null +++ b/openspec/changes/archive/2026-10-29-2008-stack-names-secret-type-derived/specs/k8s-stack-help/spec.md @@ -0,0 +1,27 @@ +## ADDED Requirements + +### Requirement: The stack names are declared once +The stack names SHALL be declared once, in deploy order, in `CONST_K8S_STACKS`. `_resolve_stacks` SHALL return those names for `all`, SHALL return a name of that tuple for itself, and SHALL refuse any other value. No other module SHALL declare its own list of stack names. + +#### Scenario: All resolves to every declared stack +- **WHEN** `_resolve_stacks("all")` runs +- **THEN** it returns the names of `CONST_K8S_STACKS`, in their order + +#### Scenario: An unknown stack is refused +- **WHEN** `_resolve_stacks("monitoring")` runs +- **THEN** it exits with status 1 and names every valid stack + +### Requirement: Every help text that lists stacks names every stack +The deploy-stack summary, the `--stack` help of `devops k8s push-secrets` and the `--stack` help of `devops devcontainer bootstrap-k8s` SHALL name every stack of `CONST_K8S_STACKS` and the value `all`, and SHALL name no other stack. + +#### Scenario: Display the deploy-stack summary +- **WHEN** user executes `devops k8s deploy-stack --help` +- **THEN** the summary names every stack of `CONST_K8S_STACKS` and `all` + +#### Scenario: Display the push-secrets stack help +- **WHEN** user executes `devops k8s push-secrets --help` +- **THEN** the `--stack` option description names `base`, every stack of `CONST_K8S_STACKS` and `all` + +#### Scenario: Display the bootstrap-k8s stack help +- **WHEN** user executes `devops devcontainer bootstrap-k8s --help` +- **THEN** the `--stack` option description names every stack of `CONST_K8S_STACKS` and `all`, and does not name `monitoring` diff --git a/openspec/changes/archive/2026-10-29-2008-stack-names-secret-type-derived/specs/stack-credential-sync/spec.md b/openspec/changes/archive/2026-10-29-2008-stack-names-secret-type-derived/specs/stack-credential-sync/spec.md new file mode 100644 index 0000000000..c945d96f36 --- /dev/null +++ b/openspec/changes/archive/2026-10-29-2008-stack-names-secret-type-derived/specs/stack-credential-sync/spec.md @@ -0,0 +1,31 @@ +## ADDED Requirements + +### Requirement: A derived entry is built from other values of the same push +A cluster Secret table entry MAY have a derived source: a template whose fields are keyring, setting or literal sources. The push SHALL resolve every entry that is not derived first. It SHALL then fill each field with the value of its source, quoted with `urllib.parse.quote(value, safe="")`, and SHALL compare the result with the live value as for any other entry. The push SHALL NOT adopt, generate or store a derived value in the keyring. + +#### Scenario: A connection string from a literal user and a generated password +- **WHEN** a row has a `password` entry from an empty keyring key with a generator, and after it in the table a derived `DSN` entry `postgres://{user}:{password}@db.example.com:5432/app` with the literal user `app/user` and the same keyring key as `password`, and no live Secret exists +- **THEN** the push writes `password` with the generated value, stores that value in the keyring, and writes `DSN` so that `urllib.parse.urlsplit` gives back the user `app/user`, the generated password, the host `db.example.com` and the path `/app`, and the keyring holds no value for `DSN` + +#### Scenario: A derived entry before its input in the table +- **WHEN** the derived `DSN` entry comes before the `password` entry that adopts the live password, and the live `DSN` was built from that password +- **THEN** the plan shows `DSN` as `unchanged` + +#### Scenario: A missing input +- **WHEN** an optional derived entry reads a managed keyring option that has no value +- **THEN** the push leaves the entry out, and its warning names the input and `devops config set