011 — Per-machine local config in the user config directory (#34)

Status: shipped (v0.7.0)

Why

secrets_provider, rsync_host, mirror_host and mirror_token_env are facts about the machine — how it reaches the vault, the docs server, the private mirror — yet they are read only from task-plus.local.yaml next to each project's task-plus.yml, symlinked in by hand. On godocs-watcher the symlink was missing, so tp release fetched no token and goreleaser failed after the tag was public (#34); 15 of 60 local projects were in the same state. The granularity is wrong: one file per machine, and the per-project file kept only for the project that needs a different value.

What changes

  • tp reads $XDG_CONFIG_HOME/task-plus/local.yaml (Go's os.UserConfigDir(), so ~/.config/task-plus/local.yaml on Linux) with the same fields as task-plus.local.yaml, then the project's task-plus.local.yaml on top, a set field in the project file winning. Both are optional; a parse error in either fails the load, named.
  • tp check (local config section): reports which of the two files are in use; the existing warnings about the project file (not gitignored, plain file rather than symlink) stay.
  • README.md local config section, and the commented header of the canonical file (outside this repo) point at the user file.

Acceptance

user local.yaml project task-plus.local.yaml cfg.SecretsProvider cfg.RsyncHost for an rsync target without host:
absent absent "" ""
secrets_provider: bitwarden, rsync_host: a absent bitwarden a
absent secrets_provider: bitwarden bitwarden ""
rsync_host: a rsync_host: b — b
secrets_provider: bitwarden, rsync_host: a rsync_host: b bitwarden b
unparsable — error naming the user file —

$XDG_CONFIG_HOME unset falls back to ~/.config, as os.UserConfigDir does; a machine with no home directory reads only the project file.

Out of scope

  • Moving per-project secrets lists or any task-plus.yml field into the user file: it holds only what task-plus.local.yaml holds.
  • Migrating existing symlinks: they keep working as overrides; removing them is the person's tidy-up.
  • A tp command to write the user file.

Decisions

None.

Done when

  • tests express the acceptance table and pass
  • spec updated (README.md)
  • roadmap ticked and stamped; changelog entry
  • issue closed with a link to the release