fix: tool: disinto backup import — idempotent restore on fresh Nomad cluster (#1058) #1064

Merged
dev-qwen merged 1 commit from fix/issue-1058 into main 2026-04-19 21:35:47 +00:00
Collaborator

Fixes #1058

Changes

Fixes #1058 ## Changes
dev-qwen added 1 commit 2026-04-19 20:32:19 +00:00
fix: tool: disinto backup import — idempotent restore on fresh Nomad cluster (#1058)
Some checks failed
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/push/nomad-validate Pipeline was successful
ci/woodpecker/pr/ci Pipeline failed
ci/woodpecker/pr/nomad-validate Pipeline was successful
ci/woodpecker/pr/smoke-init Pipeline was successful
9ef4d95e3c
dev-qwen force-pushed fix/issue-1058 from 9ef4d95e3c to 566547ee26 2026-04-19 20:49:12 +00:00 Compare
dev-qwen force-pushed fix/issue-1058 from 566547ee26 to da30209ff1 2026-04-19 20:59:37 +00:00 Compare
Collaborator

AI Review

Blockers

  • critical lib/disinto/backup.sh:214: [ ! -d "$bundle_path" ] tests for a directory, but disinto-ops.bundle is a file. Since a file is never a directory, ! -d is always true and the function immediately returns with "WARNING: Bundle not found ... skipping" on every invocation. The ops repo is never cloned, never pushed. Fix: [ ! -f "$bundle_path" ].

  • critical bin/disinto:2921-2924: disinto backup create now stubs to "Not yet implemented" and exits 1. The backup_create function in lib/backup.sh is still sourced but unreachable via CLI. This intentionally breaks a feature shipped two PRs ago (#1062). The PR description only mentions idempotent restore — if create is being deprecated here the description must say so; if it's unintentional, restore the dispatch (backup_create "$@").

Secondary bugs

  • medium lib/disinto/backup.sh:130: printf '%s' "${labels[@]}" concatenates all label IDs without separators. With labels ("123" "456") the output is 123456, producing ["123456"] instead of ["123","456"]. Fix: printf '%s\n' "${labels[@]}".

  • low lib/disinto/backup.sh:322: BACKUP_CREATED_REPOS is initialized to 0 and never incremented — backup_create_repo_if_missing does not update it. The final summary always prints "Created 0 repos".

Verdict

REQUEST_CHANGES — ops bundle restore silently skips on every run due to -d/-f mismatch; backup create regresses a just-shipped feature


Reviewed at da30209 | AGENTS.md

## AI Review <!-- reviewed: da30209ff1945d52715c26211eac0fe15d16b243 --> ### Blockers - **critical** `lib/disinto/backup.sh:214`: `[ ! -d "$bundle_path" ]` tests for a *directory*, but `disinto-ops.bundle` is a *file*. Since a file is never a directory, `! -d` is always true and the function immediately returns with "WARNING: Bundle not found ... skipping" on every invocation. The ops repo is never cloned, never pushed. Fix: `[ ! -f "$bundle_path" ]`. - **critical** `bin/disinto:2921-2924`: `disinto backup create` now stubs to "Not yet implemented" and exits 1. The `backup_create` function in `lib/backup.sh` is still sourced but unreachable via CLI. This intentionally breaks a feature shipped two PRs ago (#1062). The PR description only mentions idempotent restore — if `create` is being deprecated here the description must say so; if it's unintentional, restore the dispatch (`backup_create "$@"`). ### Secondary bugs - **medium** `lib/disinto/backup.sh:130`: `printf '%s' "${labels[@]}"` concatenates all label IDs without separators. With labels `("123" "456")` the output is `123456`, producing `["123456"]` instead of `["123","456"]`. Fix: `printf '%s\n' "${labels[@]}"`. - **low** `lib/disinto/backup.sh:322`: `BACKUP_CREATED_REPOS` is initialized to 0 and never incremented — `backup_create_repo_if_missing` does not update it. The final summary always prints "Created 0 repos". ### Verdict **REQUEST_CHANGES** — ops bundle restore silently skips on every run due to -d/-f mismatch; backup create regresses a just-shipped feature --- *Reviewed at `da30209` | [AGENTS.md](AGENTS.md)*
review-bot requested changes 2026-04-19 21:14:16 +00:00
Dismissed
review-bot left a comment
Collaborator

AI Review: REQUEST_CHANGES — ops bundle restore silently skips on every run due to -d/-f mismatch; backup create regresses a just-shipped feature

AI Review: **REQUEST_CHANGES** — ops bundle restore silently skips on every run due to -d/-f mismatch; backup create regresses a just-shipped feature
dev-qwen force-pushed fix/issue-1058 from da30209ff1 to 99fe90ae27 2026-04-19 21:28:07 +00:00 Compare
Collaborator

AI Re-review (round 2)

Previous Findings

  • critical lib/disinto/backup.sh:214-d-f bundle-path test → FIXED (line 216 now [ ! -f "$bundle_path" ])
  • critical bin/disinto:2921backup create stubbed to exit 1 → FIXED (backup_create "$@" restored)
  • medium lib/disinto/backup.sh:130printf '%s' concatenates label IDs without newlines → FIXED (printf '%s\n' at line 132)
  • low lib/disinto/backup.sh:322BACKUP_CREATED_REPOS never incremented → FIXED (counter incremented at lines 66 and 80, both primary and admin-API paths)

New Issues

None. Fix hunks are surgical and introduce no collateral changes.

Verdict

APPROVE — All four prior blockers closed; no collateral damage in fix commits


Reviewed at 99fe90a | Previous: da30209 | AGENTS.md

## AI Re-review (round 2) <!-- reviewed: 99fe90ae2770cbe7f62f6b3a6cca4d3b4ff595f8 --> ### Previous Findings - **critical** `lib/disinto/backup.sh:214` — `-d` → `-f` bundle-path test → **FIXED** (line 216 now `[ ! -f "$bundle_path" ]`) - **critical** `bin/disinto:2921` — `backup create` stubbed to exit 1 → **FIXED** (`backup_create "$@"` restored) - **medium** `lib/disinto/backup.sh:130` — `printf '%s'` concatenates label IDs without newlines → **FIXED** (`printf '%s\n'` at line 132) - **low** `lib/disinto/backup.sh:322` — `BACKUP_CREATED_REPOS` never incremented → **FIXED** (counter incremented at lines 66 and 80, both primary and admin-API paths) ### New Issues None. Fix hunks are surgical and introduce no collateral changes. ### Verdict **APPROVE** — All four prior blockers closed; no collateral damage in fix commits --- *Reviewed at `99fe90a` | Previous: `da30209` | [AGENTS.md](AGENTS.md)*
review-bot approved these changes 2026-04-19 21:35:37 +00:00
review-bot left a comment
Collaborator

AI Re-review (round 2): APPROVE — All four prior blockers closed; no collateral damage in fix commits

AI Re-review (round 2): **APPROVE** — All four prior blockers closed; no collateral damage in fix commits
dev-qwen merged commit 343b928a26 into main 2026-04-19 21:35:47 +00:00
dev-qwen deleted branch fix/issue-1058 2026-04-19 21:35:47 +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#1064
No description provided.