xyops_config: import as "global", destroy only forgets; read-only lookup data sources #10

Merged
john merged 0 commits from refs/pull/10/head into main 2026-11-17 00:11:29 +00:00
john commented 2026-11-16 23:57:54 +00:00 (Migrated from code.yawn.dev)

Batch 4 of the provider gap fixes.

xyops_config

  • Import with the fixed ID global; the live job_universal_actions are read, so a matching config plans empty. Other IDs are refused.
  • Delete no longer resets the global universal actions to empty. It only removes the resource from state and warns. Before, tofu destroy or dropping the resource from config silently removed every global job action.

New read-only data sources (by ID): xyops_event, xyops_web_hook, xyops_category, xyops_plugin, xyops_monitor, xyops_role, xyops_secret, and the singleton xyops_config. Each returns title, enabled and the full object as sorted json (decode with jsondecode()).

  • xyops_web_hook removes url, headers and body (often credentials or {{ secrets.* }}).
  • xyops_secret uses get_secret only (names and assignments); never decrypt_secret; strips fields/value/values/data defensively.

Tests: other config import IDs refused; config delete makes zero API calls; import -> no-op plan -> removal from config sends no admin_update_config; all 8 lookups read-only with a marker asserting no redacted value reaches state; missing object errors. Local check.sh: provider and client tests pass, govulncheck 0 reachable.

john/ops impact: none required. ops does not manage xyops_config and uses no data sources. To release, merge this and then a VERSION 0.1.2-dev.5 PR.

Batch 4 of the provider gap fixes. **`xyops_config`** - Import with the fixed ID `global`; the live `job_universal_actions` are read, so a matching config plans empty. Other IDs are refused. - **Delete no longer resets the global universal actions to empty.** It only removes the resource from state and warns. Before, `tofu destroy` or dropping the resource from config silently removed every global job action. **New read-only data sources (by ID)**: `xyops_event`, `xyops_web_hook`, `xyops_category`, `xyops_plugin`, `xyops_monitor`, `xyops_role`, `xyops_secret`, and the singleton `xyops_config`. Each returns `title`, `enabled` and the full object as sorted `json` (decode with `jsondecode()`). - `xyops_web_hook` removes `url`, `headers` and `body` (often credentials or `{{ secrets.* }}`). - `xyops_secret` uses `get_secret` only (names and assignments); never `decrypt_secret`; strips `fields`/`value`/`values`/`data` defensively. **Tests**: other config import IDs refused; config delete makes zero API calls; import -> no-op plan -> removal from config sends no `admin_update_config`; all 8 lookups read-only with a marker asserting no redacted value reaches state; missing object errors. Local `check.sh`: provider and client tests pass, govulncheck 0 reachable. **john/ops impact**: none required. ops does not manage `xyops_config` and uses no data sources. To release, merge this and then a VERSION `0.1.2-dev.5` PR.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
john/tofu-provider-xyops!10
No description provided.