Skip to content

feat(changelog): sync linglong.yaml version and enable workflow for app repos - #803

Open
mhduiy wants to merge 1 commit into
linuxdeepin:masterfrom
mhduiy:master
Open

feat(changelog): sync linglong.yaml version and enable workflow for app repos#803
mhduiy wants to merge 1 commit into
linuxdeepin:masterfrom
mhduiy:master

Conversation

@mhduiy

@mhduiy mhduiy commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  1. update-changelog.yml: auto-detect linglong*.yaml in repo root. If package.version's base version matches the current changelog version, sync it with the new changelog version, keeping the numeric suffix (e.g. 7.0.64.17.0.65.1). Projects with independent linglong versions are skipped automatically.

  2. App repos: add call-update-changelog.yml entries to 39 linuxdeepin app repos (38 appended + 2 new configs for deepin-scanner and udisks2-qt6). Branch lists were verified against actual remote branches (master/develop/snipe/release/snipe/release/eagle).

Testing

Verified on peeweep-test/dtkcore-test:

  • changelog 5.6.23 + linglong 5.6.23.1 → PR updates both to 5.6.24 / 5.6.24.1
  • changelog 5.6.23 + independent linglong 5.6.3 → linglong skipped, changelog only ✓

Log: sync linglong version in changelog update workflow for app repos
Influence: update-changelog workflow for app projects

Summary by Sourcery

Keep compatible linglong package versions aligned with changelog updates and expand workflow configuration across LinuxDeepin application repositories.

New Features:

  • Synchronize matching linglong package versions with changelog releases while preserving numeric suffixes and skipping independently versioned packages.
  • Enable automated changelog update workflow coverage for additional LinuxDeepin application repositories, including deepin-scanner and udisks2-qt6.

Enhancements:

  • Include synchronized linglong manifest files in generated diffs, artifacts, and pull requests.

1. update-changelog.yml: auto-detect linglong*.yaml and sync package.version
   when its base version matches the current changelog version, keeping the
   numeric suffix (e.g. 7.0.64.1 -> 7.0.65.1). Independent versions are skipped.
2. Add call-update-changelog entry to 37 app repos (branches verified against
   actual remote branches: master/develop/snipe/release/snipe/release/eagle).
3. Create configs for deepin-scanner and udisks2-qt6.

Log: sync linglong version in changelog update workflow for app repos
Influence: update-changelog workflow for app projects
@deepin-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: mhduiy

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

@sourcery-ai

sourcery-ai Bot commented Aug 18, 2026

Copy link
Copy Markdown

Reviewer's Guide

Extends the update-changelog workflow to detect and synchronize linglong YAML package versions with debian/changelog and wires this workflow into multiple linuxdeepin app repositories via new/updated repo config entries.

Sequence diagram for syncing linglong.yaml in update-changelog workflow

sequenceDiagram
    actor Developer
    participant AppRepo
    participant GitHubActions
    participant update_changelog_workflow as update-changelog.yml
    participant sync_linglong as Sync_linglong_step

    Developer->>AppRepo: Push changelog change
    AppRepo->>GitHubActions: Trigger update-changelog.yml
    GitHubActions->>update_changelog_workflow: Run workflow
    update_changelog_workflow->>update_changelog_workflow: prepare step outputs version and current_version
    update_changelog_workflow->>sync_linglong: Sync linglong.yaml version
    alt linglong*.yaml present and version matches base
        sync_linglong->>sync_linglong: Update linglong*.yaml versions
        sync_linglong-->>update_changelog_workflow: files output includes debian/changelog and linglong*.yaml
    else no matching linglong version
        sync_linglong-->>update_changelog_workflow: files output debian/changelog only
    end
    update_changelog_workflow->>GitHubActions: Create pull request with add-paths = files
    GitHubActions-->>Developer: PR with synced debian/changelog and linglong*.yaml
Loading

File-Level Changes

Change Details Files
Extend update-changelog workflow to emit current version metadata and sync linglong*.yaml package.version with changelog bumps.
  • Expose current_version from the prepare step as a workflow output alongside version and safe_version.
  • Add a Python-based Sync linglong.yaml version step that locates linglong*.yaml at the repo root and updates package.version when its base version matches the old changelog version, preserving numeric suffixes where present.
  • Ensure projects without linglong YAML files or with independent linglong versions fall back to updating only debian/changelog while still producing correct add-paths outputs.
  • Update downstream steps to diff both debian/changelog and linglong*.yaml, upload them as artifacts, and pass the dynamically computed path list to the Create pull request step.
.github/workflows/update-changelog.yml
Register app repositories to use the update-changelog workflow via call-update-changelog configuration.
  • Append or adjust call-update-changelog configuration for existing linuxdeepin application repositories so their changelog updates now also manage linglong version syncing.
  • Introduce new repo configuration entries for deepin-scanner and udisks2-qt6 with appropriate branch lists to participate in the workflow.
