Skip to content

fix(wui): sanitize branch id for dev db paths#916

Open
digi4care wants to merge 1 commit intohumanlayer:mainfrom
digi4care:fix/db-copy-branch-slash
Open

fix(wui): sanitize branch id for dev db paths#916
digi4care wants to merge 1 commit intohumanlayer:mainfrom
digi4care:fix/db-copy-branch-slash

Conversation

@digi4care
Copy link
Copy Markdown

@digi4care digi4care commented Dec 19, 2025

Important

Adds sanitize_branch_id_for_path() to ensure branch IDs are safe for file paths by replacing unsafe characters with dashes.

  • Behavior:
    • Adds sanitize_branch_id_for_path() in lib.rs to replace unsafe characters in branch IDs with dashes for safe file paths.
    • Updates get_branch_id() in lib.rs to use sanitize_branch_id_for_path() ensuring branch IDs are path-safe.
  • Tests:
    • Adds sanitize_branch_id_for_path_removes_slashes() to test slash removal.
    • Adds get_branch_id_is_safe_for_paths() to ensure path safety.
    • Adds dev_db_copy_works_with_slash_branch_name() to verify database copy functionality with sanitized branch IDs.

This description was created by Ellipsis for 3e56c41. You can customize this summary. It will automatically update as commits are pushed.

Copy link
Copy Markdown
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed everything up to 3e56c41 in 43 seconds. Click for details.
  • Reviewed 87 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 3 draft 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% <= threshold 50% 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% <= threshold 50% 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% <= threshold 50% None

Workflow ID: wflow_qbIWMJxQaAv4AHtP

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


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.

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