Skip to content

refactor: per-exec user override structural cleanup#289

Closed
DorianZheng wants to merge 1 commit intomainfrom
refactor/exec-user-cleanup
Closed

refactor: per-exec user override structural cleanup#289
DorianZheng wants to merge 1 commit intomainfrom
refactor/exec-user-cleanup

Conversation

@DorianZheng
Copy link
Copy Markdown
Member

Summary

  • Validate early: BoxCommand::user() now filters empty/whitespace strings to None at the builder layer, instead of guarding in the guest executor
  • Extract method: Inline user resolution logic in build_and_spawn() moved to ContainerCommand::resolve_exec_user()
  • DRY integration tests: TestBox helper eliminates copy-pasted setup/teardown; 3 override variants consolidated into a table-driven test

Test plan

  • cargo test -p boxlite --lib -- exec::tests — 17 passed (2 new: empty string, whitespace)
  • cargo clippy -p boxlite --lib -- -D warnings — clean
  • cargo fmt --check — clean
  • make test:integration — 100 passed, 0 leaky

- Validate empty/whitespace user specs at BoxCommand::user() builder
  (shift-left from guest executor to host-side builder)
- Simplify executor to pass user override directly (no empty-string guard)
- Extract resolve_exec_user() method from inline logic in build_and_spawn()
- Refactor integration tests with TestBox helper and table-driven approach
- Add unit tests for empty-string and whitespace-only edge cases
@DorianZheng
Copy link
Copy Markdown
Member Author

Superseded by #291 which includes both the structural cleanup and the end-to-end wiring.

@DorianZheng DorianZheng deleted the refactor/exec-user-cleanup branch February 27, 2026 06:09
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