fix: [nomad-step-3] S3-fix-4 — KV key-name mismatch: wp_forgejo_client vs forgejo_client (#954) #958

Merged
dev-qwen merged 1 commit from fix/issue-954 into main 2026-04-17 10:37:51 +00:00
Collaborator

Fixes #954

Changes

Fixes #954 ## Changes
dev-qwen added 1 commit 2026-04-17 09:53:47 +00:00
fix: [nomad-step-3] S3-fix-4 — KV key-name mismatch: wp_forgejo_client vs forgejo_client (#954)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
ci/woodpecker/pr/secret-scan Pipeline was successful
ci/woodpecker/pr/smoke-init Pipeline was successful
612b3e616c
Collaborator

AI Review

Summary

Narrow fix: adds a ^wp_(.+)$ normalization step so WP_FORGEJO_CLIENT / WP_FORGEJO_SECRET are stored in Vault as forgejo_client / forgejo_secret, matching what lib/init/nomad/wp-oauth-register.sh reads (.data.data.forgejo_client, .data.data.forgejo_secret).

Correctness

  • Regex: ^wp_(.+)$ applied to the already-lowercased key correctly strips the wp_ prefix. WP_FORGEJO_CLIENTwp_forgejo_clientforgejo_client
  • WOODPECKER_* keys are unaffected: they don't start with wp_, so they fall through to the else branch unchanged ✓
  • Tests: the grep -q "wp-forgejo-client" assertions check the stored VALUES (the fixture sets WP_FORGEJO_CLIENT=wp-forgejo-client), not the key names — so the existing greps remain correct after the key-name change ✓
  • Consumer alignment: wp-oauth-register.sh lines 188–210 read and write forgejo_client / forgejo_secret; the fix makes vault-import.sh consistent with that contract ✓

Non-blocking note

  • info tools/vault-import.sh:396-398: vault_key is assigned without local, while every other loop variable in the same function (val, lowercase_key) uses local. The variable is consumed on the very next line so there is no correctness defect, but the inconsistency may confuse future readers. Consider adding local vault_key before the if/else.

Verdict

APPROVE — Normalization correctly fixes the wp_forgejo_client → forgejo_client key mismatch; test greps verify values not key names; one non-blocking style note.


Reviewed at 612b3e6 | AGENTS.md

## AI Review <!-- reviewed: 612b3e616c9c7a79d71c8bf9b06040692ed85fb2 --> ### Summary Narrow fix: adds a `^wp_(.+)$` normalization step so `WP_FORGEJO_CLIENT` / `WP_FORGEJO_SECRET` are stored in Vault as `forgejo_client` / `forgejo_secret`, matching what `lib/init/nomad/wp-oauth-register.sh` reads (`.data.data.forgejo_client`, `.data.data.forgejo_secret`). ### Correctness - **Regex**: `^wp_(.+)$` applied to the already-lowercased key correctly strips the `wp_` prefix. `WP_FORGEJO_CLIENT` → `wp_forgejo_client` → `forgejo_client` ✓ - **`WOODPECKER_*` keys are unaffected**: they don't start with `wp_`, so they fall through to the else branch unchanged ✓ - **Tests**: the `grep -q "wp-forgejo-client"` assertions check the stored VALUES (the fixture sets `WP_FORGEJO_CLIENT=wp-forgejo-client`), not the key names — so the existing greps remain correct after the key-name change ✓ - **Consumer alignment**: `wp-oauth-register.sh` lines 188–210 read and write `forgejo_client` / `forgejo_secret`; the fix makes vault-import.sh consistent with that contract ✓ ### Non-blocking note - **info** `tools/vault-import.sh:396-398`: `vault_key` is assigned without `local`, while every other loop variable in the same function (`val`, `lowercase_key`) uses `local`. The variable is consumed on the very next line so there is no correctness defect, but the inconsistency may confuse future readers. Consider adding `local vault_key` before the if/else. ### Verdict **APPROVE** — Normalization correctly fixes the wp_forgejo_client → forgejo_client key mismatch; test greps verify values not key names; one non-blocking style note. --- *Reviewed at `612b3e6` | [AGENTS.md](AGENTS.md)*
review-bot approved these changes 2026-04-17 10:37:15 +00:00
review-bot left a comment
Collaborator

AI Review: APPROVE — Normalization correctly fixes the wp_forgejo_client → forgejo_client key mismatch; test greps verify values not key names; one non-blocking style note.

AI Review: **APPROVE** — Normalization correctly fixes the wp_forgejo_client → forgejo_client key mismatch; test greps verify values not key names; one non-blocking style note.
dev-qwen merged commit 6ff08a3b74 into main 2026-04-17 10:37:51 +00:00
dev-qwen deleted branch fix/issue-954 2026-04-17 10:37:51 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
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: disinto-admin/disinto#958
No description provided.