Skip to content

feat(release): support independent G2 release lines - #7

Merged
MyLeeJiEun merged 1 commit into
linuxdeepin:masterfrom
MyLeeJiEun:feat/multi-release-lines-20261117
Nov 20, 2026
Merged

MyLeeJiEun merged 1 commit into
linuxdeepin:masterfrom
MyLeeJiEun:feat/multi-release-lines-20261117

Conversation

@MyLeeJiEun

@MyLeeJiEun MyLeeJiEun commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

背景

G2 当前只有一套组版本和发布分支,无法让多个版本线并行准备、发布和记录状态。本 PR 在 dde 中增加发布线配置、协调器输入、成员基线分支和发布记录隔离。

变更

  • 新增 release_lines.<line>.member_branch/bases,发布线 ID 与成员分支独立映射。
  • Release group 接收 release_line,派发成员时继续复用现有 base_branch 输入。
  • G2 组版本按发布线独立记录,基线分支按发布线隔离。
  • Sync 与 guard 校验成员分支、固定基准 SHA、本轮版本和发布记录,阻止旧线回退或跨线混用。
  • 新增 Propose release line,允许从成员仓库已有分支固定本次基准 SHA 并生成配置 PR。
  • 保留 G1 原有行为,master 发布线保持兼容。

验证

  • 协调器与共享 checks 离线测试:23/23。
  • Release group 在测试组织完成真实派发,17 个成员均创建了 6.8.3 发布 PR。
  • Python 编译、workflow YAML 解析和 git diff --check 通过。

配对 PR:linuxdeepin/.github#818

Summary by Sourcery

Enable independent G2 release lines with isolated member branches, baselines, versions, and validated release records while retaining existing G1 and master-line behavior.

New Features:

  • Add configurable G2 release lines with independent member branches, baselines, versions, and release records.
  • Add a workflow for proposing a new release line from an existing member-branch snapshot with fixed commit baselines.

Bug Fixes:

  • Prevent stale, cross-line, or inconsistent release and baseline records from being reused during synchronization and release preparation.

Enhancements:

  • Preserve G1 behavior and maintain compatibility with the existing G2 master release line.
  • Strengthen member workflow, branch, version, commit, and protection readiness validation for G2 releases.

CI:

  • Update release and baseline workflows to accept release-line inputs, isolate concurrency, and coordinate per-line validation and publishing.

Chores:

  • Extend groups.yaml to store G2 versions and member snapshots by release line.

@sourcery-ai

sourcery-ai Bot commented Nov 17, 2026

Copy link
Copy Markdown

Sorry @MyLeeJiEun, your pull request is larger than the review limit of 150,000 diff characters

@sourcery-ai

sourcery-ai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Configuration

Define G2 release-line configuration and independently versioned baselines, then expose and deploy the release-line workflows and coordinator changes that consume that configuration.

  • .github/workflows/propose-release-line.yml L1-66
  • .github/workflows/release-group.yml L24-28 (+4 small edits)
  • .github/workflows/sync-baseline.yml L214-303, L512-556, L839-872 (+38 small edits)
  • groups.yaml L3-17, L41-42

Other changes

Files not grouped.

  • .github/scripts/propose_release_line.py L1-280
  • .github/scripts/release_line_checks.py L1-345

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New security issues found

Comment thread .github/scripts/release_line_checks.py Resolved
@MyLeeJiEun
MyLeeJiEun force-pushed the feat/multi-release-lines-20261117 branch from 0a0266b to 501325d Compare November 18, 2026 03:08
@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

🤖 AI 代码审查报告

总体评分: 86 分 (通过阈值: 70分)

Pass


📊 总体评价

项目 结果
审查结论 代码审查通过
评分详情 本次 PR 为 DDE 项目新增 G2 独立发布线支持,涉及新增 propose_release_line.py、release_line_checks.py 两个脚本和 propose-release-line.yml 工作流,并大幅重构 sync-baseline.yml 与 groups.yaml 配置。 代码整体架构清晰、校验逻辑严密,使用了大量防御性检查确保发布线配置的一致性与安全性。 语法逻辑维度存在少量边界异常未捕获的轻微问题;代码质量维度存在函数过长、硬编码数值及少量代码重复; 性能维度有部分可并行化的串行 API 调用;安全维度无漏洞。综合评分 86 分,审查通过。

🔍 详细分析

1. 语法逻辑 ✅

