fix: bug: disinto backup import — schema mismatch with create; 0 issues imported (#1068) #1072

Merged
dev-qwen merged 1 commit from fix/issue-1068 into main 2026-04-20 08:01:51 +00:00
Collaborator

Fixes #1068

Changes

Fixes #1068 ## Changes
dev-qwen added 1 commit 2026-04-20 07:58:53 +00:00
fix: bug: disinto backup import — schema mismatch with create; 0 issues imported (#1068)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
4c6d545060
Collaborator

AI Review

Summary\n\nFixes the schema mismatch between backup output ( — a JSON array) and the old import code (expected a directory of individual per-issue files). With the old code, the glob matched nothing against the actual backup layout, so 0 issues were ever imported.\n\n### Findings\n\n- low backup.sh:277-278: title and body dropped the // empty guard present in the old code. jq -r outputs the string "null" when the JSON value is null, so a null body would be imported as the literal string null. Real backup data always has a title, so this won't manifest in practice, but the guard was free and its removal is a minor regression.\n\n### Verified Correct\n\n- Empty-array safety: seq 0 $((0 - 1))seq 0 -1 → no output → loop body never executes. ✓\n- jq array indexing: .[N].field syntax is valid; labels query retains // empty guard. ✓\n- Null issue-number guard: [ "$issue_num" = "null" ] correctly catches the jq null-string. ✓\n- Slug mapping: FORGE_REPO / FORGE_OPS_REPO for the two known repos; generic disinto-admin/${slug_filename} fallback for others. ✓\n- Root cause addressed: step-4 loop now iterates issues/*.json files directly, matching the actual backup directory layout. ✓

Verdict

APPROVE — Correctly fixes schema mismatch: import now reads the JSON-array file format that backup actually writes; empty-array and null-number edge cases handled; minor null-string cosmetic regression on title/body is non-blocking


Reviewed at 4c6d545 | AGENTS.md

## AI Review <!-- reviewed: 4c6d545060446e04fa904767112380feb5aa82c2 --> ### Summary\n\nFixes the schema mismatch between backup output ( — a JSON array) and the old import code (expected a directory of individual per-issue files). With the old code, the glob matched nothing against the actual backup layout, so 0 issues were ever imported.\n\n### Findings\n\n- **low** `backup.sh:277-278`: `title` and `body` dropped the `// empty` guard present in the old code. `jq -r` outputs the string `"null"` when the JSON value is null, so a null body would be imported as the literal string `null`. Real backup data always has a title, so this won't manifest in practice, but the guard was free and its removal is a minor regression.\n\n### Verified Correct\n\n- **Empty-array safety**: `seq 0 $((0 - 1))` → `seq 0 -1` → no output → loop body never executes. ✓\n- **jq array indexing**: `.[N].field` syntax is valid; labels query retains `// empty` guard. ✓\n- **Null issue-number guard**: `[ "$issue_num" = "null" ]` correctly catches the jq null-string. ✓\n- **Slug mapping**: `FORGE_REPO` / `FORGE_OPS_REPO` for the two known repos; generic `disinto-admin/${slug_filename}` fallback for others. ✓\n- **Root cause addressed**: step-4 loop now iterates `issues/*.json` files directly, matching the actual backup directory layout. ✓ ### Verdict **APPROVE** — Correctly fixes schema mismatch: import now reads the JSON-array file format that backup actually writes; empty-array and null-number edge cases handled; minor null-string cosmetic regression on title/body is non-blocking --- *Reviewed at `4c6d545` | [AGENTS.md](AGENTS.md)*
review-bot approved these changes 2026-04-20 08:01:23 +00:00
review-bot left a comment
Collaborator

AI Review: APPROVE — Correctly fixes schema mismatch: import now reads the JSON-array file format that backup actually writes; empty-array and null-number edge cases handled; minor null-string cosmetic regression on title/body is non-blocking

AI Review: **APPROVE** — Correctly fixes schema mismatch: import now reads the JSON-array file format that backup actually writes; empty-array and null-number edge cases handled; minor null-string cosmetic regression on title/body is non-blocking
dev-qwen merged commit f89d22dd39 into main 2026-04-20 08:01:51 +00:00
dev-qwen deleted branch fix/issue-1068 2026-04-20 08:01:52 +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#1072
No description provided.