Skip to content

Conversation

@Synicix
Copy link
Contributor

@Synicix Synicix commented Jun 30, 2025

  • Rename InvalidFilepath to InvalidFileorDirPath error
  • Added error handling that returns the dir when the path is invalid in hash_dir
  • Added a test to cover the case of nested directory hashing

Fixes PLT-234

@Synicix Synicix added the enhancement New feature or request label Jun 30, 2025
@Synicix Synicix requested review from Copilot, eywalker and guzman-raphael and removed request for guzman-raphael June 30, 2025 21:49
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR renames the InvalidFilepath error to InvalidFileOrDirPath across modules, updates relevant context calls in file-open and directory-read paths, and adds a new test for nested directory hashing to increase coverage.

  • Renamed error variant and updated context uses in crypto.rs and Docker orchestrator.
  • Updated Debug implementation to reference the new error variant.
  • Added nested_dir_hash test in tests/crypto.rs to cover recursive directory hashing.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/crypto.rs Imported new UDL model types, extended lint allowances, and added nested_dir_hash test
src/uniffi/orchestrator/docker.rs Updated context call to use InvalidFileOrDirPath error variant
src/uniffi/error.rs Renamed InvalidFilepath variant to InvalidFileOrDirPath
src/core/error.rs Updated Debug match arm to use the new variant name
src/core/crypto.rs Updated hash_file and hash_dir to use InvalidFileOrDirPath error context
Comments suppressed due to low confidence (1)

src/core/crypto.rs:65

  • Consider adding a test that exercises the new error handling branch in hash_dir by passing a non-existent or inaccessible directory path, to verify that InvalidFileOrDirPath is returned as expected.
        .read_dir()

@codecov
Copy link

codecov bot commented Jun 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

serde_yaml::from_str(
&fs::read_to_string(path.clone())
.context(selector::InvalidFilepath { path })?,
.context(selector::InvalidFileOrDirPath { path })?,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just call this InvalidPath?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True that is a better name, can issue the change in a bit

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want me to merge as is and you change it in other PR or make changes in this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I an update it then you can merge it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

@eywalker eywalker merged commit 2ffb008 into nauticalab:dev Oct 14, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants