fix(wui): sanitize branch id for dev db paths#916
Open
digi4care wants to merge 1 commit intohumanlayer:mainfrom
Open
fix(wui): sanitize branch id for dev db paths#916digi4care wants to merge 1 commit intohumanlayer:mainfrom
digi4care wants to merge 1 commit intohumanlayer:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Important
Looks good to me! 👍
Reviewed everything up to 3e56c41 in 43 seconds. Click for details.
- Reviewed
87lines of code in1files - Skipped
0files when reviewing. - Skipped posting
3draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. humanlayer-wui/src-tauri/src/lib.rs:172
- Draft comment:
The sanitize_branch_id_for_path function is clear and efficiently replaces unsafe characters with a dash. Consider adding a doc comment to explain its allowed characters and behavior (e.g., handling consecutive unsafe chars and empty result case). - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
2. humanlayer-wui/src-tauri/src/lib.rs:195
- Draft comment:
Good refactor in get_branch_id: extracting a raw branch ID then sanitizing it ensures safe file paths. This change prevents invalid characters (like '/') from propagating to paths. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
3. humanlayer-wui/src-tauri/src/lib.rs:211
- Draft comment:
Test cases cover basic sanitization (e.g. replacing '/' with '-'). Consider adding tests for consecutive unsafe characters and possibly non-ASCII input if those cases are expected. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%None
Workflow ID: wflow_qbIWMJxQaAv4AHtP
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
|
Chris Engelhard seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Important
Adds
sanitize_branch_id_for_path()to ensure branch IDs are safe for file paths by replacing unsafe characters with dashes.sanitize_branch_id_for_path()inlib.rsto replace unsafe characters in branch IDs with dashes for safe file paths.get_branch_id()inlib.rsto usesanitize_branch_id_for_path()ensuring branch IDs are path-safe.sanitize_branch_id_for_path_removes_slashes()to test slash removal.get_branch_id_is_safe_for_paths()to ensure path safety.dev_db_copy_works_with_slash_branch_name()to verify database copy functionality with sanitized branch IDs.This description was created by
for 3e56c41. You can customize this summary. It will automatically update as commits are pushed.