评价: 语法正确,逻辑清晰 ✅ 通过

潜在问题:
✅ 未发现明显问题

建议: 1. 在 json.loads 调用处增加 try/except (json.JSONDecodeError, IndexError) 捕获,
转为 RuntimeError 并附描述性消息。
2. 在 value.get("errors") 前增加 isinstance(value, dict) 类型守卫。


2. 代码质量 ❌

评价: 存在重复代码,结构需要优化 ❌ 不通过

潜在问题:
✅ 未发现明显问题

建议: 1. 将 propose()、start()、check_ordinary() 等长函数拆分为更小的子函数。 2. 将硬编码的 "17" 替换为 len(members) 或命名常量。 3. 将 rewrite() 等共用逻辑提取到 release_line_checks.py 统一维护。 4. 统一深度限制为命名常量 MAX_TRAVERSAL_DEPTH = 100。 5. 为 sync-baseline.yml 的 job 添加 timeout-minutes 设置。


3. 代码性能 ✅

评价: 性能良好,资源使用合理 ✅ 通过

潜在问题:
✅ 未发现明显问题

建议: 1. 将 snapshot() 中的成员循环改为 parallel() 并行调用。 2. 在 validate_config() 中缓存 repo_names 结果避免重复计算。 3. 对 source_idle() 中的成员 PR 检查考虑并行化。


4. 代码安全 🔒

评价: 存在0个安全漏洞 ✅ 通过

🔐 发现 0 个安全漏洞

安全漏洞详情:
✅ 未发现安全漏洞

建议: 无安全改进建议


💡 改进建议代码示例

# 1. json.loads 异常捕获示例(propose_release_line.py) try:
    release = json.loads(commit["message"].split(RELEASE_MARKER, 1)[1].split("\n-->", 1)[0])
except (json.JSONDecodeError, IndexError) as exc:
    raise RuntimeError(f"{branch} 的发布记录 JSON 解析失败: {exc}") from exc

# 2. value.get 类型守卫示例(release_line_checks.py api() 函数) if path == "graphql" and isinstance(value, dict) and value.get("errors"):
    raise RuntimeError(f"GitHub GraphQL 失败: {value['errors']}")

# 3. 硬编码数值修复示例(propose_release_line.py) raise RuntimeError(f"草稿 bases 必须恰好包含 G2 的 {len(members)} 个成员 ID")

本报告由 AI 代码审查工具自动生成

@MyLeeJiEun
MyLeeJiEun force-pushed the feat/multi-release-lines-20261117 branch 2 times, most recently from b8fe207 to a690e06 Compare November 19, 2026 03:35
@MyLeeJiEun

Copy link
Copy Markdown
Contributor Author

/test all

1 similar comment
@MyLeeJiEun

Copy link
Copy Markdown
Contributor Author

/test all

@MyLeeJiEun

Copy link
Copy Markdown
Contributor Author

/test github-pr-review-ci

BLumia
BLumia previously approved these changes Nov 19, 2026
@MyLeeJiEun
MyLeeJiEun force-pushed the feat/multi-release-lines-20261117 branch 2 times, most recently from 458418b to e42c126 Compare November 19, 2026 12:00
1. Add release_lines configuration with member branches and fixed base SHAs.
2. Pass release_line through Release group while reusing base_branch.
3. Isolate baseline versions and records per G2 release line.
4. Accept existing member branches and preserve configuration comments.

Log: Add isolated G2 release-line coordination and release records.
Influence: Enables independent G2 delivery.

feat(release): 支持独立 G2 发布线

1. 新增 release_lines 配置,记录成员分支与固定基准 SHA。
2. Release group 传入 release_line,并复用 base_branch。
3. 按 G2 发布线隔离基线版本与发布记录。
4. 支持已有成员分支并保留配置注释。

Log: 新增隔离的 G2 发布线协调与发布记录。
PMS: TASK-398637
Influence: 支持多条 G2 发布线独立交付。
@MyLeeJiEun
MyLeeJiEun force-pushed the feat/multi-release-lines-20261117 branch from e42c126 to 5a95920 Compare November 19, 2026 13:07
@MyLeeJiEun
MyLeeJiEun requested a review from BLumia November 20, 2026 07:21
@deepin-ci-robot

Copy link
Copy Markdown

[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.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@MyLeeJiEun
MyLeeJiEun merged commit fab99a5 into linuxdeepin:master Nov 20, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants