refactor(ci): issues 自动化 - #233
Merged
Merged
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
docs: 更新流程图和 Job 表反映链式依赖
- 移除 handle-convert 对 handle-network-404/uncertain 的依赖,有好链接时正常转换 - 移除 find-bot 步骤和 comment-id 参数,改为创建新评论而非覆盖旧评论 - 旧 Bot 评论被折叠为 OUTDATED,新评论独立存在
- extract_links_from_bot_comment 现在使用原始 URL 而不是构建新 URL - 确保从旧 Bot 评论提取的链接能正确用于快照解析
- 使用 jq 的 first // empty 语法获取第一个匹配的 Bot 评论 - 移除 head -1 避免截断多行 body 内容 - 确保历史链接能正确传递给 Python 代码进行合并
Collaborator
Author
额光md就有很多,忘告诉说agens/ci.md,其他是托 |
- 添加 || true 防止 gh api 返回空结果时导致步骤失败
- 使用成熟的 Action 替代手动 gh api + jq 调用 - 更可靠地处理多行评论内容 - 简化代码,移除 fallback 逻辑
- 将 steps.find-old-bot.outputs.comment-body 改为通过 env 传递 - 避免评论内容中的反引号被 shell 解释为命令替换 - 修复 com.eg.android.AlipayGphone: command not found 错误
- GraphQL API 返回 github-actions (不带方括号) - REST API 返回 github-actions[bot] (带方括号) - 将查询条件从 github-actions[bot] 改为 github-actions - 修复旧 Bot 评论无法被隐藏的问题
- 新增 api/base.py: URLChecker 基类,支持多场景扩展 - 新增 api/issue_checker.py: Issue 场景检查器 - 新增 utils/cache.py: 统一缓存管理 - 重构 core/checker.py: 使用 httpx 替代 urllib,支持并发检查 - 重构 entry/check_issue.py: 使用 IssueChecker,代码减少 80% - 重构 debug_sim.py: 使用 IssueChecker,消除重复代码 - 删除 api/link_checker.py: 被 base.py 和 issue_checker.py 替代 - 提取公共常量 SNAPSHOT_KINDS 到 utils/common.py 主要改进: 1. 面向对象架构,支持继承扩展(PR/Commit 场景) 2. 使用 httpx 替代 urllib,代码更简洁 3. 统一缓存管理,消除重复实现 4. 代码量减少约 40% 5. 为未来并发检查预留接口
- 更新 scripts/python/README.md: - 目录结构树(新增 base.py, issue_checker.py, cache.py) - 模块职责表格(更新 api/ 和 utils/ 描述) - 使用方式示例(使用 IssueChecker 替代 LinkChecker) - 依赖关系图(反映新的模块依赖) - 新增架构优势说明 - 更新 .claude/rules/ci-cd.md: - Python 模块结构树(同步最新目录结构) - Python 脚本说明(新增 base.py, issue_checker.py, cache.py 描述)
- 在配置 Python 环境后添加 pip install httpx 步骤 - 修复 ModuleNotFoundError: No module named 'httpx' 错误 - 恢复 core/checker.py 使用 httpx 的实现
Collaborator
Author
|
??? |
- 修复 GKD 信息回退位置:从 device 对象读取 gkdVersionName/gkdVersionCode - 添加 quickFind 字段兼容(2023-10-16 ~ 2024-01 快照) - 添加 isClickable 回退兼容旧版快照 - 添加 is_legacy_snapshot 标记,输出旧版格式警告 - 更新测试用例适配新输出格式
Collaborator
Author
|
@Lin-arm 这种运行效果你觉得如何? cjy0812#153 |
Collaborator
Author
|
算了,明天晚上再review,太多了🥲 |
cjy0812
commented
Jul 20, 2026
| """ | ||
| return extract_links(text) | ||
|
|
||
| def check_url(self, url: str) -> NetworkResult: |
This comment was marked as duplicate.
This comment was marked as duplicate.
Sorry, something went wrong.
| # ── 网络有效性检查 ── | ||
|
|
||
|
|
||
| def check_network_links(url: str, timeout: int = 20) -> "NetworkResult": |
Comment on lines
+29
to
+30
| # GitHub 附件链接:https://github.com/user-attachments/files/... | ||
| _RE_GITHUB_ATTACHMENT = re.compile(r"https://github\.com/user-attachments/files/[^\s\)]+") |
Collaborator
Author
There was a problem hiding this comment.
| _RE_UNREACHABLE_SNAPSHOT = re.compile(r"https://i\.gkd\.li/snapshot/[^\s\)]*") | ||
|
|
||
| # GKD 代理链接:https://i.gkd.li/i?url=... | ||
| _RE_GKD_PROXY_LINK = re.compile(r"https://i\.gkd\.li/i\?url=(https://[^\s\)]+)") |
Collaborator
Author
There was a problem hiding this comment.
同上https://github\.com/user-attachments/files/\d+/(.+)")
| # 旧版兼容:使用 quickFind 字段(同时作为 idQf 和 textQf) | ||
| quick_find = node.get("quickFind") | ||
| if quick_find is True: | ||
| id_qf_count += 1 |
Lin-arm
approved these changes
Jul 20, 2026
| converted_url: str | ||
|
|
||
| # 旧版快照标记 | ||
| is_legacy_snapshot: bool = False # 是否为旧版快照(缺少 appInfo/gkdAppInfo) |
Owner
There was a problem hiding this comment.
旧快照至少有两种
一种是 有快查但无vid ;更旧的一种是 无快查也无vid 的
This comment was marked as resolved.
This comment was marked as resolved.
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.
测试靶场
TODO
Details
初始阶段
有快照
本地链接(Tag+评论[不close])
不提供的(ban!)
404链接
混合
第二阶段
测试
- [ ] 测试:同 App 同 Activity 多快照 Issue → Bot 评论只展示一个代表 Activity 行,其余只记链接(幻觉!)