Repository navigation
feat(ci): add DDE group version guard - #817
Conversation
|
Sorry @MyLeeJiEun, you've used your own review budget of 250,000 diff characters for the last 7 days. You can request another review in 2 days and 1 hour by commenting |
Reviewer's GuideAPIAdd the reusable workflow and caller template that expose the group-version check to member repositories.
ConfigurationInstall the guard template through sync configuration for the 25 G1-G2 member repositories.
DocumentationDocument the guard’s validation model, rollout boundaries, and required-check setup.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
a4f43d5 to
6339c63
Compare
6339c63 to
ceb9406
Compare
ceb9406 to
2af3880
Compare
53e9e93 to
a451d47
Compare
Add the shared guard workflow, caller template, and sync configs for the 25 G1-G2 members. Log: Add the DDE group version guard. Influence: Current group member PRs can be validated against DDE release records. PMS: TASK-398637
a451d47 to
cdf15c3
Compare
deepin pr auto review🤖 AI 代码审查报告📊 总体评价
🔍 详细分析1. 语法逻辑 ✅评价: 语法正确,逻辑清晰 ✅ 通过 潜在问题: 建议: ['在获取 baseline_pr 后增加对其状态的判断逻辑,或在使用 state:"all" 的同时 增加 baseline_pr["state"] == "open" 或 merged_at 的校验,确保不会使用 已放弃的过期发布记录'] 2. 代码质量 ✅评价: 代码结构清晰,注释完整 ✅ 通过 潜在问题: 建议: [{'在 verify job 中添加 timeout-minutes': '15 或适当值'}, '考虑将公共逻辑提取到独立脚本文件中以消除 identity() 重复', '统一 go-dbus-factory.json 中的键名为 "branches" 或确认两种形式均被支持', '为关键函数添加 docstring 说明参数和返回值'] 3. 代码性能 ✅评价: 性能良好,资源使用合理 ✅ 通过 潜在问题: 建议: ['为 api() 函数添加简单的重试逻辑(如 3 次重试 + 指数退避)', '考虑对 release_record 的遍历结果做短期缓存(同一 PR 校验周期内)'] 4. 代码安全 🔒评价: 存在0个安全漏洞 ✅ 通过
安全漏洞详情: 建议: ['安全配置完善,建议保持当前权限模型。可考虑在未来版本中增加对 API 响应 数据的 schema 校验以增强防御性编程'] 💡 改进建议代码示例# .github/workflows/verify-group-version.yml - 建议改进
jobs:
verify:
name: Verify group version
runs-on: ubuntu-latest
timeout-minutes: 15 # 添加超时设置
concurrency:
group: group-version-guard-${{ github.event.pull_request.head.sha }}
cancel-in-progress: false
# api() 函数添加重试逻辑
def api(path, paginate=False, retries=3):
import time
args = ["gh", "api", path]
if paginate:
args += ["--paginate", "--slurp"]
for attempt in range(retries):
result = subprocess.run(args, capture_output=True, text=True)
if not result.returncode:
break
if attempt < retries - 1:
time.sleep(2 ** attempt)
if result.returncode:
raise RuntimeError(f"GitHub API 失败: {path}: {result.stderr.strip()}")
value = json.loads(result.stdout)
return [item for page in value for item in page] if paginate else value
# baseline PR 查询建议增加状态校验
# 在获取 baseline_pr 后添加:
# if baseline_pr["state"] not in ("open", "closed"):
# raise RuntimeError("DDE 基线 PR 状态异常")
# # closed 且 merged_at 为 None 表示被放弃,不应使用本报告由 AI 代码审查工具自动生成 |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: BLumia, MyLeeJiEun The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
变更内容
verify-group-version.yml、成员调用模板和 25 份仓库同步配置。dde-polkit-agent、dde-session-ui、dde-clipboard、dcc-insider-plugin、deepin-pw-check、dde-app-services,保留dde-appearance。dde的原始发布记录,包括仓库、分支、目标版本、epoch 和创建时间。验证
test_verify_group_version.py:33 项通过。.github中的 25 份 guard JSON 与dde/groups.yaml的仓库映射一致,无缺失或多余。上线边界
本 PR 只安装公共工作流、调用模板和同步配置,不直接启用成员必需检查。上线后仍需逐仓库读回入口,验证状态来源,再按部署文档依次试点 G1、启用 G2。