Skip to content

fix: windows zip path, code repo indexing, search retrieval, account id, rust cli version...#577

Merged
qin-ctx merged 12 commits intovolcengine:mainfrom
MaojiaSheng:main
Mar 15, 2026
Merged

fix: windows zip path, code repo indexing, search retrieval, account id, rust cli version...#577
qin-ctx merged 12 commits intovolcengine:mainfrom
MaojiaSheng:main

Conversation

@MaojiaSheng
Copy link
Copy Markdown
Collaborator

@MaojiaSheng MaojiaSheng commented Mar 13, 2026

Description

Related Issue

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Test update

Changes Made

Testing

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have tested this on the following platforms:
    • Linux
    • macOS
    • Windows

Checklist

  • My code follows the project's coding style
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

Screenshots (if applicable)

Additional Notes

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Mar 13, 2026

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ MaojiaSheng
❌ openviking


openviking 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.

Copy link
Copy Markdown
Contributor

@sponge225 sponge225 left a comment

Choose a reason for hiding this comment

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

测试结果

Image

发现的问题

当前实现中 ZIP 路径缺少根目录名。

** 根本原因**:
file_path.relative_to(dir_path) 只返回相对路径,不包含目录名本身。

修改建议

def _zip_directory(self, dir_path: str) -> str:
    """Create a temporary zip file from a directory."""
    dir_path = Path(dir_path)
    if not dir_path.is_dir():
        raise ValueError(f"Path {dir_path} is not a directory")

    temp_dir = tempfile.gettempdir()
    zip_path = Path(temp_dir) / f"temp_upload_{uuid.uuid4().hex}.zip"
    
    root_name = dir_path.name  # Add this line

    with zipfile.ZipFile(zip_path, "w", zipfile.ZIP_DEFLATED) as zipf:
        for file_path in dir_path.rglob("*"):
            if file_path.is_file():
                rel_path = file_path.relative_to(dir_path)
                arcname = f"{root_name}/{rel_path}"  # Include root directory name
                arcname = arcname.replace("\\", "/")
                zipf.write(file_path, arcname=arcname)

    return str(zip_path)

影响

  • 修复 ZIP 路径结构
  • 保留目录层级
  • 保持 Windows 路径规范化

修改后的测试结果

Image

Related: This fix complements the path normalization work in issue #540

@MaojiaSheng MaojiaSheng marked this pull request as draft March 13, 2026 14:06
@MaojiaSheng MaojiaSheng marked this pull request as ready for review March 14, 2026 19:42
@MaojiaSheng MaojiaSheng changed the title fix: windows zip path norm fix: windows zip path, code repo indexing, search retrieval, account id, rust cli version... Mar 14, 2026
@MaojiaSheng
Copy link
Copy Markdown
Collaborator Author

this fixed #594

@qin-ctx qin-ctx merged commit 0fb8f13 into volcengine:main Mar 15, 2026
38 of 39 checks passed
@github-project-automation github-project-automation bot moved this from Backlog to Done in OpenViking project Mar 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants