Skip to content

#161 Add unchecked DFS root#162

Open
davelil4 wants to merge 4 commits intoafiffon:mainfrom
davelil4:161-add-unchecked-dfs-root
Open

#161 Add unchecked DFS root#162
davelil4 wants to merge 4 commits intoafiffon:mainfrom
davelil4:161-add-unchecked-dfs-root

Conversation

@davelil4
Copy link

@davelil4 davelil4 commented Jan 21, 2026

Summary by CodeRabbit

  • New Features

    • Added an advanced, non‑validating access option for DFS root tree references to enable faster operations for expert workflows (use with caution).
  • Chores

    • Updated time-handling library for minor improvements and extended macro support.

✏️ Tip: You can customize this high-level summary in your review settings.

Related to issue #161

Copilot AI review requested due to automatic review settings January 21, 2026 01:55
@coderabbitai
Copy link

coderabbitai bot commented Jan 21, 2026

Walkthrough

Adds an unchecked accessor as_dfs_tree_unchecked(&self) -> DfsRootTreeRef<'_> to Tree and bumps the time dependency version in Cargo.toml.

Changes

Cohort / File(s) Summary
DFS tree unchecked accessor
crates/smb/src/tree.rs
Added pub fn as_dfs_tree_unchecked(&self) -> DfsRootTreeRef<'_>: returns a DFS root reference without verifying is_dfs_root, with doc comment noting non-checking behavior and potential misuse.
Dependency update
Cargo.toml
Updated time crate version from 0.3.37 to 0.3.45 and enabled ["macros"] feature.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

Poem

🐰 I hop through branches with nimble feet,
An unchecked doorway, quick and neat.
A DFS root I fetch with cheer,
No guards to slow this rabbit here.
🌿✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add unchecked DFS root' clearly and concisely summarizes the main change: adding a new unchecked DFS root method to the Tree struct.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

🧪 Unit Test Generation v2 is now available!

We have significantly improved our unit test generation capabilities.

To enable: Add this to your .coderabbit.yaml configuration:

reviews:
  finishing_touches:
    unit_tests:
      enabled: true

Try it out by using the @coderabbitai generate unit tests command on your code files or under ✨ Finishing Touches on the walkthrough!

Have feedback? Share your thoughts on our Discord thread!


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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 adds an unchecked variant for obtaining a DFS tree reference, allowing DFS operations on trees that may not be marked as DFS roots (such as IPC$ shares on DFS namespaces).

Changes:

  • Added as_dfs_tree_unchecked() method that bypasses DFS root validation
  • Accidentally corrupted the shebang line in a shell script (critical bug)

Reviewed changes

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

File Description
crates/smb/src/tree.rs Adds new as_dfs_tree_unchecked() method with appropriate documentation warning users about potential errors
crates/smb-transport/scripts/ksmbd.sh Contains a critical bug where a git command was accidentally prepended to the shebang line

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@davelil4 davelil4 requested a review from Copilot January 21, 2026 01:57
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@crates/smb-transport/scripts/ksmbd.sh`:
- Line 1: Replace the accidental git command that appears at the top of the
script with the proper shebang so the script can execute correctly: change the
first line containing "git push --set-upstream origin
161-add-unchecked-dfs-root#!/bin/bash" to a single shebang line "#!/bin/bash" at
the very top of the file (ksmbd.sh), ensure there are no stray git commands or
text before the shebang, and verify the script file mode is executable.

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

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

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@afiffon afiffon enabled auto-merge (squash) January 26, 2026 17:48
@davelil4
Copy link
Author

@afiffon Should I worry about the failed build?

@afiffon
Copy link
Owner

afiffon commented Jan 28, 2026

@afiffon Should I worry about the failed build?

Yep, since we'd like to have the changes merged. If you may fix time to 0.3.45, this should resolve the issue :) See https://crates.io/crates/time/versions, and modify Cargo.toml:

-time = { version = "0.3.37", features = ["macros"] }
+time = { version = "=0.3.45", features = ["macros"] }

Hopefully no more package versions are problematic.

Thanks.

@davelil4
Copy link
Author

@afiffon Looks like the lockfile removal in the build step leaves us with some crates that are not compatible with rustc 1.85. Is there a reason the lockfile is being removed? I'm confused by the comment in the workflow, but this can't merge unless we set the crate version or keep the lockfile.

auto-merge was automatically disabled January 30, 2026 16:39

Head branch was pushed to by a user without write access

@davelil4
Copy link
Author

@afiffon Can you please approve the workflow when you get the chance.

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.

2 participants