Skip to content

feat: order tray loader services behind the dock and reset retries - #232

Merged
yixinshark merged 1 commit into
linuxdeepin:masterfrom
yixinshark:feat/tray-plugin-systemd-services
Sep 22, 2026
Merged

yixinshark merged 1 commit into
linuxdeepin:masterfrom
yixinshark:feat/tray-plugin-systemd-services

Conversation

@yixinshark

@yixinshark yixinshark commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Pms: TASK-395865

Summary

  • Start dde-tray-loader.target behind dde-shell@DDE.service so tray plugin loaders only start after the dock acquires org.deepin.dde.Dock1
  • Reset failed tray loader instances when a new dock process starts so each dock lifetime gets a fresh retry budget

Test plan

  • Verify tray loader services start only after org.deepin.dde.Dock1 is acquired
  • Verify tray loader failed states are reset when the dock restarts
  • Verify stop/restart of dde-session-core.target still propagates to the dock and tray loaders

@sourcery-ai

sourcery-ai Bot commented Sep 21, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

The PR updates the dock systemd unit so session core can start in parallel, tray loaders are pulled in only after the dock acquires its BusName, and failed tray-loader instances are reset across dock restarts, with corresponding packaging metadata updates.

File-Level Changes

Change Details Files
Decouple dock startup ordering from the session core and make dock-owned tray loaders follow the dock lifecycle.
  • Remove the dock service's ordering dependency on dde-session-core.target while retaining its session-core lifecycle relationship.
  • Add dde-tray-loader.target as a dock-triggered dependency so tray loaders start only after the dock is ready and reset failed loader instances for subsequent dock activations.
  • Update package metadata and changelog for the systemd integration changes.
systemd/dde-session-core.target.wants/dde-shell@DDE.service
debian/control
debian/changelog

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

@github-actions

Copy link
Copy Markdown

TAG Bot

TAG: 2.0.33
EXISTED: no
DISTRIBUTION: UNRELEASED

@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 reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Start dde-tray-loader.target behind dde-shell@DDE.service so tray plugin
loader services only start after the dock acquires org.deepin.dde.Dock1
once the QML DockCompositor is ready, and reset failed tray loader
instances when a new dock process starts so each dock lifetime gets a
fresh retry budget.

在 dde-shell@DDE.service 之后启动 dde-tray-loader.target,使托盘插件加载
服务仅在 dock 的 QML DockCompositor 就绪并获取 org.deepin.dde.Dock1 后
启动;并在新 dock 进程启动时重置失败的托盘加载器实例,使每个 dock 生命
周期获得全新的重试预算。

Log: order tray loader services behind the dock and reset retries
Pms: TASK-395865
Change-Id: Iaf17347b6cde3495bf50f240d1d7da4faa1456d0
@yixinshark
yixinshark force-pushed the feat/tray-plugin-systemd-services branch from 745c27e to fa7a1b7 Compare September 21, 2026 09:03
@yixinshark yixinshark changed the title feat: decouple dock startup from session core and order tray loaders feat: order tray loader services behind the dock and reset retries Sep 21, 2026
@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

🤖 AI 代码审查报告

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

Pass


📊 总体评价

项目 结果
审查结论 代码审查通过
评分详情 总体评分 100 分,大于 70 分通过阈值,代码质量符合要求。本次变更通过 systemd 依赖排序和重置失败实例机制,正确实现了托盘加载器服务的有序启动和重试预算重置,代码注释完整,无安全漏洞。

🔍 详细分析

1. 语法逻辑 ✅

评价: 优秀 ✅ 通过

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

建议: systemd 单元文件语法正确,Wants=、Before=、ExecStartPre= 指令使用规范,debian/control Breaks 字段语法正确。逻辑上通过 Wants + Before 组合确保 dock 服务先于托盘加载器启动,ExecStartPre 使用 '-' 前缀正确处理无失败实例的情况,TimeoutStartSec 从 10s 调整为 30s 合理适应 QML DockCompositor 初始化时间。


2. 代码质量 ✅

评价: 优秀 ✅ 通过

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

建议: 代码结构清晰,注释完整。新增注释详细解释了三处变更的设计意图:(1) 托盘加载器服务排序原因(BusName 在 DockCompositor 就绪后获取,Before= 确保 dockplugin Wayland socket 存在);(2) 重置失败实例的原因(新 dock 生命周期获得新的重试预算);(3) Breaks 声明确保 dde-shell >= 2.0.55 版本兼容性。无重复代码,无调试代码残留。


3. 代码性能 ✅

评价: 优秀 ✅ 通过

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

建议: TimeoutStartSec 从 10s 增加到 30s 是合理的,QML DockCompositor 初始化在慢速硬件上可能需要更多时间。ExecStartPre 的 reset-failed 命令是轻量级 systemctl 操作,不影响启动性能。


4. 代码安全 🔒

评价: 优秀 ✅ 通过

🔐 发现 0 个安全漏洞

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

建议: 存在0个安全漏洞。ExecStartPre 使用绝对路径 /usr/bin/systemctl,--user 标志确保仅操作用户级 systemd 实例,无命令注入风险(所有路径硬编码),无敏感信息泄露,无权限提升风险。


💡 改进建议代码示例

// 本次变更质量优秀,无需修复示例
// systemd 单元文件配置正确,注释完整,无需改进

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

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: mhduiy, yixinshark

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

@yixinshark
yixinshark merged commit 6192f4d into linuxdeepin:master Sep 22, 2026
13 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