From 6ef73a2b894e55cbd947692005f4aebc267db468 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=A8=E5=BE=97=E6=84=9F=E6=83=85=E7=9A=84openEuler?= =?UTF-8?q?=E6=9C=BA=E5=99=A8=E4=BA=BA?= Date: Fri, 23 Jul 2021 06:59:38 +0000 Subject: [PATCH] Add review items for src-openeuler --- advisors/helper/reviewer_checklist.yaml | 55 +++++++++++++++++++++++++ advisors/review_tool.py | 22 +++++++++- 2 files changed, 75 insertions(+), 2 deletions(-) diff --git a/advisors/helper/reviewer_checklist.yaml b/advisors/helper/reviewer_checklist.yaml index b5029156..28cf06be 100644 --- a/advisors/helper/reviewer_checklist.yaml +++ b/advisors/helper/reviewer_checklist.yaml @@ -59,6 +59,61 @@ basic: condition: version-change claim: 新版本能兼容老版本 explain: spec中version版本变化,非master分支软件版本升级需考虑兼容性 +src-openeuler: + PackageSubmission: + - + name: PR-latest-version + condition: null + claim: 提交到 master 分支的新版本,是否已经是主线最新的 + explain: 原则上 master 分支要求必须是最新的社区上游版本 + + - + name: PR-increamental-rls + condition: null + claim: Version.Release 是否递增 + explain: 如果Version.Release回退会给升级带来麻烦。如果Version不变则Release增加,如果Version增加则Release归零 + + - + name: PR-license + condition: null + claim: License域设置是否正确 + explain: 原则上 License 应是 SPDX 中已知标准 + + - + name: PR-source-integerity + condition: null + claim: 源码包完整来自可信的上游 + explain: Source0等应该是完整的 URL,来自社区上游的代码托管地址。URL下载得到的源码包与 PR 中提供的二进制完全一致 + + - + name: PR-clean-description + condition: null + claim: description 部分清晰可读 + explain: 如 description 部分为自动抓取生成,需要做清理 + + - + name: PR-openEuler-clean + condition: null + claim: 不包含无意义的冗余判断 + explain: spec 文件中不应该包含对 openEuler 环境无意义宏判断 + + - + name: PR-selftest + condition: null + claim: 是否有 %check 内容 + explain: RPM 应该尽量包含自验证测试用例 + - + name: PR-doc + condition: null + claim: 是否应单独生成-help子包 + explain: 若文档内容多,则应独立生成 -help 子包 + + - + name: PR-changelog + condition: null + claim: changelog 记录是否合理 + explain: Changelog 格式要符合要求,变更记录易于阅读理解 + customization: community: - diff --git a/advisors/review_tool.py b/advisors/review_tool.py index 0d6605f6..60eabc31 100755 --- a/advisors/review_tool.py +++ b/advisors/review_tool.py @@ -43,6 +43,7 @@ categorizer = {'PRSubmissionSPEC': 'PR提交规范', 'OpenSourceCompliance': '开源合规性', 'SecurityPrivacy': '安全及隐私', 'Compatibility': '兼容性', + 'PackageSubmission': '制品仓要求', 'customization': '定制项'} SIGS_URL = "https://gitee.com/openeuler/community/raw/master/sig/sigs.yaml" headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW 64; rv:23.0) Gecko/20100101 Firefox/23.0'} @@ -450,6 +451,19 @@ def basic_review(cklist, branch): review_body += item return review_body +def src_openeuler_review(cklist, branch): + """ + Review items for src-openeuler repos + """ + review_body = "" + for key1, value1 in cklist['src-openeuler'].items(): + for value2 in value1: + if value2['name'] == 'PR-latest-version' and branch == 'master': + continue + item = join_check_item(categorizer[key1], + value2['claim'], value2['explain']) + review_body += item + return review_body def community_maintainer_change_review(cstm_item, sigs): """ @@ -506,7 +520,7 @@ def community_review(custom_items): return review_body -def review(checklist, pull_request, repo_name, branch): +def review(checklist, pull_request, repo_name, branch, group): """ Return check list of this PR """ @@ -519,6 +533,10 @@ def review(checklist, pull_request, repo_name, branch): question=RRVIEW_STATUS['question'], ongoing=RRVIEW_STATUS['ongoing']) review_body += basic_review(checklist, branch) + + if group == "src-openeuler": + review_body += src_openeuler_review(checklist, branch) + custom_items = checklist['customization'].get(repo_name, None) if custom_items: if repo_name == "community": @@ -784,7 +802,7 @@ def main(): if ret != 0: user_gitee.create_pr_comment(repo_name, pull_id, FAILURE_COMMENT, group) return 1 - review_comment = review(checklist, pull_request, repo_name, branch) + review_comment = review(checklist, pull_request, repo_name, branch, group) user_gitee.create_pr_comment(repo_name, pull_id, review_comment, group) if args.clean: cleanup_env(work_dir, group, repo_name, pull_id) -- Gitee