Skip to content

Inject filesystem I/O into discover_tracked_lockfiles and surface failures via exceptions #79

Description

@coderabbitai

Background

Raised during review of PR #75 (refresh stale Cargo lockfiles before publish preflight).

Problem

discover_tracked_lockfiles in lading/commands/lockfile.py mixes direct filesystem I/O (workspace_root.rglob, Path.exists) with injected runner calls. Failures are hidden via LOGGER.warning and silent empty-tuple returns rather than being surfaced through explicit APIs. Tests compensate by mocking filesystem layout rather than testing integrations.

Resolution

  • Route filesystem operations (lockfile enumeration, manifest existence checks) through the injected runner or a dedicated filesystem port so the function has no direct Path I/O.
  • Make discovery failures explicit in the public API (raise a typed exception or return a Result-style type) rather than logging warnings and returning empty tuples silently.
  • Replace mock-based unit tests with real integration tests that exercise discovery and refresh against temporary directory fixtures without stubbing the internals.

References

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions