[PR #1320] [CLOSED] Fix refactor import rollback tests #5037

Closed
opened 2026-10-22 04:12:41 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1320
Author: @cha1latte
Created: 5/26/2026
Status: ❌ Closed

Base: refactor ← Head: fix/refactor-rust-import-rollback


📝 Commits (2)

  • fb113ce Fix refactor import rollback tests
  • a7fd394 Extract import rollback test helper

📊 Changes

4 files changed (+31 additions, -37 deletions)

View changed files

📝 src-tauri/src/commands/storage/imports/bulk_imports.rs (+9 -20)
📝 src-tauri/src/commands/storage/imports/service.rs (+3 -0)
📝 src-tauri/src/commands/storage/imports/service_tests.rs (+5 -17)
➕ src-tauri/src/commands/storage/imports/test_helpers.rs (+14 -0)

📄 Description

Linked issue

No linked issue; this unblocks the current refactor Rust Capability Layer CI failure.

Why this change

  • The refactor branch Rust Capability Layer is failing in import rollback tests because those tests still use corrupt JSON files to simulate write failures. Storage corruption recovery now correctly preserves and recreates corrupt collections, so those fixtures no longer fail writes and the imports can succeed.

What changed

  • Updated import rollback test fixtures to block the target collection path with a directory, which exercises the intended durable write failure path.
  • Updated expected error codes from recovered JSON parse failures to the resulting filesystem write errors.
  • Covered the same harness correction for bulk import rollback tests and the related lorebook/character import rollback tests.

Refactor impact

Primary owner:

Rust storage / imports tests.

Impact areas reviewed:

  • SillyTavern chat import rollback tests.
  • SillyTavern branch import rollback tests.
  • Persona avatar import rollback tests.
  • Lorebook and embedded-lorebook import rollback tests.

Boundary notes:

  • Test-only change. No runtime storage, import, shared API, client, or remote runtime behavior changes.

Pressure points touched:

  • src-tauri/src/commands/storage/imports/bulk_imports.rs test module.
  • src-tauri/src/commands/storage/imports/service_tests.rs test module.

Validation

  • pnpm check passes locally
  • pnpm typecheck passes locally
  • pnpm build passes locally
  • pnpm check:architecture passes locally
  • pnpm check:docs passes locally
  • cargo check --manifest-path src-tauri/Cargo.toml --workspace passes locally
  • Rust clippy/tests were run for Rust behavior changes
  • Browser or Tauri app manual verification completed
  • Playwright, screenshot, or recording evidence added for UI changes
  • Remote runtime smoke checked when relevant

Manual verification notes

  • Codex confirmed the current refactor push fails Rust Capability Layer in the import rollback tests.
  • Codex ran cargo test --manifest-path src-tauri\Cargo.toml storage_commands::imports::service::bulk_imports::tests; it passed 5/5.
  • Codex ran cargo test --manifest-path src-tauri\Cargo.toml storage_commands::imports::service::tests; it passed 4/4.
  • Codex ran cargo test --manifest-path src-tauri\Cargo.toml --workspace; it passed.
  • Codex ran pnpm check; it passed.
  • Codex ran node C:\Users\celia\.codex\tools\marinara-proof-gate.mjs scratch\ci-unblock-import-rollback-verification.json; it passed.
  • Local cargo nextest was unavailable in this worktree; GitHub CI installs nextest in the Rust Capability Layer job.

Docs and release impact

  • No docs changes needed
  • Updated README.md
  • Updated CONTRIBUTING.md
  • Updated docs/developer/
  • Updated repo skills or AGENTS.md
  • Confirmed this PR does not restore old staging/package-workspace/release claims

No docs or release metadata changes are needed; this is a test-only CI unblock.

UI evidence

N/A - Rust test harness change only.

Summary by CodeRabbit

  • Tests
    • Improved storage import rollback tests to simulate I/O failure scenarios and verify proper error handling, enhancing reliability of the import process.

Review Change Stack


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/1320 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 5/26/2026 **Status:** ❌ Closed **Base:** `refactor` ← **Head:** `fix/refactor-rust-import-rollback` --- ### 📝 Commits (2) - [`fb113ce`](https://github.com/Pasta-Devs/Marinara-Engine/commit/fb113ce159cf374b1fc70891c803fed46bcd76dd) Fix refactor import rollback tests - [`a7fd394`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a7fd3944fe64542bbaba1adbca374eaf46413a3a) Extract import rollback test helper ### 📊 Changes **4 files changed** (+31 additions, -37 deletions) <details> <summary>View changed files</summary> 📝 `src-tauri/src/commands/storage/imports/bulk_imports.rs` (+9 -20) 📝 `src-tauri/src/commands/storage/imports/service.rs` (+3 -0) 📝 `src-tauri/src/commands/storage/imports/service_tests.rs` (+5 -17) ➕ `src-tauri/src/commands/storage/imports/test_helpers.rs` (+14 -0) </details> ### 📄 Description <!-- Target branch: `refactor`. Change the base to `refactor` before submitting unless a maintainer explicitly asked for another base. --> <!-- Keep all checkboxes unchecked until a human has actually verified them. --> ## Linked issue <!-- Every user-facing PR should reference a feature request or issue report when practical. --> No linked issue; this unblocks the current `refactor` Rust Capability Layer CI failure. ## Why this change <!-- What user problem, bug, refactor goal, or maintenance need does this solve? --> - The `refactor` branch Rust Capability Layer is failing in import rollback tests because those tests still use corrupt JSON files to simulate write failures. Storage corruption recovery now correctly preserves and recreates corrupt collections, so those fixtures no longer fail writes and the imports can succeed. ## What changed <!-- List the key changes in this PR. --> - Updated import rollback test fixtures to block the target collection path with a directory, which exercises the intended durable write failure path. - Updated expected error codes from recovered JSON parse failures to the resulting filesystem write errors. - Covered the same harness correction for bulk import rollback tests and the related lorebook/character import rollback tests. ## Refactor impact Primary owner: <!-- Examples: app shell, catalog, chat mode, roleplay mode, game mode, runtime generation, world-state, shared API, engine generation, Rust storage, imports, remote runtime. --> Rust storage / imports tests. Impact areas reviewed: - SillyTavern chat import rollback tests. - SillyTavern branch import rollback tests. - Persona avatar import rollback tests. - Lorebook and embedded-lorebook import rollback tests. Boundary notes: <!-- Note engine/shared-api/feature/Rust/remote-runtime boundaries. Say "none" only if you checked. --> - Test-only change. No runtime storage, import, shared API, client, or remote runtime behavior changes. Pressure points touched: <!-- Mention ModeSurface, GameSurface, shared mode UI, src-tauri/src/lib.rs command registration, or import modules if touched. --> - `src-tauri/src/commands/storage/imports/bulk_imports.rs` test module. - `src-tauri/src/commands/storage/imports/service_tests.rs` test module. ## Validation <!-- Check only what you personally ran or manually verified. Treat unchecked items as explicit TODOs. --> - [ ] `pnpm check` passes locally - [ ] `pnpm typecheck` passes locally - [ ] `pnpm build` passes locally - [ ] `pnpm check:architecture` passes locally - [ ] `pnpm check:docs` passes locally - [ ] `cargo check --manifest-path src-tauri/Cargo.toml --workspace` passes locally - [ ] Rust clippy/tests were run for Rust behavior changes - [ ] Browser or Tauri app manual verification completed - [ ] Playwright, screenshot, or recording evidence added for UI changes - [ ] Remote runtime smoke checked when relevant ### Manual verification notes <!-- Describe exactly what you tested in a real browser/app/runtime, step by step. If an AI agent filled this out, verify it yourself before ticking boxes. --> - Codex confirmed the current `refactor` push fails Rust Capability Layer in the import rollback tests. - Codex ran `cargo test --manifest-path src-tauri\Cargo.toml storage_commands::imports::service::bulk_imports::tests`; it passed 5/5. - Codex ran `cargo test --manifest-path src-tauri\Cargo.toml storage_commands::imports::service::tests`; it passed 4/4. - Codex ran `cargo test --manifest-path src-tauri\Cargo.toml --workspace`; it passed. - Codex ran `pnpm check`; it passed. - Codex ran `node C:\Users\celia\.codex\tools\marinara-proof-gate.mjs scratch\ci-unblock-import-rollback-verification.json`; it passed. - Local `cargo nextest` was unavailable in this worktree; GitHub CI installs nextest in the Rust Capability Layer job. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [ ] Confirmed this PR does not restore old staging/package-workspace/release claims No docs or release metadata changes are needed; this is a test-only CI unblock. ## UI evidence <!-- Add before/after screenshots or recordings for visible UI changes. --> N/A - Rust test harness change only. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Tests** * Improved storage import rollback tests to simulate I/O failure scenarios and verify proper error handling, enhancing reliability of the import process. <!-- review_stack_entry_start --> [![Review Change Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/Pasta-Devs/Marinara-Engine/pull/1320?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack) <!-- review_stack_entry_end --> <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:12:41 +07:00
Sign in to join this conversation.
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
Pasta-Devs/Marinara-Engine#5037
No description provided.