[CICD] add PR checker workflow - #451
Merged
Merged
Conversation
added 2 commits
August 11, 2026 15:23
Libotry
approved these changes
Aug 11, 2026
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.
Thanks for your contribution; we appreciate it a lot. The following instructions will make your pull request healthier and help you get feedback more easily. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers.
感谢您的贡献,我们非常重视。以下说明将使您的拉取请求更健康,更易于获得反馈。如果您不理解某些项目,请不要担心,只需提交拉取请求并从维护人员那里寻求帮助即可。
PR Type / PR类型
Related Issue | 关联 Issue
Relates to #无(仓库治理类变更)
Fixes #452
🔍 Motivation / 变更动机
随着仓库 PR 数量与外部 fork 贡献增加,亟需一个统一的"PR 合入前质量门禁",杜绝以下情况流入主干:
tests/UT/下的单元测试覆盖。本次新增
PR Quality CheckGitHub Actions 工作流,对所有 PR(含 fork PR)统一执行五项检查;任一项不通过即调用core.setFailed()让 status check 红叉,配合仓库 Settings → Branches 中的 Required status check 即可真正阻止合入。📝 Modification / 修改内容
新增
benchmark/.github/workflows/pr_quality_check.ymlpull_request_target的opened/synchronize、PR 评论issue_comment.created中/pr_check命令、workflow_dispatch。d73a4a标签并core.setFailed,通过则移除标签):large_prpullRequest.additions > 1000no_issueclosingIssuesReferences或 PR body 含#123/issues/123no_reviewAPPROVED/CHANGES_REQUESTED/COMMENTED的 reviewreview_openedreviewThreads.isResolved = trueno_UTfeature标签必带tests/UT/变更;bugfix标签且additions > 50必带tests/UT/变更if:条件;token 只读时写标签 API 报 403 已被静默 catch,不影响 status check 判定,拦截能力不受影响。修改
benchmark/.github/pull_request_template.md/pr_check命令说明。📐 Associated Test Results / 关联测试结果
可在测试分支分别构造以下场景验证(建议首次启用前先在旁支验证,再合入 main 并启用分支保护规则):
large_pr标签#N且无 closingIssuesReferencesno_issue标签no_review标签review_opened标签feature标签但tests/UT/无变更no_UT标签/pr_check测试仓库验证:
文档PR: AISBench/ci_test#37
正常PR带UT: AISBench/ci_test#36
小PR:AISBench/ci_test#35
超大PR: AISBench/ci_test#34
无。本次仅新增 workflow 与 PR 模板微调,不涉及运行时逻辑变更。
每个 PR 多一次 GraphQL + 一次 PR files 分页查询的耗时,单次 < 5s,对 CI 总时长影响可忽略。
🌟 Use cases (Optional) / 使用案例(可选)
/pr_check即可重新评估,无需 push 空 commit。PR Quality Gate为 Required status check 后,fork PR 同样受门禁约束——通过 status check 失败阻断合入,标签写权限缺失时仅在日志 warning,不影响拦截判定。✅ Checklist / 检查列表
Before PR:
After PR:
👥 Collaboration Info / 协作信息
PR Quality Gate勾为 Required status check,否则仅加标签而不会真正阻断合入。🌟 Useful CI Command / 实用的CI命令
/gemini review/gemini summary/gemini help/readthedocs build/pr_check