Skip to content

Conversation

@fireairforce
Copy link

修复一下 turbopack-tests-utils 里面的快照测试文件名处理逻辑,里面有些不合法的字符串会导致 utoo 的 windows ci 挂掉:

https://github.com/utooland/utoo/actions/runs/21235370817/job/61102068999

image

@gemini-code-assist
Copy link

Summary of Changes

Hello @fireairforce, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

此拉取请求旨在解决 turbopack-test-utils 中快照测试文件名生成逻辑存在的问题,该问题会导致在 Windows CI 环境下因文件名包含非法字符而失败。通过引入更通用的正则表达式进行文件名清理,并简化样式字符串到文件安全字符串的转换,提高了文件命名兼容性和代码可维护性。

Highlights

  • 文件名清理逻辑重构: 重构了 snapshot_issues 函数中用于生成快照文件名的逻辑,使其能够更健壮地处理各种无效字符,特别是针对 Windows 文件系统。
  • 引入正则表达式进行文件名验证: 新增了 INVALID_FILENAME_CHARSMULTI_SPACE_DASH 两个正则表达式,用于识别和替换文件名中不允许的字符以及规范化空格和连字符。
  • 简化 styled_string_to_file_safe_string 函数: 简化了 styled_string_to_file_safe_string 函数的实现,移除了之前为 LineStackCodeStrong 类型添加的特殊前缀和后缀,使转换后的字符串更简洁。
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@fireairforce fireairforce merged commit 0031ed2 into utoo Jan 22, 2026
11 of 24 checks passed
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

你好,这个 PR 很好地解决了在 Windows 上因非法文件名字符导致的 CI 失败问题。通过使用正则表达式来清理和规范化文件名,代码变得更加健壮和简洁。特别是 styled_string_to_file_safe_string 函数的重构,大大简化了逻辑,并生成了更清晰的文件名。

我有一个小建议,可以使文件名清理逻辑更加完善,具体请看我的评论。

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