已合并
[CI]: add ci scripts for check robot config #48
fuyong创建于 4月9日
[CI]: add ci scripts for check robot config #48
已合并
共 5 个文件变更+1535-0
| @@ -0,0 +1,174 @@ | |||
| 1 | +#!/usr/bin/env python3 | ||
| 2 | +# -*- coding: utf-8 -*- | ||
| 3 | +import requests | ||
| 4 | +import json | ||
| 5 | +import sys | ||
| 6 | +import time | ||
| 7 | +import os | ||
| 8 | +import argparse | ||
| 9 | + | ||
| 10 | +def add_gitcode_comment(owner, project, pr_number, access_token, comment, base_url=None, timeout=30, retry_count=3): | ||
| 11 | + """添加评论到GitCode PR""" | ||
| 12 | + | ||
| 13 | + # 支持自定义基础URL(便于测试) | ||
| 14 | + if base_url is None: | ||
| 15 | + base_url = "https://gitcode.com/api/v5" | ||
| 16 | + | ||
| 17 | + url = f"{base_url}/repos/{owner}/{project}/pulls/{pr_number}/comments" | ||
| 18 | + headers = { | ||
| 19 | + "Authorization": f"Bearer {access_token}", | ||
| 20 | + "Content-Type": "application/json;charset=UTF-8" | ||
| 21 | + } | ||
| 22 | + | ||
| 23 | + def send_comment(comment_text, retry=retry_count): | ||
| 24 | + """发送单个评论,支持重试""" | ||
| 25 | + data = {"body": comment_text} | ||
| 26 | + | ||
| 27 | + for attempt in range(retry): | ||
| 28 | + try: | ||
| 29 | + response = requests.post(url, headers=headers, json=data, timeout=timeout) | ||
| 30 | + response.raise_for_status() | ||
| 31 | + return True, response.json() | ||
| 32 | + except requests.exceptions.RequestException as e: | ||
| 33 | + if attempt < retry - 1: | ||
| 34 | + print(f"Attempt {attempt + 1} failed, retrying...") | ||
| 35 | + time.sleep(2) # 重试前等待 | ||
| 36 | + else: | ||
| 37 | + return False, str(e) | ||
| 38 | + return False, "Max retries exceeded" | ||
| 39 | + | ||
| 40 | + # 如果评论长度不超过8000,直接发送 | ||
| 41 | + if len(comment) <= 8000: | ||
| 42 | + success, result = send_comment(comment) | ||
| 43 | + if success: | ||
| 44 | + print("Comment added successfully") | ||
| 45 | + return True | ||
| 46 | + else: | ||
| 47 | + print(f"Failed to add comment: {result}") | ||
| 48 | + return False | ||
| 49 | + | ||
| 50 | + # 长评论分片处理 | ||
| 51 | + print(f"Comment too long ({len(comment)} characters), splitting into chunks...") | ||
| 52 | + | ||
| 53 | + # 可配置的分块大小 | ||
| 54 | + max_chunk_size = 7900 | ||
| 55 | + chunks = [] | ||
| 56 | + current_chunk = "" | ||
| 57 | + | ||
| 58 | + # 按行处理,保持行完整性 | ||
| 59 | + lines = comment.split('\n') | ||
| 60 | + for line in lines: | ||
| 61 | + # 如果单行就超过限制,需要特殊处理 | ||
| 62 | + if len(line) > max_chunk_size: | ||
| 63 | + # 对超长行进行强制分割 | ||
| 64 | + words = line.split(' ') | ||
| 65 | + temp_line = "" | ||
| 66 | + for word in words: | ||
| 67 | + if len(temp_line) + len(word) + 1 > max_chunk_size: | ||
| 68 | + if temp_line: | ||
| 69 | + chunks.append(temp_line) | ||
| 70 | + temp_line = word | ||
| 71 | + else: | ||
| 72 | + temp_line += " " + word if temp_line else word | ||
| 73 | + if temp_line: | ||
| 74 | + if len(current_chunk) + len(temp_line) + 1 > max_chunk_size: | ||
| 75 | + if current_chunk: | ||
| 76 | + chunks.append(current_chunk) | ||
| 77 | + current_chunk = temp_line | ||
| 78 | + else: | ||
| 79 | + current_chunk += "\n" + temp_line if current_chunk else temp_line | ||
| 80 | + else: | ||
| 81 | + if len(current_chunk) + len(line) + 1 > max_chunk_size: | ||
| 82 | + chunks.append(current_chunk) | ||
| 83 | + current_chunk = line | ||
| 84 | + else: | ||
| 85 | + current_chunk += "\n" + line if current_chunk else line | ||
| 86 | + | ||
| 87 | + if current_chunk: | ||
| 88 | + chunks.append(current_chunk) | ||
| 89 | + | ||
| 90 | + print(f"Split into {len(chunks)} chunks") | ||
| 91 | + | ||
| 92 | + success_count = 0 | ||
| 93 | + for i, chunk in enumerate(chunks): | ||
| 94 | + total_chunks = len(chunks) | ||
| 95 | + | ||
| 96 | + # 可配置的块前缀 | ||
| 97 | + if total_chunks > 1: | ||
| 98 | + chunk_header = f"**评论部分 {i+1}/{total_chunks}**\n\n" | ||
| 99 | + chunk_footer = "\n\n---\n*还有后续内容...*" if i < total_chunks - 1 else "" | ||
| 100 | + chunk_comment = chunk_header + chunk + chunk_footer | ||
| 101 | + else: | ||
| 102 | + chunk_comment = chunk | ||
| 103 | + | ||
| 104 | + success, result = send_comment(chunk_comment) | ||
| 105 | + if success: | ||
| 106 | + success_count += 1 | ||
| 107 | + print(f"✅ Chunk {i+1}/{total_chunks} sent successfully") | ||
| 108 | + else: | ||
| 109 | + print(f"❌ Failed to send chunk {i+1}: {result}") | ||
| 110 | + | ||
| 111 | + # 可配置的延迟时间 | ||
| 112 | + if i < total_chunks - 1: | ||
| 113 | + time.sleep(1) # 块间延迟 | ||
| 114 | + | ||
| 115 | + success = success_count == len(chunks) | ||
| 116 | + if success: | ||
| 117 | + print(f"✅ All {success_count} chunks sent successfully") | ||
| 118 | + else: | ||
| 119 | + print(f"❌ Only {success_count}/{len(chunks)} chunks sent successfully") | ||
| 120 | + | ||
| 121 | + return success | ||
| 122 | + | ||
| 123 | +def main(): | ||
| 124 | + parser = argparse.ArgumentParser(description='Add comment to GitCode PR') | ||
| 125 | + parser.add_argument('--owner', required=True, help='Repository owner') | ||
| 126 | + parser.add_argument('--project', required=True, help='Project name') | ||
| 127 | + parser.add_argument('--pr-number', required=True, help='PR number') | ||
| 128 | + parser.add_argument('--token', required=True, help='Access token') | ||
| 129 | + parser.add_argument('--comment', required=True, help='Comment content') | ||
| 130 | + parser.add_argument('--comment-file', help='Read comment from file (overrides --comment)') | ||
| 131 | + parser.add_argument('--base-url', default='https://gitcode.com/api/v5', help='Base API URL') | ||
| 132 | + parser.add_argument('--timeout', type=int, default=30, help='Request timeout in seconds') | ||
| 133 | + parser.add_argument('--retry', type=int, default=3, help='Retry count') | ||
| 134 | + parser.add_argument('--dry-run', action='store_true', help='Dry run without actually sending') | ||
| 135 | + | ||
| 136 | + args = parser.parse_args() | ||
| 137 | + | ||
| 138 | + # 从文件读取评论或使用参数 | ||
| 139 | + if args.comment_file: | ||
| 140 | + try: | ||
| 141 | + with open(args.comment_file, 'r', encoding='utf-8') as f: | ||
| 142 | + comment_content = f.read() | ||
| 143 | + except Exception as e: | ||
| 144 | + print(f"Error reading comment file: {e}") | ||
| 145 | + sys.exit(1) | ||
| 146 | + else: | ||
| 147 | + comment_content = args.comment | ||
| 148 | + | ||
| 149 | + if args.dry_run: | ||
| 150 | + print("=== DRY RUN ===") | ||
| 151 | + print(f"Owner: {args.owner}") | ||
| 152 | + print(f"Project: {args.project}") | ||
| 153 | + print(f"PR Number: {args.pr_number}") | ||
| 154 | + print(f"Token: {args.token[:10]}...") # 只显示部分token | ||
| 155 | + print(f"Comment length: {len(comment_content)}") | ||
| 156 | + print(f"Base URL: {args.base_url}") | ||
| 157 | + print("=== END DRY RUN ===") | ||
| 158 | + sys.exit(0) | ||
| 159 | + | ||
| 160 | + success = add_gitcode_comment( | ||
| 161 | + owner=args.owner, | ||
| 162 | + project=args.project, | ||
| 163 | + pr_number=args.pr_number, | ||
| 164 | + access_token=args.token, | ||
| 165 | + comment=comment_content, | ||
| 166 | + base_url=args.base_url, | ||
| 167 | + timeout=args.timeout, | ||
| 168 | + retry_count=args.retry | ||
| 169 | + ) | ||
| 170 | + | ||
| 171 | + sys.exit(0 if success else 1) | ||
| 172 | + | ||
| 173 | +if __name__ == "__main__": | ||
| 174 | + main() | ||
| @@ -0,0 +1,301 @@ | |||
| 1 | +import os | ||
| 2 | +import sys | ||
| 3 | +import yaml | ||
| 4 | +import requests | ||
| 5 | +import argparse | ||
| 6 | +from typing import Dict, List, Any, Optional, Set | ||
| 7 | + | ||
| 8 | +GITCODE_BASE_URL = "https://api.gitcode.com/api/v5/" | ||
| 9 | + | ||
| 10 | +class RobotConfigChecker: | ||
| 11 | + def __init__(self, token: str = ""): | ||
| 12 | + self.token = token or os.environ.get("GITCODE_TOKEN") | ||
| 13 | + | ||
| 14 | + self.session = requests.Session() | ||
| 15 | + if self.token: | ||
| 16 | + self.session.params = {"access_token": self.token} | ||
| 17 | + | ||
| 18 | + self.errors = [] | ||
| 19 | + self.org_repos_cache = {} # cache org -> set of repo full names | ||
| 20 | + | ||
| 21 | + def add_error(self, message: str): | ||
| 22 | + self.errors.append(message) | ||
| 23 | + | ||
| 24 | + def get_org_repos(self, org: str) -> Set[str]: | ||
| 25 | + """Fetch all repositories for an organization using OpenAPI.""" | ||
| 26 | + if org in self.org_repos_cache: | ||
| 27 | + return self.org_repos_cache[org] | ||
| 28 | + | ||
| 29 | + if not self.token: | ||
| 30 | + return set() | ||
| 31 | + | ||
| 32 | + repo_names = set() | ||
| 33 | + page = 1 | ||
| 34 | + per_page = 100 | ||
| 35 | + | ||
| 36 | + try: | ||
| 37 | + while True: | ||
| 38 | + url = f"{GITCODE_BASE_URL}orgs/{org}/repos" | ||
| 39 | + params = {"page": page, "per_page": per_page} | ||
| 40 | + response = self.session.get(url, params=params, timeout=15) | ||
| 41 | + | ||
| 42 | + if response.status_code != 200: | ||
| 43 | + print(f"Warning: Failed to fetch repos for org {org}: {response.status_code}") | ||
| 44 | + break | ||
| 45 | + | ||
| 46 | + data = response.json() | ||
| 47 | + if not data: | ||
| 48 | + break | ||
| 49 | + | ||
| 50 | + for r in data: | ||
| 51 | + html_url = r.get("html_url", "") | ||
| 52 | + if html_url: | ||
| 53 | + # 移除前缀 https://gitcode.com/ 并转为小写 | ||
| 54 | + repo_path = html_url.replace("https://gitcode.com/", "").strip("/").lower() | ||
| 55 | + repo_names.add(repo_path) | ||
| 56 | + | ||
| 57 | + if len(data) < per_page: | ||
| 58 | + break | ||
| 59 | + page += 1 | ||
| 60 | + except Exception as e: | ||
| 61 | + print(f"Error fetching repos for org {org}: {e}") | ||
| 62 | + | ||
| 63 | + self.org_repos_cache[org] = repo_names | ||
| 64 | + return repo_names | ||
| 65 | + | ||
| 66 | + def check_repo_exists(self, repo_path: str) -> bool: | ||
| 67 | + """Check if repo exists by looking up in organization's repo list.""" | ||
| 68 | + if not self.token: | ||
| 69 | + return True # Skip if no token | ||
| 70 | + | ||
| 71 | + parts = repo_path.split('/') | ||
| 72 | + if len(parts) != 2: | ||
| 73 | + return False | ||
| 74 | + | ||
| 75 | + org = parts[0] | ||
| 76 | + org_repos = self.get_org_repos(org) | ||
| 77 | + | ||
| 78 | + # If cache is empty but we have a token, it might be a fetch failure or no access | ||
| 79 | + # Fallback to direct check if org list is empty to be safe | ||
| 80 | + if not org_repos: | ||
| 81 | + url = f"{GITCODE_BASE_URL}repos/{repo_path}" | ||
| 82 | + try: | ||
| 83 | + response = self.session.get(url, timeout=10) | ||
| 84 | + print(f"DEBUG: Direct check for {repo_path}, status: {response.status_code}") | ||
| 85 | + return response.status_code == 200 | ||
| 86 | + except Exception as e: | ||
| 87 | + print(f"DEBUG: Direct check for {repo_path} failed with exception: {e}") | ||
| 88 | + return False | ||
| 89 | + | ||
| 90 | + exists = repo_path.lower() in org_repos | ||
| 91 | + if not exists: | ||
| 92 | + print(f"DEBUG: {repo_path} not found in org {org} repo list (total {len(org_repos)} repos)") | ||
| 93 | + print(f"DEBUG: Org {org} repo list contents: {sorted(list(org_repos))}") | ||
| 94 | + return exists | ||
| 95 | + | ||
| 96 | + def run_check(self, config_path: str): | ||
| 97 | + if not os.path.exists(config_path): | ||
| 98 | + self.add_error(f"Config file not found: {config_path}") | ||
| 99 | + return False # 注意:这里返回False,但依然会生成result.md | ||
| 100 | + | ||
| 101 | + try: | ||
| 102 | + with open(config_path, 'r', encoding='utf-8') as f: | ||
| 103 | + config = yaml.safe_load(f) | ||
| 104 | + except Exception as e: | ||
| 105 | + self.add_error(f"Failed to parse YAML: {e}") | ||
| 106 | + return False | ||
| 107 | + | ||
| 108 | + if not config or 'configs' not in config: | ||
| 109 | + self.add_error("Missing 'configs' root element") | ||
| 110 | + return False | ||
| 111 | + | ||
| 112 | + for idx, item in enumerate(config['configs']): | ||
| 113 | + self.validate_item(item, idx) | ||
| 114 | + | ||
| 115 | + # 即使有错误,也返回False,确保生成报告 | ||
| 116 | + return len(self.errors) == 0 | ||
| 117 | + | ||
| 118 | + def validate_item(self, item: Dict[str, Any], index: int): | ||
| 119 | + # 1. Check lgtm_need_nums and approve_need_nums (0 < val < 10) | ||
| 120 | + for field in ['lgtm_need_nums', 'approve_need_nums']: | ||
| 121 | + val = item.get(field) | ||
| 122 | + if not isinstance(val, int) or not (0 < val < 10): | ||
| 123 | + self.add_error(f"{field} 必须是 1-9 之间的整数 (当前值: {val})") | ||
| 124 | + | ||
| 125 | + # 2. Check branch_configs and each branch's merge_method | ||
| 126 | + branch_configs = item.get('branch_configs', []) | ||
| 127 | + if not isinstance(branch_configs, list) or len(branch_configs) == 0: | ||
| 128 | + self.add_error(f"缺少 branch_configs 或 branch_configs 不是列表") | ||
| 129 | + else: | ||
| 130 | + valid_methods = ['squash', 'merge', 'rebase'] | ||
| 131 | + for bi, bc in enumerate(branch_configs): | ||
| 132 | + if not isinstance(bc, dict): | ||
| 133 | + self.add_error(f"branch_configs 必须是映射类型") | ||
| 134 | + continue | ||
| 135 | + method = bc.get('merge_method') | ||
| 136 | + if method not in valid_methods: | ||
| 137 | + self.add_error( | ||
| 138 | + f"merge_method 必须是 {valid_methods} 之一 (当前值: {method})" | ||
| 139 | + ) | ||
| 140 | + # 每个 branch_configs 项必须有 branch 字段或 is_default: true | ||
| 141 | + has_branch = 'branch' in bc | ||
| 142 | + is_default = bc.get('is_default') is True | ||
| 143 | + if not has_branch and not is_default: | ||
| 144 | + self.add_error( | ||
| 145 | + f"branch_configs 必须包含 'branch' 字段或设置 'is_default: true'" | ||
| 146 | + ) | ||
| 147 | + | ||
| 148 | + # 3. Check repos format (org/repo) and existence | ||
| 149 | + repos = item.get('repos', []) | ||
| 150 | + if not isinstance(repos, list): | ||
| 151 | + self.add_error(f"repos 字段必须是列表") | ||
| 152 | + else: | ||
| 153 | + for repo in repos: | ||
| 154 | + if not isinstance(repo, str) or '/' not in repo or len(repo.split('/')) != 2: | ||
| 155 | + self.add_error(f"仓库名 '{repo}' 格式错误,必须为 '组织/仓库' 格式") | ||
| 156 | + elif not self.check_repo_exists(repo): | ||
| 157 | + self.add_error(f"仓库 '{repo}' 不存在") | ||
| 158 | + | ||
| 159 | + # >>>>>>>>>>>> 新增:生成 result.md 的逻辑 <<<<<<<<<<<< | ||
| 160 | + def generate_result_md(self): | ||
| 161 | + """ | ||
| 162 | + 生成 result.md 文件,输出格式为 markdown 表格 | ||
| 163 | + 参考了 print_results 的逻辑,将扁平的错误列表整理为表格形式 | ||
| 164 | + """ | ||
| 165 | + # 1. 数据预处理:将扁平的 self.errors 列表分类,以便填入表格 | ||
| 166 | + # 注意:这里通过关键词匹配来归类,因为 validate_item 中是将所有错误混在一起的 | ||
| 167 | + errors_by_category = { | ||
| 168 | + "字段数值错误": [], # 对应 lgtm/approve 数值检查 | ||
| 169 | + "branch_configs结构错误": [], # 对应 branch_configs 缺失/格式错误 | ||
| 170 | + "合并策略错误": [], # 对应 merge_method 检查 | ||
| 171 | + "仓库格式错误": [], # 对应 repos 格式检查 | ||
| 172 | + "仓库存在性错误": [], # 对应 repo 不存在检查 | ||
| 173 | + "其他错误": [] # 兜底分类 | ||
| 174 | + } | ||
| 175 | + | ||
| 176 | + for error in self.errors: | ||
| 177 | + categorized = False | ||
| 178 | + if "lgtm_need_nums" in error or "approve_need_nums" in error: | ||
| 179 | + errors_by_category["字段数值错误"].append(error) | ||
| 180 | + categorized = True | ||
| 181 | + elif "merge_method" in error: | ||
| 182 | + errors_by_category["合并策略错误"].append(error) | ||
| 183 | + categorized = True | ||
| 184 | + elif "branch_configs" in error: | ||
| 185 | + errors_by_category["branch_configs结构错误"].append(error) | ||
| 186 | + categorized = True | ||
| 187 | + elif "格式错误" in error or "repos 字段必须是列表" in error: | ||
| 188 | + errors_by_category["仓库格式错误"].append(error) | ||
| 189 | + categorized = True | ||
| 190 | + elif "不存在" in error: | ||
| 191 | + errors_by_category["仓库存在性错误"].append(error) | ||
| 192 | + categorized = True | ||
| 193 | + | ||
| 194 | + if not categorized: | ||
| 195 | + errors_by_category["其他错误"].append(error) | ||
| 196 | + | ||
| 197 | + total_errors = sum(len(errs) for errs in errors_by_category.values()) | ||
| 198 | + results = [] | ||
| 199 | + | ||
| 200 | + # 2. 构建表格内容 | ||
| 201 | + # 标题行 | ||
| 202 | + if total_errors == 0: | ||
| 203 | + results.append("✅ 机器人配置检查通过!\n") | ||
| 204 | + else: | ||
| 205 | + results.append(f"❌ 机器人配置检查未通过 (共 {total_errors} 个错误)\n") | ||
| 206 | + | ||
| 207 | + results.append("检查项 | 检查结果 | 错误详情") | ||
| 208 | + results.append("--- | --- | ---") | ||
| 209 | + | ||
| 210 | + # 定义检查项顺序 | ||
| 211 | + check_items = [ | ||
| 212 | + ("lgtm/approve数值检查", ["字段数值错误"]), | ||
| 213 | + ("branch_configs结构检查", ["branch_configs结构错误"]), | ||
| 214 | + ("merge method检查", ["合并策略错误"]), | ||
| 215 | + ("repos格式检查", ["仓库格式错误"]), | ||
| 216 | + ("仓库存在性检查", ["仓库存在性错误"]), | ||
| 217 | + ("其他检查", ["其他错误"]), | ||
| 218 | + ] | ||
| 219 | + | ||
| 220 | + # 生成表格行 | ||
| 221 | + for item_name, categories in check_items: | ||
| 222 | + item_errors = [] | ||
| 223 | + for cat in categories: | ||
| 224 | + if cat in errors_by_category: | ||
| 225 | + item_errors.extend(errors_by_category[cat]) | ||
| 226 | + | ||
| 227 | + if item_errors: | ||
| 228 | + # 去重:使用 dict.fromkeys 保留顺序并去除重复 | ||
| 229 | + unique_errors = list(dict.fromkeys(item_errors)) | ||
| 230 | + error_count = len(unique_errors) | ||
| 231 | + | ||
| 232 | + # 使用 <br> 实现 Markdown 表格内的换行显示 | ||
| 233 | + error_summary = "<br>".join(unique_errors) | ||
| 234 | + | ||
| 235 | + results.append(f"{item_name} | ❌ 未通过 ({error_count}) | {error_summary}") | ||
| 236 | + else: | ||
| 237 | + # "其他检查" 无错误时不输出,避免干扰 | ||
| 238 | + if item_name == "其他检查": | ||
| 239 | + continue | ||
| 240 | + results.append(f"{item_name} | ✅ 已通过 | -") | ||
| 241 | + | ||
| 242 | + # 3. 写入文件与控制台输出 | ||
| 243 | + result_filename = "result.md" | ||
| 244 | + try: | ||
| 245 | + with open(result_filename, "w", encoding="utf-8") as f: | ||
| 246 | + f.write("\n".join(results)) | ||
| 247 | + | ||
| 248 | + # 控制台输出 | ||
| 249 | + print("\n" + "="*60) | ||
| 250 | + print("门禁检查结果") | ||
| 251 | + print("="*60) | ||
| 252 | + print("\n".join(results)) | ||
| 253 | + | ||
| 254 | + # 如果有错误,在控制台输出详细列表 | ||
| 255 | + if total_errors > 0: | ||
| 256 | + print(f"\n{'='*60}") | ||
| 257 | + print("详细错误列表") | ||
| 258 | + print(f"{'='*60}") | ||
| 259 | + for i, error in enumerate(self.errors, 1): | ||
| 260 | + print(f"{i}. {error}") | ||
| 261 | + | ||
| 262 | + print(f"\n{'='*60}") | ||
| 263 | + print(f"详细结果已保存到 {result_filename}") | ||
| 264 | + print("="*60) | ||
| 265 | + | ||
| 266 | + except Exception as e: | ||
| 267 | + print(f"❌ 写入 {result_filename} 失败: {e}") | ||
| 268 | + # 失败时仍然尝试打印到控制台 | ||
| 269 | + print("\n".join(results)) | ||
| 270 | + | ||
| 271 | +def main(): | ||
| 272 | + parser = argparse.ArgumentParser(description='Robot config validator') | ||
| 273 | + parser.add_argument('--config', default='.infra/robot-config.yaml', help='Path to robot-config.yaml') | ||
| 274 | + parser.add_argument('--token', help='GitCode API token') | ||
| 275 | + parser.add_argument('--no-cleanup', action='store_true', help='检查完成后保留克隆的临时目录(用于调试)') | ||
| 276 | + args = parser.parse_args() | ||
| 277 | + | ||
| 278 | + checker = RobotConfigChecker( | ||
| 279 | + token=args.token | ||
| 280 | + ) | ||
| 281 | + | ||
| 282 | + # 执行检查(不管结果如何,都继续生成报告) | ||
| 283 | + success = checker.run_check(args.config) | ||
| 284 | + | ||
| 285 | + # 无论成功或失败,都强制生成 result.md | ||
| 286 | + # 这是解决 "未生成 result.md" 错误的关键 | ||
| 287 | + checker.generate_result_md() | ||
| 288 | + | ||
| 289 | + # 最后根据检查结果退出状态码 | ||
| 290 | + if success: | ||
| 291 | + print("✅ Configuration is valid") | ||
| 292 | + sys.exit(0) | ||
| 293 | + else: | ||
| 294 | + print("❌ Configuration errors found:") | ||
| 295 | + for err in checker.errors: | ||
| 296 | + print(f" - {err}") | ||
| 297 | + # 注意:这里不退出,因为 generate_result_md 已经被调用 | ||
| 298 | + sys.exit(1) | ||
| 299 | + | ||
| 300 | +if __name__ == "__main__": | ||
| 301 | + main() | ||
| @@ -0,0 +1,81 @@ | |||
| 1 | +# .infra/robot-config.yaml 配置指导文档 | ||
| 2 | + | ||
| 3 | +本文档用于指导如何配置 [config/bot-review-config.yaml](bot-review-config.yaml) 文件,该文件主要用于定义代码审核规则、PR目标分支管理策略以及标签自动化处理。 | ||
| 4 | + | ||
| 5 | +## 字段详细说明 | ||
| 6 | + | ||
| 7 | +### 1. configs (配置列表) | ||
| 8 | +该部分定义了针对不同仓库的配置规则。 | ||
| 9 | + | ||
| 10 | +| 字段 | 类型 | 说明 | 示例 | | ||
| 11 | +| :--- | :--- | :--- | :--- | | ||
| 12 | +| `repos` | list | 适用的仓库列表。 | `["ascend-archive/testRepo"]` | | ||
| 13 | +| `lgtm_need_nums` | int | 机器人添加 lgtm 标签需要的 `/lgtm` 评论数量。 | `3` | | ||
| 14 | +| `approve_need_nums` | int | 机器人添加 approved 标签需要的 `/approve` 评论数量。 | `4` | | ||
| 15 | +| `branch_configs` | list | 针对不同目标分支的合并策略配置列表。 | / | | ||
| 16 | + | ||
| 17 | +### 2. branch_configs (分支配置列表) | ||
| 18 | +每个分支配置项用于定义特定分支或默认分支的合并方式与标签规则。 | ||
| 19 | + | ||
| 20 | +| 字段 | 类型 | 说明 | 示例 | | ||
| 21 | +| :--- | :--- | :--- | :--- | | ||
| 22 | +| `branch` | string | 目标分支名称。与 `is_default` 二选一。 | `main` | | ||
| 23 | +| `is_default` | bool | 设为 `true` 时作为兜底默认配置,匹配未被其他 branch_configs 命中的分支。 | `true` | | ||
| 24 | +| `merge_method` | string | 合并 PR 的方式。可选值:`squash`, `merge`, `rebase`。 | `squash` | | ||
| 25 | +| `labels` | list | 定义该分支所需的自动化标签列表。 | / | | ||
| 26 | + | ||
| 27 | +#### labels 列表项说明: | ||
| 28 | +每个标签配置项包含以下字段: | ||
| 29 | + | ||
| 30 | +| 字段 | 类型 | 说明 | | ||
| 31 | +| :--- | :--- | :--- | | ||
| 32 | +| `label` | string | 标签的名称。 | | ||
| 33 | +| `person` | string | 负责自动添加该标签的机器人账号ID。 | | ||
| 34 | + | ||
| 35 | +--- | ||
| 36 | + | ||
| 37 | +## 配置示例 | ||
| 38 | + | ||
| 39 | +```yaml | ||
| 40 | +configs: | ||
| 41 | + - repos: | ||
| 42 | + - Ascend/testRepo | ||
| 43 | + lgtm_need_nums: 3 | ||
| 44 | + approve_need_nums: 4 | ||
| 45 | + branch_configs: | ||
| 46 | + - is_default: true | ||
| 47 | + merge_method: squash | ||
| 48 | + labels: | ||
| 49 | + - label: lgtm | ||
| 50 | + person: ascend-robot | ||
| 51 | + - label: approved | ||
| 52 | + person: ascend-robot | ||
| 53 | + - label: ascend-cla/yes | ||
| 54 | + person: ascend-robot | ||
| 55 | + - branch: main | ||
| 56 | + merge_method: squash | ||
| 57 | + labels: | ||
| 58 | + - label: lgtm | ||
| 59 | + person: ascend-robot | ||
| 60 | + - label: approved | ||
| 61 | + person: ascend-robot | ||
| 62 | + - label: ascend-cla/yes | ||
| 63 | + person: ascend-robot | ||
| 64 | + - label: ci-pipeline-passed | ||
| 65 | + person: ascend-robot | ||
| 66 | + - branch: release-1.0 | ||
| 67 | + merge_method: merge | ||
| 68 | + labels: | ||
| 69 | + - label: lgtm | ||
| 70 | + person: ascend-robot | ||
| 71 | + - label: approved | ||
| 72 | + person: ascend-robot | ||
| 73 | + - label: ascend-cla/yes | ||
| 74 | + person: ascend-robot | ||
| 75 | + - label: ci-pipeline-passed | ||
| 76 | + person: ascend-robot | ||
| 77 | + | ||
| 78 | +``` | ||
| 79 | + | ||
| 80 | +--- | ||
| 81 | +*注:修改配置后,请确保 YAML 格式正确。* | ||
| @@ -0,0 +1,878 @@ | |||
| 1 | +configs: | ||
| 2 | + - repos: | ||
| 3 | + - Ascend/MindIE-LLM | ||
| 4 | + lgtm_need_nums: 2 | ||
| 5 | + approve_need_nums: 1 | ||
| 6 | + branch_configs: | ||
| 7 | + - is_default: true | ||
| 8 | + merge_method: squash | ||
| 9 | + labels: | ||
| 10 | + - label: lgtm | ||
| 11 | + person: ascend-robot | ||
| 12 | + - label: approved | ||
| 13 | + person: ascend-robot | ||
| 14 | + - label: ascend-cla/yes | ||
| 15 | + person: ascend-robot | ||
| 16 | + - label: ci-pipeline-passed | ||
| 17 | + person: ascend-robot | ||
| 18 | + - branch: master | ||
| 19 | + merge_method: squash | ||
| 20 | + labels: | ||
| 21 | + - label: lgtm | ||
| 22 | + person: ascend-robot | ||
| 23 | + - label: approved | ||
| 24 | + person: ascend-robot | ||
| 25 | + - label: ascend-cla/yes | ||
| 26 | + person: ascend-robot | ||
| 27 | + - label: keeper_approved | ||
| 28 | + person: ascend-robot | ||
| 29 | + - label: ci-pipeline-passed | ||
| 30 | + person: ascend-robot | ||
| 31 | + - branch: dev | ||
| 32 | + merge_method: squash | ||
| 33 | + labels: | ||
| 34 | + - label: lgtm | ||
| 35 | + person: ascend-robot | ||
| 36 | + - label: approved | ||
| 37 | + person: ascend-robot | ||
| 38 | + - label: ascend-cla/yes | ||
| 39 | + person: ascend-robot | ||
| 40 | + - label: keeper_approved | ||
| 41 | + person: ascend-robot | ||
| 42 | + - label: ci-pipeline-passed | ||
| 43 | + person: ascend-robot | ||
| 44 | + - branch: v3.0.0.beta.1 | ||
| 45 | + merge_method: squash | ||
| 46 | + labels: | ||
| 47 | + - label: lgtm | ||
| 48 | + person: ascend-robot | ||
| 49 | + - label: approved | ||
| 50 | + person: ascend-robot | ||
| 51 | + - label: ascend-cla/yes | ||
| 52 | + person: ascend-robot | ||
| 53 | + - label: keeper_approved | ||
| 54 | + person: ascend-robot | ||
| 55 | + - label: ci-pipeline-passed | ||
| 56 | + person: ascend-robot | ||
| 57 | + - repos: | ||
| 58 | + - Ascend/MindIE-SD | ||
| 59 | + - Ascend/MindIE-Turbo | ||
| 60 | + - Ascend/MindIE-Motor | ||
| 61 | + - Ascend/MindIE-PyMotor | ||
| 62 | + lgtm_need_nums: 2 | ||
| 63 | + approve_need_nums: 1 | ||
| 64 | + branch_configs: | ||
| 65 | + - is_default: true | ||
| 66 | + merge_method: squash | ||
| 67 | + labels: | ||
| 68 | + - label: lgtm | ||
| 69 | + person: ascend-robot | ||
| 70 | + - label: approved | ||
| 71 | + person: ascend-robot | ||
| 72 | + - label: ascend-cla/yes | ||
| 73 | + person: ascend-robot | ||
| 74 | + - label: ci-pipeline-passed | ||
| 75 | + person: ascend-robot | ||
| 76 | + - branch: master | ||
| 77 | + merge_method: squash | ||
| 78 | + labels: | ||
| 79 | + - label: lgtm | ||
| 80 | + person: ascend-robot | ||
| 81 | + - label: approved | ||
| 82 | + person: ascend-robot | ||
| 83 | + - label: ascend-cla/yes | ||
| 84 | + person: ascend-robot | ||
| 85 | + - label: keeper_approved | ||
| 86 | + person: ascend-robot | ||
| 87 | + - label: ci-pipeline-passed | ||
| 88 | + person: ascend-robot | ||
| 89 | + - branch: dev | ||
| 90 | + merge_method: squash | ||
| 91 | + labels: | ||
| 92 | + - label: lgtm | ||
| 93 | + person: ascend-robot | ||
| 94 | + - label: approved | ||
| 95 | + person: ascend-robot | ||
| 96 | + - label: ascend-cla/yes | ||
| 97 | + person: ascend-robot | ||
| 98 | + - label: keeper_approved | ||
| 99 | + person: ascend-robot | ||
| 100 | + - label: ci-pipeline-passed | ||
| 101 | + person: ascend-robot | ||
| 102 | + - branch: dev_950 | ||
| 103 | + merge_method: squash | ||
| 104 | + labels: | ||
| 105 | + - label: lgtm | ||
| 106 | + person: ascend-robot | ||
| 107 | + - label: approved | ||
| 108 | + person: ascend-robot | ||
| 109 | + - label: ascend-cla/yes | ||
| 110 | + person: ascend-robot | ||
| 111 | + - label: SC-SUCC | ||
| 112 | + person: ascend-robot | ||
| 113 | + - branch: v3.0.0.beta.1 | ||
| 114 | + merge_method: squash | ||
| 115 | + labels: | ||
| 116 | + - label: lgtm | ||
| 117 | + person: ascend-robot | ||
| 118 | + - label: approved | ||
| 119 | + person: ascend-robot | ||
| 120 | + - label: ascend-cla/yes | ||
| 121 | + person: ascend-robot | ||
| 122 | + - label: keeper_approved | ||
| 123 | + person: ascend-robot | ||
| 124 | + - label: ci-pipeline-passed | ||
| 125 | + person: ascend-robot | ||
| 126 | + - branch: v2.3.0 | ||
| 127 | + merge_method: squash | ||
| 128 | + labels: | ||
| 129 | + - label: lgtm | ||
| 130 | + person: ascend-robot | ||
| 131 | + - label: approved | ||
| 132 | + person: ascend-robot | ||
| 133 | + - label: ascend-cla/yes | ||
| 134 | + person: ascend-robot | ||
| 135 | + - label: keeper_approved | ||
| 136 | + person: ascend-robot | ||
| 137 | + - label: ci-pipeline-passed | ||
| 138 | + person: ascend-robot | ||
| 139 | + - repos: | ||
| 140 | + - Ascend/community | ||
| 141 | + lgtm_need_nums: 2 | ||
| 142 | + approve_need_nums: 1 | ||
| 143 | + branch_configs: | ||
| 144 | + - is_default: true | ||
| 145 | + merge_method: squash | ||
| 146 | + labels: | ||
| 147 | + - label: lgtm | ||
| 148 | + person: ascend-robot | ||
| 149 | + - label: approved | ||
| 150 | + person: ascend-robot | ||
| 151 | + - label: ascend-cla/yes | ||
| 152 | + person: ascend-robot | ||
| 153 | + - label: ci-pipeline-passed | ||
| 154 | + person: ascend-robot | ||
| 155 | + - label: docs-ci-pipeline-success | ||
| 156 | + person: ascend-robot | ||
| 157 | + - repos: | ||
| 158 | + - Ascend/modelzoo | ||
| 159 | + - Ascend/ci-infra | ||
| 160 | + - Ascend/mockcpp | ||
| 161 | + - Ascend/.gitcode | ||
| 162 | + - Ascend/docs | ||
| 163 | + - Ascend/ray-ascend | ||
| 164 | + - Ascend/agent-skills | ||
| 165 | + - Ascend/ascendc-kernelgen-data | ||
| 166 | + - Ascend/text-embeddings-inference | ||
| 167 | + - Ascend/faiss | ||
| 168 | + - Ascend/perf-reference-ascend | ||
| 169 | + lgtm_need_nums: 2 | ||
| 170 | + approve_need_nums: 1 | ||
| 171 | + branch_configs: | ||
| 172 | + - is_default: true | ||
| 173 | + merge_method: squash | ||
| 174 | + labels: | ||
| 175 | + - label: lgtm | ||
| 176 | + person: ascend-robot | ||
| 177 | + - label: approved | ||
| 178 | + person: ascend-robot | ||
| 179 | + - label: ascend-cla/yes | ||
| 180 | + person: ascend-robot | ||
| 181 | + - repos: | ||
| 182 | + - Ascend/infrastructure | ||
| 183 | + lgtm_need_nums: 1 | ||
| 184 | + approve_need_nums: 1 | ||
| 185 | + branch_configs: | ||
| 186 | + - is_default: true | ||
| 187 | + merge_method: squash | ||
| 188 | + labels: | ||
| 189 | + - label: lgtm | ||
| 190 | + person: ascend-robot | ||
| 191 | + - label: approved | ||
| 192 | + person: ascend-robot | ||
| 193 | + - label: ascend-cla/yes | ||
| 194 | + person: ascend-robot | ||
| 195 | + - repos: | ||
| 196 | + - Ascend/msprof-analyze | ||
| 197 | + - Ascend/msmonitor | ||
| 198 | + - Ascend/AscendNPU-IR | ||
| 199 | + - Ascend/msmemscope | ||
| 200 | + lgtm_need_nums: 2 | ||
| 201 | + approve_need_nums: 1 | ||
| 202 | + branch_configs: | ||
| 203 | + - is_default: true | ||
| 204 | + merge_method: merge | ||
| 205 | + labels: | ||
| 206 | + - label: lgtm | ||
| 207 | + person: ascend-robot | ||
| 208 | + - label: approved | ||
| 209 | + person: ascend-robot | ||
| 210 | + - label: ascend-cla/yes | ||
| 211 | + person: ascend-robot | ||
| 212 | + - label: ci-pipeline-passed | ||
| 213 | + person: ascend-robot | ||
| 214 | + - repos: | ||
| 215 | + - Ascend/mstt | ||
| 216 | + - Ascend/msit | ||
| 217 | + - Ascend/msprof | ||
| 218 | + - Ascend/msprobe | ||
| 219 | + - Ascend/msot | ||
| 220 | + - Ascend/msserviceprofiler | ||
| 221 | + - Ascend/mspti | ||
| 222 | + - Ascend/msoptuner | ||
| 223 | + - Ascend/msinsight | ||
| 224 | + - Ascend/mssanitizer | ||
| 225 | + - Ascend/mstx | ||
| 226 | + - Ascend/mskpp | ||
| 227 | + - Ascend/msopgen | ||
| 228 | + - Ascend/msopcom | ||
| 229 | + - Ascend/msdebug | ||
| 230 | + - Ascend/mskl | ||
| 231 | + - Ascend/msopprof | ||
| 232 | + - Ascend/msmodelslim | ||
| 233 | + - Ascend/msdebug-dev | ||
| 234 | + - Ascend/mskl-dev | ||
| 235 | + - Ascend/mskpp-dev | ||
| 236 | + - Ascend/msot-dev | ||
| 237 | + - Ascend/msopcom-dev | ||
| 238 | + - Ascend/msopgen-dev | ||
| 239 | + - Ascend/msopprof-dev | ||
| 240 | + - Ascend/msoptuner-dev | ||
| 241 | + - Ascend/mssanitizer-dev | ||
| 242 | + - Ascend/mstx-dev | ||
| 243 | + - Ascend/msdebug-bak | ||
| 244 | + - Ascend/mskl-bak | ||
| 245 | + - Ascend/mskpp-bak | ||
| 246 | + - Ascend/msot-bak | ||
| 247 | + - Ascend/msopcom-bak | ||
| 248 | + - Ascend/msopgen-bak | ||
| 249 | + - Ascend/msopprof-bak | ||
| 250 | + - Ascend/msoptuner-bak | ||
| 251 | + - Ascend/mssanitizer-bak | ||
| 252 | + - Ascend/mstx-bak | ||
| 253 | + - Ascend/HierarchicalKV-ascend | ||
| 254 | + - Ascend/msmodeling | ||
| 255 | + - Ascend/MindSpeed-Core-MS | ||
| 256 | + - Ascend/mscommreport | ||
| 257 | + - Ascend/Triton-distributed-ascend | ||
| 258 | + - Ascend/fbgemm-ascend | ||
| 259 | + - Ascend/msagent | ||
| 260 | + - Ascend/MindSpeed-Ops | ||
| 261 | + - Ascend/MindSpeed-Bridge | ||
| 262 | + - Ascend/Tensorpipe | ||
| 263 | + - Ascend/apex | ||
| 264 | + - Ascend/modelzoo-GPL | ||
| 265 | + - Ascend/ModelZoo-PyTorch | ||
| 266 | + - Ascend/MindSpeed-MM | ||
| 267 | + - Ascend/DrivingSDK | ||
| 268 | + - Ascend/op-plugin | ||
| 269 | + - Ascend/vision | ||
| 270 | + - Ascend/MindSpeed | ||
| 271 | + - Ascend/MindSpeed-LLM | ||
| 272 | + - Ascend/MindSpeed-RL | ||
| 273 | + - Ascend/TransferQueue | ||
| 274 | + - Ascend/slime-ascend | ||
| 275 | + lgtm_need_nums: 2 | ||
| 276 | + approve_need_nums: 1 | ||
| 277 | + branch_configs: | ||
| 278 | + - is_default: true | ||
| 279 | + merge_method: squash | ||
| 280 | + labels: | ||
| 281 | + - label: lgtm | ||
| 282 | + person: ascend-robot | ||
| 283 | + - label: approved | ||
| 284 | + person: ascend-robot | ||
| 285 | + - label: ascend-cla/yes | ||
| 286 | + person: ascend-robot | ||
| 287 | + - label: ci-pipeline-passed | ||
| 288 | + person: ascend-robot | ||
| 289 | + - repos: | ||
| 290 | + - Ascend/torchair | ||
| 291 | + lgtm_need_nums: 2 | ||
| 292 | + approve_need_nums: 1 | ||
| 293 | + branch_configs: | ||
| 294 | + - is_default: true | ||
| 295 | + merge_method: squash | ||
| 296 | + labels: | ||
| 297 | + - label: lgtm | ||
| 298 | + person: ascend-robot | ||
| 299 | + - label: approved | ||
| 300 | + person: ascend-robot | ||
| 301 | + - label: ascend-cla/yes | ||
| 302 | + person: ascend-robot | ||
| 303 | + - label: ci-pipeline-passed | ||
| 304 | + person: ascend-robot | ||
| 305 | + - repos: | ||
| 306 | + - Ascend/ascend-deployer | ||
| 307 | + lgtm_need_nums: 3 | ||
| 308 | + approve_need_nums: 1 | ||
| 309 | + branch_configs: | ||
| 310 | + - is_default: true | ||
| 311 | + merge_method: squash | ||
| 312 | + labels: | ||
| 313 | + - label: lgtm | ||
| 314 | + person: ascend-robot | ||
| 315 | + - label: approved | ||
| 316 | + person: ascend-robot | ||
| 317 | + - label: ascend-cla/yes | ||
| 318 | + person: ascend-robot | ||
| 319 | + - label: ci-pipeline-passed | ||
| 320 | + person: ascend-robot | ||
| 321 | + - branch: 5.0.0 | ||
| 322 | + merge_method: squash | ||
| 323 | + labels: | ||
| 324 | + - label: lgtm | ||
| 325 | + person: ascend-robot | ||
| 326 | + - label: approved | ||
| 327 | + person: ascend-robot | ||
| 328 | + - label: ascend-cla/yes | ||
| 329 | + person: ascend-robot | ||
| 330 | + - label: keeper_approved | ||
| 331 | + person: ascend-robot | ||
| 332 | + - label: ci-pipeline-passed | ||
| 333 | + person: ascend-robot | ||
| 334 | + - branch: 6.0.0 | ||
| 335 | + merge_method: squash | ||
| 336 | + labels: | ||
| 337 | + - label: lgtm | ||
| 338 | + person: ascend-robot | ||
| 339 | + - label: approved | ||
| 340 | + person: ascend-robot | ||
| 341 | + - label: ascend-cla/yes | ||
| 342 | + person: ascend-robot | ||
| 343 | + - label: keeper_approved | ||
| 344 | + person: ascend-robot | ||
| 345 | + - label: ci-pipeline-passed | ||
| 346 | + person: ascend-robot | ||
| 347 | + - branch: 6.0.RC1 | ||
| 348 | + merge_method: squash | ||
| 349 | + labels: | ||
| 350 | + - label: lgtm | ||
| 351 | + person: ascend-robot | ||
| 352 | + - label: approved | ||
| 353 | + person: ascend-robot | ||
| 354 | + - label: ascend-cla/yes | ||
| 355 | + person: ascend-robot | ||
| 356 | + - label: keeper_approved | ||
| 357 | + person: ascend-robot | ||
| 358 | + - label: ci-pipeline-passed | ||
| 359 | + person: ascend-robot | ||
| 360 | + - branch: 6.0.RC2 | ||
| 361 | + merge_method: squash | ||
| 362 | + labels: | ||
| 363 | + - label: lgtm | ||
| 364 | + person: ascend-robot | ||
| 365 | + - label: approved | ||
| 366 | + person: ascend-robot | ||
| 367 | + - label: ascend-cla/yes | ||
| 368 | + person: ascend-robot | ||
| 369 | + - label: keeper_approved | ||
| 370 | + person: ascend-robot | ||
| 371 | + - label: ci-pipeline-passed | ||
| 372 | + person: ascend-robot | ||
| 373 | + - branch: 6.0.RC3 | ||
| 374 | + merge_method: squash | ||
| 375 | + labels: | ||
| 376 | + - label: lgtm | ||
| 377 | + person: ascend-robot | ||
| 378 | + - label: approved | ||
| 379 | + person: ascend-robot | ||
| 380 | + - label: ascend-cla/yes | ||
| 381 | + person: ascend-robot | ||
| 382 | + - label: keeper_approved | ||
| 383 | + person: ascend-robot | ||
| 384 | + - label: ci-pipeline-passed | ||
| 385 | + person: ascend-robot | ||
| 386 | + - branch: 7.0.RC1 | ||
| 387 | + merge_method: squash | ||
| 388 | + labels: | ||
| 389 | + - label: lgtm | ||
| 390 | + person: ascend-robot | ||
| 391 | + - label: approved | ||
| 392 | + person: ascend-robot | ||
| 393 | + - label: ascend-cla/yes | ||
| 394 | + person: ascend-robot | ||
| 395 | + - label: keeper_approved | ||
| 396 | + person: ascend-robot | ||
| 397 | + - label: ci-pipeline-passed | ||
| 398 | + person: ascend-robot | ||
| 399 | + - branch: 7.1.RC1 | ||
| 400 | + merge_method: squash | ||
| 401 | + labels: | ||
| 402 | + - label: lgtm | ||
| 403 | + person: ascend-robot | ||
| 404 | + - label: approved | ||
| 405 | + person: ascend-robot | ||
| 406 | + - label: ascend-cla/yes | ||
| 407 | + person: ascend-robot | ||
| 408 | + - label: keeper_approved | ||
| 409 | + person: ascend-robot | ||
| 410 | + - label: ci-pipeline-passed | ||
| 411 | + person: ascend-robot | ||
| 412 | + - branch: 7.2.RC1 | ||
| 413 | + merge_method: squash | ||
| 414 | + labels: | ||
| 415 | + - label: lgtm | ||
| 416 | + person: ascend-robot | ||
| 417 | + - label: approved | ||
| 418 | + person: ascend-robot | ||
| 419 | + - label: ascend-cla/yes | ||
| 420 | + person: ascend-robot | ||
| 421 | + - label: keeper_approved | ||
| 422 | + person: ascend-robot | ||
| 423 | + - label: ci-pipeline-passed | ||
| 424 | + person: ascend-robot | ||
| 425 | + - repos: | ||
| 426 | + - Ascend/memcache | ||
| 427 | + - Ascend/memfabric_hybrid | ||
| 428 | + - Ascend/mind-cluster | ||
| 429 | + lgtm_need_nums: 3 | ||
| 430 | + approve_need_nums: 1 | ||
| 431 | + branch_configs: | ||
| 432 | + - is_default: true | ||
| 433 | + merge_method: squash | ||
| 434 | + labels: | ||
| 435 | + - label: lgtm | ||
| 436 | + person: ascend-robot | ||
| 437 | + - label: approved | ||
| 438 | + person: ascend-robot | ||
| 439 | + - label: ascend-cla/yes | ||
| 440 | + person: ascend-robot | ||
| 441 | + - label: ci-pipeline-passed | ||
| 442 | + person: ascend-robot | ||
| 443 | + - branch: branch_v5.0.0 | ||
| 444 | + merge_method: squash | ||
| 445 | + labels: | ||
| 446 | + - label: lgtm | ||
| 447 | + person: ascend-robot | ||
| 448 | + - label: approved | ||
| 449 | + person: ascend-robot | ||
| 450 | + - label: ascend-cla/yes | ||
| 451 | + person: ascend-robot | ||
| 452 | + - label: keeper_approved | ||
| 453 | + person: ascend-robot | ||
| 454 | + - label: ci-pipeline-passed | ||
| 455 | + person: ascend-robot | ||
| 456 | + - branch: branch_v6.0.0 | ||
| 457 | + merge_method: squash | ||
| 458 | + labels: | ||
| 459 | + - label: lgtm | ||
| 460 | + person: ascend-robot | ||
| 461 | + - label: approved | ||
| 462 | + person: ascend-robot | ||
| 463 | + - label: ascend-cla/yes | ||
| 464 | + person: ascend-robot | ||
| 465 | + - label: keeper_approved | ||
| 466 | + person: ascend-robot | ||
| 467 | + - label: ci-pipeline-passed | ||
| 468 | + person: ascend-robot | ||
| 469 | + - branch: branch_v6.0.RC3 | ||
| 470 | + merge_method: squash | ||
| 471 | + labels: | ||
| 472 | + - label: lgtm | ||
| 473 | + person: ascend-robot | ||
| 474 | + - label: approved | ||
| 475 | + person: ascend-robot | ||
| 476 | + - label: ascend-cla/yes | ||
| 477 | + person: ascend-robot | ||
| 478 | + - label: keeper_approved | ||
| 479 | + person: ascend-robot | ||
| 480 | + - label: ci-pipeline-passed | ||
| 481 | + person: ascend-robot | ||
| 482 | + - branch: branch_v7.0.RC1 | ||
| 483 | + merge_method: squash | ||
| 484 | + labels: | ||
| 485 | + - label: lgtm | ||
| 486 | + person: ascend-robot | ||
| 487 | + - label: approved | ||
| 488 | + person: ascend-robot | ||
| 489 | + - label: ascend-cla/yes | ||
| 490 | + person: ascend-robot | ||
| 491 | + - label: keeper_approved | ||
| 492 | + person: ascend-robot | ||
| 493 | + - label: ci-pipeline-passed | ||
| 494 | + person: ascend-robot | ||
| 495 | + - branch: branch_v7.1.RC1 | ||
| 496 | + merge_method: squash | ||
| 497 | + labels: | ||
| 498 | + - label: lgtm | ||
| 499 | + person: ascend-robot | ||
| 500 | + - label: approved | ||
| 501 | + person: ascend-robot | ||
| 502 | + - label: ascend-cla/yes | ||
| 503 | + person: ascend-robot | ||
| 504 | + - label: keeper_approved | ||
| 505 | + person: ascend-robot | ||
| 506 | + - label: ci-pipeline-passed | ||
| 507 | + person: ascend-robot | ||
| 508 | + - branch: branch_pre | ||
| 509 | + merge_method: squash | ||
| 510 | + labels: | ||
| 511 | + - label: lgtm | ||
| 512 | + person: ascend-robot | ||
| 513 | + - label: approved | ||
| 514 | + person: ascend-robot | ||
| 515 | + - label: ascend-cla/yes | ||
| 516 | + person: ascend-robot | ||
| 517 | + - branch: branch_v7.2.RC1 | ||
| 518 | + merge_method: squash | ||
| 519 | + labels: | ||
| 520 | + - label: lgtm | ||
| 521 | + person: ascend-robot | ||
| 522 | + - label: approved | ||
| 523 | + person: ascend-robot | ||
| 524 | + - label: ascend-cla/yes | ||
| 525 | + person: ascend-robot | ||
| 526 | + - label: keeper_approved | ||
| 527 | + person: ascend-robot | ||
| 528 | + - label: ci-pipeline-passed | ||
| 529 | + person: ascend-robot | ||
| 530 | + - branch: branch_v7.3.0 | ||
| 531 | + merge_method: squash | ||
| 532 | + labels: | ||
| 533 | + - label: lgtm | ||
| 534 | + person: ascend-robot | ||
| 535 | + - label: approved | ||
| 536 | + person: ascend-robot | ||
| 537 | + - label: ascend-cla/yes | ||
| 538 | + person: ascend-robot | ||
| 539 | + - label: keeper_approved | ||
| 540 | + person: ascend-robot | ||
| 541 | + - label: ci-pipeline-passed | ||
| 542 | + person: ascend-robot | ||
| 543 | + - repos: | ||
| 544 | + - Ascend/AgentSDK | ||
| 545 | + - Ascend/IndexSDK | ||
| 546 | + - Ascend/MutiModalSDK | ||
| 547 | + - Ascend/RAGSDK | ||
| 548 | + - Ascend/VisionSDK | ||
| 549 | + - Ascend/MindInferenceService | ||
| 550 | + - Ascend/MEF | ||
| 551 | + - Ascend/OMSDK | ||
| 552 | + - Ascend/MultimodalSDK | ||
| 553 | + lgtm_need_nums: 3 | ||
| 554 | + approve_need_nums: 1 | ||
| 555 | + branch_configs: | ||
| 556 | + - is_default: true | ||
| 557 | + merge_method: squash | ||
| 558 | + labels: | ||
| 559 | + - label: lgtm | ||
| 560 | + person: ascend-robot | ||
| 561 | + - label: approved | ||
| 562 | + person: ascend-robot | ||
| 563 | + - label: ascend-cla/yes | ||
| 564 | + person: ascend-robot | ||
| 565 | + - label: ci-pipeline-passed | ||
| 566 | + person: ascend-robot | ||
| 567 | + - repos: | ||
| 568 | + - Ascend/ascend-docker-image | ||
| 569 | + - Ascend/mindcluster-deploy | ||
| 570 | + lgtm_need_nums: 3 | ||
| 571 | + approve_need_nums: 1 | ||
| 572 | + branch_configs: | ||
| 573 | + - is_default: true | ||
| 574 | + merge_method: squash | ||
| 575 | + labels: | ||
| 576 | + - label: lgtm | ||
| 577 | + person: ascend-robot | ||
| 578 | + - label: approved | ||
| 579 | + person: ascend-robot | ||
| 580 | + - label: ascend-cla/yes | ||
| 581 | + person: ascend-robot | ||
| 582 | + - branch: branch_v5.0.0 | ||
| 583 | + merge_method: squash | ||
| 584 | + labels: | ||
| 585 | + - label: lgtm | ||
| 586 | + person: ascend-robot | ||
| 587 | + - label: approved | ||
| 588 | + person: ascend-robot | ||
| 589 | + - label: ascend-cla/yes | ||
| 590 | + person: ascend-robot | ||
| 591 | + - label: keeper_approved | ||
| 592 | + person: ascend-robot | ||
| 593 | + - branch: branch_v6.0.0 | ||
| 594 | + merge_method: squash | ||
| 595 | + labels: | ||
| 596 | + - label: lgtm | ||
| 597 | + person: ascend-robot | ||
| 598 | + - label: approved | ||
| 599 | + person: ascend-robot | ||
| 600 | + - label: ascend-cla/yes | ||
| 601 | + person: ascend-robot | ||
| 602 | + - label: keeper_approved | ||
| 603 | + person: ascend-robot | ||
| 604 | + - branch: branch_v6.0.RC3 | ||
| 605 | + merge_method: squash | ||
| 606 | + labels: | ||
| 607 | + - label: lgtm | ||
| 608 | + person: ascend-robot | ||
| 609 | + - label: approved | ||
| 610 | + person: ascend-robot | ||
| 611 | + - label: ascend-cla/yes | ||
| 612 | + person: ascend-robot | ||
| 613 | + - label: keeper_approved | ||
| 614 | + person: ascend-robot | ||
| 615 | + - branch: branch_v7.0.RC1 | ||
| 616 | + merge_method: squash | ||
| 617 | + labels: | ||
| 618 | + - label: lgtm | ||
| 619 | + person: ascend-robot | ||
| 620 | + - label: approved | ||
| 621 | + person: ascend-robot | ||
| 622 | + - label: ascend-cla/yes | ||
| 623 | + person: ascend-robot | ||
| 624 | + - label: keeper_approved | ||
| 625 | + person: ascend-robot | ||
| 626 | + - branch: branch_v7.1.RC1 | ||
| 627 | + merge_method: squash | ||
| 628 | + labels: | ||
| 629 | + - label: lgtm | ||
| 630 | + person: ascend-robot | ||
| 631 | + - label: approved | ||
| 632 | + person: ascend-robot | ||
| 633 | + - label: ascend-cla/yes | ||
| 634 | + person: ascend-robot | ||
| 635 | + - label: keeper_approved | ||
| 636 | + person: ascend-robot | ||
| 637 | + - branch: branch_v7.2.RC1 | ||
| 638 | + merge_method: squash | ||
| 639 | + labels: | ||
| 640 | + - label: lgtm | ||
| 641 | + person: ascend-robot | ||
| 642 | + - label: approved | ||
| 643 | + person: ascend-robot | ||
| 644 | + - label: ascend-cla/yes | ||
| 645 | + person: ascend-robot | ||
| 646 | + - label: keeper_approved | ||
| 647 | + person: ascend-robot | ||
| 648 | + - repos: | ||
| 649 | + - Ascend/mindsdk-referenceapps | ||
| 650 | + lgtm_need_nums: 3 | ||
| 651 | + approve_need_nums: 1 | ||
| 652 | + branch_configs: | ||
| 653 | + - is_default: true | ||
| 654 | + merge_method: squash | ||
| 655 | + labels: | ||
| 656 | + - label: lgtm | ||
| 657 | + person: ascend-robot | ||
| 658 | + - label: approved | ||
| 659 | + person: ascend-robot | ||
| 660 | + - label: ascend-cla/yes | ||
| 661 | + person: ascend-robot | ||
| 662 | + - repos: | ||
| 663 | + - Ascend/RecSDK | ||
| 664 | + lgtm_need_nums: 3 | ||
| 665 | + approve_need_nums: 1 | ||
| 666 | + branch_configs: | ||
| 667 | + - is_default: true | ||
| 668 | + merge_method: squash | ||
| 669 | + labels: | ||
| 670 | + - label: lgtm | ||
| 671 | + person: ascend-robot | ||
| 672 | + - label: approved | ||
| 673 | + person: ascend-robot | ||
| 674 | + - label: ascend-cla/yes | ||
| 675 | + person: ascend-robot | ||
| 676 | + - label: ci-pipeline-passed | ||
| 677 | + person: ascend-robot | ||
| 678 | + - branch: branch_v6.0.0 | ||
| 679 | + merge_method: squash | ||
| 680 | + labels: | ||
| 681 | + - label: lgtm | ||
| 682 | + person: ascend-robot | ||
| 683 | + - label: approved | ||
| 684 | + person: ascend-robot | ||
| 685 | + - label: ascend-cla/yes | ||
| 686 | + person: ascend-robot | ||
| 687 | + - label: ci-pipeline-passed | ||
| 688 | + person: ascend-robot | ||
| 689 | + - label: keeper_approved | ||
| 690 | + person: ascend-robot | ||
| 691 | + - branch: branch_v6.0.0-RC1 | ||
| 692 | + merge_method: squash | ||
| 693 | + labels: | ||
| 694 | + - label: lgtm | ||
| 695 | + person: ascend-robot | ||
| 696 | + - label: approved | ||
| 697 | + person: ascend-robot | ||
| 698 | + - label: ascend-cla/yes | ||
| 699 | + person: ascend-robot | ||
| 700 | + - label: ci-pipeline-passed | ||
| 701 | + person: ascend-robot | ||
| 702 | + - label: keeper_approved | ||
| 703 | + person: ascend-robot | ||
| 704 | + - branch: branch_v6.0.0-RC2 | ||
| 705 | + merge_method: squash | ||
| 706 | + labels: | ||
| 707 | + - label: lgtm | ||
| 708 | + person: ascend-robot | ||
| 709 | + - label: approved | ||
| 710 | + person: ascend-robot | ||
| 711 | + - label: ascend-cla/yes | ||
| 712 | + person: ascend-robot | ||
| 713 | + - label: ci-pipeline-passed | ||
| 714 | + person: ascend-robot | ||
| 715 | + - label: keeper_approved | ||
| 716 | + person: ascend-robot | ||
| 717 | + - branch: branch_v6.0.0-RC3 | ||
| 718 | + merge_method: squash | ||
| 719 | + labels: | ||
| 720 | + - label: lgtm | ||
| 721 | + person: ascend-robot | ||
| 722 | + - label: approved | ||
| 723 | + person: ascend-robot | ||
| 724 | + - label: ascend-cla/yes | ||
| 725 | + person: ascend-robot | ||
| 726 | + - label: ci-pipeline-passed | ||
| 727 | + person: ascend-robot | ||
| 728 | + - label: keeper_approved | ||
| 729 | + person: ascend-robot | ||
| 730 | + - branch: branch_v7.0.0-RC1 | ||
| 731 | + merge_method: squash | ||
| 732 | + labels: | ||
| 733 | + - label: lgtm | ||
| 734 | + person: ascend-robot | ||
| 735 | + - label: approved | ||
| 736 | + person: ascend-robot | ||
| 737 | + - label: ascend-cla/yes | ||
| 738 | + person: ascend-robot | ||
| 739 | + - label: ci-pipeline-passed | ||
| 740 | + person: ascend-robot | ||
| 741 | + - label: keeper_approved | ||
| 742 | + person: ascend-robot | ||
| 743 | + - branch: branch_v7.1.0-RC1 | ||
| 744 | + merge_method: squash | ||
| 745 | + labels: | ||
| 746 | + - label: lgtm | ||
| 747 | + person: ascend-robot | ||
| 748 | + - label: approved | ||
| 749 | + person: ascend-robot | ||
| 750 | + - label: ascend-cla/yes | ||
| 751 | + person: ascend-robot | ||
| 752 | + - label: ci-pipeline-passed | ||
| 753 | + person: ascend-robot | ||
| 754 | + - label: keeper_approved | ||
| 755 | + person: ascend-robot | ||
| 756 | + - branch: branch_v7.2.0-RC1 | ||
| 757 | + merge_method: squash | ||
| 758 | + labels: | ||
| 759 | + - label: lgtm | ||
| 760 | + person: ascend-robot | ||
| 761 | + - label: approved | ||
| 762 | + person: ascend-robot | ||
| 763 | + - label: ascend-cla/yes | ||
| 764 | + person: ascend-robot | ||
| 765 | + - label: ci-pipeline-passed | ||
| 766 | + person: ascend-robot | ||
| 767 | + - label: keeper_approved | ||
| 768 | + person: ascend-robot | ||
| 769 | + - branch: develop_torch_benchmark | ||
| 770 | + merge_method: squash | ||
| 771 | + labels: | ||
| 772 | + - label: lgtm | ||
| 773 | + person: ascend-robot | ||
| 774 | + - label: approved | ||
| 775 | + person: ascend-robot | ||
| 776 | + - label: ascend-cla/yes | ||
| 777 | + person: ascend-robot | ||
| 778 | + - branch: feat_ngo | ||
| 779 | + merge_method: squash | ||
| 780 | + labels: | ||
| 781 | + - label: lgtm | ||
| 782 | + person: ascend-robot | ||
| 783 | + - label: approved | ||
| 784 | + person: ascend-robot | ||
| 785 | + - label: ascend-cla/yes | ||
| 786 | + person: ascend-robot | ||
| 787 | + - branch: develop_embcache_tmp | ||
| 788 | + merge_method: squash | ||
| 789 | + labels: | ||
| 790 | + - label: lgtm | ||
| 791 | + person: ascend-robot | ||
| 792 | + - label: approved | ||
| 793 | + person: ascend-robot | ||
| 794 | + - label: ascend-cla/yes | ||
| 795 | + person: ascend-robot | ||
| 796 | + - branch: develop_tf_xla_npu | ||
| 797 | + merge_method: squash | ||
| 798 | + labels: | ||
| 799 | + - label: lgtm | ||
| 800 | + person: ascend-robot | ||
| 801 | + - label: approved | ||
| 802 | + person: ascend-robot | ||
| 803 | + - label: ascend-cla/yes | ||
| 804 | + person: ascend-robot | ||
| 805 | + - repos: | ||
| 806 | + - Ascend/pytorch | ||
| 807 | + lgtm_need_nums: 2 | ||
| 808 | + approve_need_nums: 1 | ||
| 809 | + branch_configs: | ||
| 810 | + - is_default: true | ||
| 811 | + merge_method: squash | ||
| 812 | + labels: | ||
| 813 | + - label: lgtm | ||
| 814 | + person: ascend-robot | ||
| 815 | + - label: approved | ||
| 816 | + person: ascend-robot | ||
| 817 | + - label: ascend-cla/yes | ||
| 818 | + person: ascend-robot | ||
| 819 | + - label: ci-pipeline-passed | ||
| 820 | + person: ascend-robot | ||
| 821 | + - repos: | ||
| 822 | + - Ascend/triton-ascend-kernels | ||
| 823 | + lgtm_need_nums: 2 | ||
| 824 | + approve_need_nums: 1 | ||
| 825 | + branch_configs: | ||
| 826 | + - is_default: true | ||
| 827 | + merge_method: squash | ||
| 828 | + labels: | ||
| 829 | + - label: lgtm | ||
| 830 | + person: ascend-robot | ||
| 831 | + - label: approved | ||
| 832 | + person: ascend-robot | ||
| 833 | + - label: ascend-cla/yes | ||
| 834 | + person: ascend-robot | ||
| 835 | + - label: ci-pipeline-passed | ||
| 836 | + person: cann-robot | ||
| 837 | + - repos: | ||
| 838 | + - Ascend/triton-ascend | ||
| 839 | + lgtm_need_nums: 2 | ||
| 840 | + approve_need_nums: 1 | ||
| 841 | + branch_configs: | ||
| 842 | + - is_default: true | ||
| 843 | + merge_method: merge | ||
| 844 | + labels: | ||
| 845 | + - label: lgtm | ||
| 846 | + person: ascend-robot | ||
| 847 | + - label: approved | ||
| 848 | + person: ascend-robot | ||
| 849 | + - label: ascend-cla/yes | ||
| 850 | + person: ascend-robot | ||
| 851 | + - label: ci-pipeline-passed | ||
| 852 | + person: cann-robot | ||
| 853 | + - branch: main | ||
| 854 | + merge_method: merge | ||
| 855 | + labels: | ||
| 856 | + - label: lgtm | ||
| 857 | + person: ascend-robot | ||
| 858 | + - label: approved | ||
| 859 | + person: ascend-robot | ||
| 860 | + - label: ascend-cla/yes | ||
| 861 | + person: ascend-robot | ||
| 862 | + - label: ci-pipeline-passed | ||
| 863 | + person: cann-robot | ||
| 864 | + - label: SC-SUCC | ||
| 865 | + person: cann-robot | ||
| 866 | + - branch: master | ||
| 867 | + merge_method: merge | ||
| 868 | + labels: | ||
| 869 | + - label: lgtm | ||
| 870 | + person: ascend-robot | ||
| 871 | + - label: approved | ||
| 872 | + person: ascend-robot | ||
| 873 | + - label: ascend-cla/yes | ||
| 874 | + person: ascend-robot | ||
| 875 | + - label: ci-pipeline-passed | ||
| 876 | + person: cann-robot | ||
| 877 | + - label: SC-SUCC | ||
| 878 | + person: cann-robot | ||