Skip to content

Write modules.json incrementally during installation#452

Merged
Larusso merged 1 commit intomasterfrom
fix/modules_json_write_and_sync
Mar 3, 2026
Merged

Write modules.json incrementally during installation#452
Larusso merged 1 commit intomasterfrom
fix/modules_json_write_and_sync

Conversation

@Larusso
Copy link
Owner

@Larusso Larusso commented Mar 3, 2026

Description

Previously, modules.json was only written once at the end of installation. If any module failed during installation, the file would not reflect the partial progress, leaving the installation in an inconsistent state.

This change makes modules.json sync after each module completes (success or failure), ensuring the file always reflects actual installation state. Installation also continues past failures, collecting all errors.

Changes

  • [ADD] write_modules_json helper function for incremental state persistence
  • [ADD] ModuleInstaller trait to enable testing with mock installers
  • [ADD] MultipleInstallFailures error variant for reporting multiple failures
  • [ADD] Test infrastructure with JSON fixtures and MockModuleInstaller
  • [ADD] Integration tests for partial failure scenarios and state persistence
  • [FIX] install_module_and_dependencies now collects errors and continues

Test plan

  • Unit tests for write_modules_json helper
  • Integration tests with MockModuleInstaller verifying:
    • All modules succeed scenario
    • Single module failure (others continue)
    • Multiple module failures (errors collected)
    • modules.json reflects correct state after partial failure
    • Installation continues after failure (all modules attempted)

## Description

Previously, modules.json was only written once at the end of installation.
If any module failed during installation, the file would not reflect the
partial progress, leaving the installation in an inconsistent state.

This change makes modules.json sync after each module completes (success
or failure), ensuring the file always reflects actual installation state.
Installation also continues past failures, collecting all errors.

## Changes

* [ADD] `write_modules_json` helper function for incremental state persistence
* [ADD] `ModuleInstaller` trait to enable testing with mock installers
* [ADD] `MultipleInstallFailures` error variant for reporting multiple failures
* [ADD] Test infrastructure with JSON fixtures and MockModuleInstaller
* [ADD] Integration tests for partial failure scenarios and state persistence
* [FIX] `install_module_and_dependencies` now collects errors and continues
@Larusso Larusso merged commit 6d4c7b5 into master Mar 3, 2026
8 checks passed
@Larusso Larusso deleted the fix/modules_json_write_and_sync branch March 3, 2026 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant