develop_xmon #10

Open
thabeta wants to merge 11 commits from develop_xmon into main
Owner
  1. Cleanup & Architecture**
  • Removed legacy code_from_herolib/ directory (~1200 lines deleted)
  • Removed duplicate README
  • Clean client/server separation architecture

2. Comprehensive Test Suite (+1,924 lines)

  • tests/core_tests.rs - Encryption, deduplication, pack/unpack tests
  • tests/server_api_tests.rs - Server API tests
  • tests/cli_tests.rs - CLI command tests
  • tests/container_mount_tests.rs - Container and FUSE mount tests
  • ACCEPTANCE_MATRIX.md - Test coverage documentation

3. Project Automation

  • Makefile with build, test, lint, CI targets

4. Multi-Runtime Container Support

  • ContainerRuntime enum supporting podman, docker, nerdctl
  • Auto-detection of available runtime

5. Documentation

  • System requirements for FUSE mount
  • Stack size requirements for debug builds
  • Helpful error messages in code
1. Cleanup & Architecture** - Removed legacy `code_from_herolib/` directory (~1200 lines deleted) - Removed duplicate README - Clean client/server separation architecture **2. Comprehensive Test Suite (+1,924 lines)** - `tests/core_tests.rs` - Encryption, deduplication, pack/unpack tests - `tests/server_api_tests.rs` - Server API tests - `tests/cli_tests.rs` - CLI command tests - `tests/container_mount_tests.rs` - Container and FUSE mount tests - `ACCEPTANCE_MATRIX.md` - Test coverage documentation **3. Project Automation** - `Makefile` with build, test, lint, CI targets **4. Multi-Runtime Container Support** - `ContainerRuntime` enum supporting podman, docker, nerdctl - Auto-detection of available runtime **5. Documentation** - System requirements for FUSE mount - Stack size requirements for debug builds - Helpful error messages in code
- Remove code_from_herolib/ directory (legacy herolib integration)
- Remove duplicate 'README MyFS.md' (consolidated into README.md)
- Add FEATURE_VERIFICATION.md (feature testing guide)
- Sync frontend version to 0.2.0 to match backend
Major changes:
- ServerStore now properly uses client-provided hash for block storage
- Server block upload API now accepts optional hash, file_hash, and idx params
- Added upload_block_simple() for simplified blob storage without file tracking
- Unified block size to 512KB across pack.rs, upload.rs, and server
- Added DEFAULT_BLOCK_SIZE constant in lib.rs
- Simplified publish_website() to use upload_dir() internally
- Added documentation clarifying encrypted (pack) vs unencrypted (upload) paths

Architecture:
- Server is now a pure key-value blob store (zero-knowledge capable)
- Client handles all encryption/decryption via BlockStore wrapper
- File structure tracked only in client-side flist metadata
- Two clear modes: encrypted pack/unpack vs simple upload/download
- Remove --create-flist flag from upload-dir command (always create flist)
- Simplify upload_dir() to always use pack() with encryption
- Remove unused collect_files() function
- Update publish_website() to delegate to upload_dir()
- This ensures all uploaded directories have proper metadata and encryption
New test files:
- tests/core_tests.rs: 17 tests covering encryption, deduplication,
  pack/unpack edge cases (symlinks, permissions, special filenames,
  large files, empty dirs, nested dirs), DirStore, Router
- tests/cli_tests.rs: 12 tests covering CLI help commands, error
  handling, and integration roundtrips (binary, many files, deep dirs)
- tests/server_api_tests.rs: 8 tests (4 run, 4 ignored requiring server)
  covering error handling for corrupt blocks/flists/truncated data

ACCEPTANCE_MATRIX.md: Documents all test cases organized by category
with current coverage status (~48% overall, ~85% for unit tests)

Test coverage summary:
- Encryption & Security: 100% (5/5)
- Core Operations: 92% (12/13)
- CLI Commands: 100% (8/8)
- DirStore: 75% (3/4)
- Router: 67% (2/3)
- Edge Cases: 43% (3/7)
- Integration: 60% (6/10)

Total: 62 tests, 56 passing, 6 ignored (need external services)
Provides targets for:
- Build: build, build-release, lib, check, clean
- Test: test, test-all, test-core, test-cli, test-server, test-verbose
- Code Quality: fmt, fmt-check, lint, lint-fix
- Documentation: doc, doc-open
- Development: install, run-server, watch, watch-test
- CI/CD: ci, validate, release, dist
- Examples: pack-example, unpack-example
- Docker: docker-build, docker-run

Run 'make help' for full command list.
New test file: tests/container_mount_tests.rs (10 tests)
- Container tests (4): alpine conversion, filesystem structure,
  CLI help, invalid image handling
- Mount tests (5): CLI help, invalid flist, invalid mountpoint,
  container flist unpack, full mount cycle (ignored - needs FUSE)
- Integration test (1): full container flow (busybox → flist → unpack)

Updated ACCEPTANCE_MATRIX.md:
- Added Container Conversion section (K1-K5): 100% coverage
- Added FUSE Mount section (U1-U7): 43% coverage (rest needs FUSE)
- Extended CLI section with container/mount help tests
- Overall coverage: ~53% (50 of 96 test cases)
- Unit tests without external deps: ~90% coverage

Updated Makefile:
- Added test-container target (requires podman)
- Added test-mount target
- Updated help text
Container runtime detection:
- Added ContainerRuntime enum with Podman, Docker, Nerdctl variants
- ContainerRuntime::detect() finds first available runtime
- ContainerRuntime::is_available() checks if runtime is functional
- ContainerImageToFlist::with_runtime() allows specifying runtime
- ContainerImageToFlist::new() auto-detects runtime

Updated all container functions to use runtime parameter:
- pull_image(), create_container(), export_container()
- clean_container(), clean_image(), write_startup_toml()

Updated tests:
- is_container_runtime_available() replaces is_podman_available()
- Tests print which runtime is being used
- container_test.rs uses with_runtime() for explicit runtime

This allows users with docker or nerdctl (but not podman) to use
container-to-flist conversion.
docs: Add system requirements for FUSE mount and debug builds
Some checks failed
Unit and Integration Test / test (push) Failing after 20s
8ced03684b
- Add System Requirements section to README with:
  - Stack size requirements for debug builds (ulimit -s unlimited)
  - FUSE mount prerequisites (fuse3 package, user_allow_other config)
- Add module-level documentation in main.rs with requirements
- Update Mount command help text to mention FUSE requirements
- Add helpful error context in fs/mod.rs for mount failures

The FUSE on-demand filesystem requires:
1. fuse3 package installed
2. /etc/fuse.conf with 'user_allow_other' uncommented
3. Debug builds need unlimited stack size due to async runtime overhead
docs: Add system requirements for FUSE mount and debug builds
All checks were successful
Unit and Integration Test / test (push) Successful in 5m9s
62495991f5
- Add System Requirements section to README with:
  - Stack size requirements for debug builds (ulimit -s unlimited)
  - FUSE mount prerequisites (fuse3 package, user_allow_other config)
- Add module-level documentation in main.rs with requirements
- Update Mount command help text to mention FUSE requirements
- Add helpful error context in fs/mod.rs for mount failures

The FUSE on-demand filesystem requires:
1. fuse3 package installed
2. /etc/fuse.conf with 'user_allow_other' uncommented
3. Debug builds need unlimited stack size due to async runtime overhead
update with parallel unpacking and refine the tests
Some checks failed
Unit and Integration Test / test (push) Failing after 20s
64a335e28f
fix fmt and tests
All checks were successful
Unit and Integration Test / test (push) Successful in 4m50s
765f6587e9
All checks were successful
Unit and Integration Test / test (push) Successful in 4m50s
This pull request has changes conflicting with the target branch.
  • src/container.rs
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin develop_xmon:develop_xmon
git switch develop_xmon

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff develop_xmon
git switch develop_xmon
git rebase main
git switch main
git merge --ff-only develop_xmon
git switch develop_xmon
git rebase main
git switch main
git merge --no-ff develop_xmon
git switch main
git merge --squash develop_xmon
git switch main
git merge --ff-only develop_xmon
git switch main
git merge develop_xmon
git push origin main
Sign in to join this conversation.
No reviewers
No labels
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
geomind_code/my_fs!10
No description provided.