repos/linuxdeepin/dde-calendar.json
repos/linuxdeepin/dde-cooperation.json
repos/linuxdeepin/dde-device-formatter.json
repos/linuxdeepin/dde-file-manager.json
repos/linuxdeepin/dde-grand-search.json
repos/linuxdeepin/deepin-album.json
repos/linuxdeepin/deepin-anything.json
repos/linuxdeepin/deepin-boot-maker.json
repos/linuxdeepin/deepin-calculator.json
repos/linuxdeepin/deepin-camera.json
repos/linuxdeepin/deepin-compressor.json
repos/linuxdeepin/deepin-deb-installer.json
repos/linuxdeepin/deepin-devicemanager.json
repos/linuxdeepin/deepin-diskmanager.json
repos/linuxdeepin/deepin-downloader.json
repos/linuxdeepin/deepin-draw.json
repos/linuxdeepin/deepin-editor.json
repos/linuxdeepin/deepin-fcitx5configtool-plugin.json
repos/linuxdeepin/deepin-font-manager.json
repos/linuxdeepin/deepin-gomoku.json
repos/linuxdeepin/deepin-image-viewer.json
repos/linuxdeepin/deepin-lianliankan.json
repos/linuxdeepin/deepin-log-viewer.json
repos/linuxdeepin/deepin-manual.json
repos/linuxdeepin/deepin-movie-reborn.json
repos/linuxdeepin/deepin-music.json
repos/linuxdeepin/deepin-ocr.json
repos/linuxdeepin/deepin-picker.json
repos/linuxdeepin/deepin-reader.json
repos/linuxdeepin/deepin-screen-recorder.json
repos/linuxdeepin/deepin-shortcut-viewer.json
repos/linuxdeepin/deepin-system-monitor.json
repos/linuxdeepin/deepin-terminal.json
repos/linuxdeepin/deepin-voice-note.json
repos/linuxdeepin/docparser.json
repos/linuxdeepin/image-editor.json
repos/linuxdeepin/util-dfm.json
repos/linuxdeepin/deepin-scanner.json
repos/linuxdeepin/udisks2-qt6.json

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

@deepin-ci-robot

Copy link
Copy Markdown
Contributor

deepin pr auto review

★ 总体评分:95分

■ 【总体评价】

代码实现了在CI流程中同步linglong.yaml版本号的功能,逻辑清晰且无安全漏洞。
代码质量良好,正则匹配与版本号拆分逻辑正确,仅在边界条件处理上存在轻微优化空间。

■ 【详细分析】

  • 1.语法逻辑基本正确 ✓

.github/workflows/update-changelog.yml 中的 Sync linglong.yaml version 步骤,strip_epoch 函数使用 split(":", 1) 正确处理了包含 epoch 的版本号。正则表达式 ^package:\s*$^(\s*version:\s*)(\S+)\s*$ 能够准确匹配目标行。版本号替换逻辑考虑了带子版本号和直接匹配两种情况。
潜在问题:如果 old_base 不包含点号(.),parts = old_base.split(".") 返回长度为1的列表,此时 len(parts) > 1 为假,会进入 elif 判断,逻辑正确;但如果 current_base 为空字符串,可能导致非预期匹配。
建议:在 strip_epoch 后增加对 current_base 非空的基本校验;考虑使用更严格的版本号解析库以处理复杂的版本格式。

  • 2.代码质量良好 ✓

脚本结构清晰,函数划分合理,write_output 函数正确处理了 GitHub Actions 单行和多行输出格式。日志打印信息有助于调试。
潜在问题:内联 Python 脚本在 YAML 中维护相对困难,且缺少针对 YAML 格式错误的异常处理。
建议:将 Python 脚本提取为独立文件并在工作流中调用,增加对文件读取和解析的 try-except 块以增强健壮性。

  • 3.代码性能无性能问题 ✓

脚本使用 pathlib.Path.glob 匹配文件,并逐行读取处理,对于配置文件级别的数据量,性能完全满足需求。
建议:无需特别优化。

  • 4.代码安全存在0个安全漏洞 ✓

漏洞对比统计:新增漏洞 0 个,减少漏洞 0 个,持平 0 个
脚本仅从受控的环境变量获取输入,对仓库内文件进行读写操作,未执行任何外部命令,不存在命令注入或路径遍历风险。

  • 建议:无需修复。

■ 【改进建议代码示例】

# 建议增加对 current_base 的非空校验
@@ -294,6 +294,8 @@
           current_base = strip_epoch(current_version)
+          if not current_base:
+              raise ValueError("current_version is empty after stripping epoch")
 
           targets = sorted(repo_root.glob("linglong*.yaml"))

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

Hey - I've left some high level feedback:

  • In the strip_epoch / version bump logic, epochs are stripped for comparison but never reattached when constructing new_val, so versions like 1:5.6.23.1 will lose their epoch; consider preserving and re-prepending the epoch when writing the updated version.
  • The upload-artifact step still hardcodes linglong*.yaml rather than using ${{ steps.sync_linglong.outputs.files }}, which may cause mismatches or failures if no linglong*.yaml exists or filenames differ; aligning this with the dynamic file list would make the workflow more robust.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In the `strip_epoch` / version bump logic, epochs are stripped for comparison but never reattached when constructing `new_val`, so versions like `1:5.6.23.1` will lose their epoch; consider preserving and re-prepending the epoch when writing the updated version.
- The upload-artifact step still hardcodes `linglong*.yaml` rather than using `${{ steps.sync_linglong.outputs.files }}`, which may cause mismatches or failures if no `linglong*.yaml` exists or filenames differ; aligning this with the dynamic file list would make the workflow more robust.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

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.

2 participants