Merge:'chroe/patch0510'| 0510的01功能更新#279
Conversation
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (3)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 Walkthrough变更概览新增三组日常自动化预设配置方案,提供不同的任务执行粒度;同时更新采集管道的快速购物车节点,在OCR检查后添加状态恢复机制。 变更详情自动化预设配置
🎯 2 (Simple) | ⏱️ ~12 分钟 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Reviewer's Guide将版本说明/公告的目标标记从 HTML 注释切换为显式的 CI 使用新的 target 块注入公告和版本头的时序图sequenceDiagram
actor Developer
participant Repo
participant CI
participant inject_announcement_py as inject_announcement_py
participant changelog_generator_py as changelog_generator_py
participant App
participant GitHubRelease as GitHub_Release
Developer->>Repo: Push changes (release/app_msg.md, release/release_header.md)
CI->>Repo: Checkout main
CI->>inject_announcement_py: Run inject_announcement for app_msg
inject_announcement_py->>Repo: Read app_msg_md content
inject_announcement_py->>inject_announcement_py: _parse_targeted_blocks(file_content, tag_type)
inject_announcement_py->>inject_announcement_py: Strip HTML comments
inject_announcement_py->>inject_announcement_py: Find ---target: ...--- ... ---end--- blocks
inject_announcement_py->>inject_announcement_py: Filter blocks by tag_type/all
inject_announcement_py-->>CI: Concatenated announcement blocks
CI->>App: Inject concatenated content into Msg_Anch
CI->>changelog_generator_py: Run changelog_generator for release_header
changelog_generator_py->>Repo: Read release_header_md content
changelog_generator_py->>changelog_generator_py: _parse_targeted_blocks(file_content, tag_type)
changelog_generator_py->>changelog_generator_py: Strip HTML comments
changelog_generator_py->>changelog_generator_py: Find ---target: ...--- ... ---end--- blocks
changelog_generator_py->>changelog_generator_py: Filter blocks by tag_type/all
changelog_generator_py-->>CI: Concatenated header blocks
CI->>GitHub_Release: Prepend header content to Release Notes
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your Experience访问你的 dashboard 以:
Getting HelpOriginal review guide in EnglishReviewer's GuideSwitches release note/announcement targeting markers from HTML comments to explicit ---target/---end blocks, updates the parsing scripts accordingly (including skipping commented examples), and refreshes the current announcement and release header content, with additional resource/interface JSON changes related to the 0510-01 feature update. Sequence diagram for CI injecting announcements and release headers with new target blockssequenceDiagram
actor Developer
participant Repo
participant CI
participant inject_announcement_py as inject_announcement_py
participant changelog_generator_py as changelog_generator_py
participant App
participant GitHubRelease as GitHub_Release
Developer->>Repo: Push changes (release/app_msg.md, release/release_header.md)
CI->>Repo: Checkout main
CI->>inject_announcement_py: Run inject_announcement for app_msg
inject_announcement_py->>Repo: Read app_msg_md content
inject_announcement_py->>inject_announcement_py: _parse_targeted_blocks(file_content, tag_type)
inject_announcement_py->>inject_announcement_py: Strip HTML comments
inject_announcement_py->>inject_announcement_py: Find ---target: ...--- ... ---end--- blocks
inject_announcement_py->>inject_announcement_py: Filter blocks by tag_type/all
inject_announcement_py-->>CI: Concatenated announcement blocks
CI->>App: Inject concatenated content into Msg_Anch
CI->>changelog_generator_py: Run changelog_generator for release_header
changelog_generator_py->>Repo: Read release_header_md content
changelog_generator_py->>changelog_generator_py: _parse_targeted_blocks(file_content, tag_type)
changelog_generator_py->>changelog_generator_py: Strip HTML comments
changelog_generator_py->>changelog_generator_py: Find ---target: ...--- ... ---end--- blocks
changelog_generator_py->>changelog_generator_py: Filter blocks by tag_type/all
changelog_generator_py-->>CI: Concatenated header blocks
CI->>GitHub_Release: Prepend header content to Release Notes
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - 我发现了 3 个问题,并给出了一些整体性的反馈:
_parse_targeted_blocks中使用的<!--.*?-->剥离逻辑范围非常宽,会移除所有 HTML 注释(而不仅仅是示例),这可能会让后续编辑者感到意外;建议将其收窄为只过滤已文档化的示例区域,或者只过滤实际包含---target标记的注释。- 新的
_parse_targeted_blocks实现在changelog_generator.py和inject_announcement.py中是重复的;把这部分抽取成共享辅助函数,可以降低未来修改块格式时两个实现产生差异的风险。
给 AI Agent 的提示
Please address the comments from this code review:
## Overall Comments
- `_parse_targeted_blocks` 中使用的 `<!--.*?-->` 剥离逻辑范围非常宽,会移除所有 HTML 注释(而不仅仅是示例),这可能会让后续编辑者感到意外;建议将其收窄为只过滤已文档化的示例区域,或者只过滤实际包含 `---target` 标记的注释。
- 新的 `_parse_targeted_blocks` 实现在 `changelog_generator.py` 和 `inject_announcement.py` 中是重复的;把这部分抽取成共享辅助函数,可以降低未来修改块格式时两个实现产生差异的风险。
## Individual Comments
### Comment 1
<location path="scripts/changelog_generator.py" line_range="273" />
<code_context>
+ """按 ---target: ...--- / ---end--- 标记解析内容块,按顺序拼接所有匹配当前版本类型的块。"""
+ # 先剥离 HTML 注释,防止说明文档中的示例块被误匹配
+ content = re.sub(r'<!--.*?-->', '', file_content, flags=re.DOTALL)
+ block_re = re.compile(r'---target:\s*(.+?)---[ \t]*\n(.*?)---end---', re.DOTALL | re.IGNORECASE)
matched = []
- for i in range(1, len(parts) - 1, 2):
</code_context>
<issue_to_address>
**suggestion:** 这个块的正则假设是 LF 换行符,因此在 CRLF 文件中可能会漏掉匹配。
由于正则在头部后面硬编码了 `
`,如果文件使用原始 Windows `
` 换行,这个模式就无法匹配。为了让它在不同平台上都能正常工作,可以把换行部分改成 `
?
`、`[\r\n]+`,或者类似 `
?
[ \t]*` 这样对空白更宽容的形式,同时仍然清晰地区分头部和正文。
```suggestion
block_re = re.compile(r'---target:\s*(.+?)---[ \t]*\r?\n(.*?)---end---', re.DOTALL | re.IGNORECASE)
```
</issue_to_address>
### Comment 2
<location path="scripts/inject_announcement.py" line_range="38" />
<code_context>
+ """按 ---target: ...--- / ---end--- 标记解析内容块,按顺序拼接所有匹配当前版本类型的块。"""
+ # 先剥离 HTML 注释,防止说明文档中的示例块被误匹配
+ content = re.sub(r'<!--.*?-->', '', file_content, flags=re.DOTALL)
+ block_re = re.compile(r'---target:\s*(.+?)---[ \t]*\n(.*?)---end---', re.DOTALL | re.IGNORECASE)
matched = []
- for i in range(1, len(parts) - 1, 2):
</code_context>
<issue_to_address>
**suggestion:** 这个脚本中的目标块正则同样对换行风格很敏感。
对于保留了 `\r` 的 CRLF 输入,这个模式也无法匹配。建议使用 `\r?\n`(或更通用的换行匹配模式),以便解析器能在来自不同平台/编辑器的文件上正确工作。
```suggestion
block_re = re.compile(r'---target:\s*(.+?)---[ \t]*\r?\n(.*?)---end---', re.DOTALL | re.IGNORECASE)
```
</issue_to_address>
### Comment 3
<location path="release/release_header.md" line_range="42-46" />
<code_context>
+════════════════════════════════════════════════════════════════
+-->
+---target: all---
> 159 Moons of Grace , And miles to go with you.
+---end---
</code_context>
<issue_to_address>
**issue (typo):** 请去掉英文句子中逗号前多余的空格。
把字符串中逗号前的空格去掉,使其变为 `Grace, And`。
```suggestion
════════════════════════════════════════════════════════════════
-->
---target: all---
> 159 Moons of Grace, And miles to go with you.
---end---
```
</issue_to_address>帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进之后的 review。
Original comment in English
Hey - I've found 3 issues, and left some high level feedback:
- The
<!--.*?-->stripping in_parse_targeted_blocksis very broad and will remove all HTML comments (not just examples), which may surprise future editors; consider narrowing this to only filter documented example regions or comments that actually contain---targetmarkers. - The new
_parse_targeted_blocksimplementation is duplicated betweenchangelog_generator.pyandinject_announcement.py; factoring this into a shared helper would reduce the chance of the two implementations diverging on future changes to the block format.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The `<!--.*?-->` stripping in `_parse_targeted_blocks` is very broad and will remove all HTML comments (not just examples), which may surprise future editors; consider narrowing this to only filter documented example regions or comments that actually contain `---target` markers.
- The new `_parse_targeted_blocks` implementation is duplicated between `changelog_generator.py` and `inject_announcement.py`; factoring this into a shared helper would reduce the chance of the two implementations diverging on future changes to the block format.
## Individual Comments
### Comment 1
<location path="scripts/changelog_generator.py" line_range="273" />
<code_context>
+ """按 ---target: ...--- / ---end--- 标记解析内容块,按顺序拼接所有匹配当前版本类型的块。"""
+ # 先剥离 HTML 注释,防止说明文档中的示例块被误匹配
+ content = re.sub(r'<!--.*?-->', '', file_content, flags=re.DOTALL)
+ block_re = re.compile(r'---target:\s*(.+?)---[ \t]*\n(.*?)---end---', re.DOTALL | re.IGNORECASE)
matched = []
- for i in range(1, len(parts) - 1, 2):
</code_context>
<issue_to_address>
**suggestion:** The block regex assumes LF line endings and can miss matches on CRLF files.
Because the regex hard-codes `
` after the header, it won’t match content in files using raw Windows `
` line endings. To make it work across platforms, update the line-break part to something like `
?
`, `[
]+`, or a whitespace-tolerant form such as `
?
[ ]*`, while still clearly separating header and body.
```suggestion
block_re = re.compile(r'---target:\s*(.+?)---[ \t]*\r?\n(.*?)---end---', re.DOTALL | re.IGNORECASE)
```
</issue_to_address>
### Comment 2
<location path="scripts/inject_announcement.py" line_range="38" />
<code_context>
+ """按 ---target: ...--- / ---end--- 标记解析内容块,按顺序拼接所有匹配当前版本类型的块。"""
+ # 先剥离 HTML 注释,防止说明文档中的示例块被误匹配
+ content = re.sub(r'<!--.*?-->', '', file_content, flags=re.DOTALL)
+ block_re = re.compile(r'---target:\s*(.+?)---[ \t]*\n(.*?)---end---', re.DOTALL | re.IGNORECASE)
matched = []
- for i in range(1, len(parts) - 1, 2):
</code_context>
<issue_to_address>
**suggestion:** The target block regex is also sensitive to line-ending style in this script.
With CRLF input where `
` is preserved, this pattern won’t match. Consider using `
?
` (or a more general line-break pattern) so the parser works correctly on files from different platforms/editors.
```suggestion
block_re = re.compile(r'---target:\s*(.+?)---[ \t]*\r?\n(.*?)---end---', re.DOTALL | re.IGNORECASE)
```
</issue_to_address>
### Comment 3
<location path="release/release_header.md" line_range="42-46" />
<code_context>
+════════════════════════════════════════════════════════════════
+-->
+---target: all---
> 159 Moons of Grace , And miles to go with you.
+---end---
</code_context>
<issue_to_address>
**issue (typo):** Remove the extra space before the comma in the English sentence.
Update the string to remove the space before the comma so it reads `Grace, And`.
```suggestion
════════════════════════════════════════════════════════════════
-->
---target: all---
> 159 Moons of Grace, And miles to go with you.
---end---
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| ════════════════════════════════════════════════════════════════ | ||
| --> | ||
| ---target: all--- | ||
| > 159 Moons of Grace , And miles to go with you. | ||
| ---end--- |
There was a problem hiding this comment.
issue (typo): 请去掉英文句子中逗号前多余的空格。
把字符串中逗号前的空格去掉,使其变为 Grace, And。
| ════════════════════════════════════════════════════════════════ | |
| --> | |
| ---target: all--- | |
| > 159 Moons of Grace , And miles to go with you. | |
| ---end--- | |
| ════════════════════════════════════════════════════════════════ | |
| --> | |
| ---target: all--- | |
| > 159 Moons of Grace, And miles to go with you. | |
| ---end--- |
Original comment in English
issue (typo): Remove the extra space before the comma in the English sentence.
Update the string to remove the space before the comma so it reads Grace, And.
| ════════════════════════════════════════════════════════════════ | |
| --> | |
| ---target: all--- | |
| > 159 Moons of Grace , And miles to go with you. | |
| ---end--- | |
| ════════════════════════════════════════════════════════════════ | |
| --> | |
| ---target: all--- | |
| > 159 Moons of Grace, And miles to go with you. | |
| ---end--- |
🤖 DeepSeek 自动评审报告模型: 概览本次 PR 主要做了三件事:①在 阻塞性问题(必须修改)无。 建议改进(非阻塞)1. Preset 任务名硬编码与顶层 task 名称的耦合
2.
|
Summary by Sourcery
将发布/公告模板切换为新的
---target---/---end---块格式,并相应更新解析脚本,同时加入最新的应用内公告和发布头部内容。新功能:
增强:
---target---/---end---块标记,并忽略被注释的示例。文档:
---target---/---end---块语法来实现定向内容。Original summary in English
Summary by Sourcery
Switch release/announcement templating to a new ---target---/---end--- block format and update parsing scripts accordingly, while adding the latest in-app announcement and release header content.
New Features:
Enhancements:
Documentation:
Summary by CodeRabbit
发版说明
新功能
改进