Skip to content

feat(power): hand service to dde-services - #1202

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

feat(power): hand service to dde-services#1202
mhduiy wants to merge 1 commit into
linuxdeepin:masterfrom
mhduiy:x11power

Conversation

@mhduiy

@mhduiy mhduiy commented Aug 17, 2026

Copy link
Copy Markdown
Contributor
  1. Disable legacy session and system Power module registration.
  2. Remove migrated Power assets from dde-daemon packaging.
  3. Make dde-services the sole Power1 owner.

Log: Transfer Power service ownership from dde-daemon to dde-services.
Influence: Upgrades avoid duplicate Power1 ownership.

feat(power): 将服务移交 dde-services

  1. 禁用 dde-daemon 中旧的会话与系统电源模块注册。
  2. 从 dde-daemon 打包中移除已迁移的电源资源。
  3. 由 dde-services 单独提供 Power1 服务。

Log: 将电源服务所有权从 dde-daemon 移交至 dde-services。
PMS: TASK-394241
Influence: 升级时避免重复提供 Power1 服务。

Validation:

  • Rebuilt dde-session-daemon and dde-system-daemon.
  • Verified zero regular-file collisions with paired dde-services packaging.

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

Sorry @mhduiy, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@deepin-ci-robot

Copy link
Copy Markdown

[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 17, 2026

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

Reviewer's Guide

Transfers Power1 service ownership from dde-daemon to dde-services by disabling legacy power modules and removing their packaging assets, while updating dependency and metadata in debian/control.

Sequence diagram for Power1 DBus calls now handled by dde-services

sequenceDiagram
  actor Client
  participant DBus
  participant dde_services

  Client->>DBus: Call org.deepin.dde.Power1.method
  DBus->>dde_services: Route Power1 method
  dde_services-->>DBus: Return result
  DBus-->>Client: Deliver result
Loading

File-Level Changes

Change Details Files
Disable session and system Power1 modules in dde-daemon so that dde-services becomes the sole owner of the power service.
  • Remove "power" from the session daemon module initialization list
  • Drop the session power1 module import from dde-session-daemon
  • Drop the system power1 module import from dde-system-daemon
bin/dde-session-daemon/daemon.go
bin/dde-session-daemon/module.go
bin/dde-system-daemon/main.go
Remove legacy Power1-related assets from dde-daemon packaging to avoid duplicate D-Bus and polkit definitions.
  • Delete the installed Power1 D-Bus system config file during make install
  • Delete the installed Power1 system-service unit during make install
  • Delete the installed Power polkit policy during make install
  • Delete the installed DSG config for the daemon Power module during make install
Makefile
Update packaging metadata to reflect the new power service owner and minimum dde-services version.
  • Adjust dde-daemon package dependency to require dde-services >= 1.0.37
  • Update daemon packaging version/metadata to 6.1.102
debian/control

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: 6.1.102
EXISTED: no
DISTRIBUTION: unstable

1. Disable legacy session and system Power module registration.
2. Remove migrated Power assets from dde-daemon packaging.
3. Make dde-services the sole Power1 owner.

Log: Transfer Power service ownership from dde-daemon to dde-services.
Influence: Upgrades avoid duplicate Power1 ownership.

feat(power): 将服务移交 dde-services

1. 禁用 dde-daemon 中旧的会话与系统电源模块注册。
2. 从 dde-daemon 打包中移除已迁移的电源资源。
3. 由 dde-services 单独提供 Power1 服务。

Log: 将电源服务所有权从 dde-daemon 移交至 dde-services。
PMS: TASK-394241
Influence: 升级时避免重复提供 Power1 服务。
@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

★ 总体评分:95分

■ 【总体评价】

代码正确移除了废弃的电源管理模块及遗留配置文件
逻辑正确且无安全风险,仅 Makefile 存在先复制后删除的轻微冗余操作

■ 【详细分析】

  • 1.语法逻辑(完全正确)✓

移除了 daemon.go 中的模块名字符串以及 module.gomain.go 中的匿名导入,Go 语言语法完全正确;Makefile 中的 rm -f 命令语法及路径变量使用正确
建议:无需修改

  • 2.代码质量(良好)✓

Makefile 中采用先通过 cp 复制整个目录文件,再通过 rm -f 删除特定文件的方式来实现过滤安装,逻辑上能达到目的,但增加了不必要的文件操作
潜在问题:先复制后删除会产生冗余的磁盘 I/O 操作,且若未来遗漏删除命令会导致废弃文件被错误安装
建议:最佳实践是直接从 misc/conf/misc/system-services/ 等源码目录中彻底删除这四个废弃文件

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

代码变更仅为删除导入和字符串,运行时减少了电源管理模块的加载,对系统性能有正面优化作用
建议:无需修改

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

漏洞对比统计:新增漏洞 0 个,减少漏洞 0 个,持平 0 个
本次变更为纯删除操作,移除了可能存在攻击面的 DBus 服务、Polkit 策略等配置,未引入任何新的安全风险
建议:无需修改

■ 【改进建议代码示例】

diff --git a/Makefile b/Makefile
index 7a7d48bf2..123456789 100644
--- a/Makefile
+++ b/Makefile
@@ -171,13 +171,10 @@ install: build install-dde-data install-icons
 
 	mkdir -pv ${DESTDIR}${PREFIX}/share/dbus-1/system.d
 	cp misc/conf/*.conf ${DESTDIR}${PREFIX}/share/dbus-1/system.d/
-	rm -f ${DESTDIR}${PREFIX}/share/dbus-1/system.d/org.deepin.dde.Power1.conf
 
 	mkdir -pv ${DESTDIR}${PREFIX}/share/dbus-1
 	cp -r misc/services ${DESTDIR}${PREFIX}/share/dbus-1/
 	cp -r misc/system-services ${DESTDIR}${PREFIX}/share/dbus-1/
-	rm -f ${DESTDIR}${PREFIX}/share/dbus-1/system-services/org.deepin.dde.Power1.service
 
 	mkdir -pv ${DESTDIR}${PREFIX}/share/polkit-1/actions
 	cp misc/polkit-action/*.policy ${DESTDIR}${PREFIX}/share/polkit-1/actions/
-	rm -f ${DESTDIR}${PREFIX}/share/polkit-1/actions/org.deepin.dde.power.policy
 
 	mkdir -pv ${DESTDIR}${PREFIX}/share/polkit-1/rules.d/
 	cp misc/polkit-rules/*.rules ${DESTDIR}${PREFIX}/share/polkit-1/rules.d/
@@ -215,6 +212,5 @@ install: build install-dde-data install-icons
 
 	mkdir -pv ${DESTDIR}${PREFIX}/share/dsg/configs/org.deepin.dde.daemon/
 	cp -r misc/dsg-configs/*.json ${DESTDIR}${PREFIX}/share/dsg/configs/org.deepin.dde.daemon/
-	rm -f ${DESTDIR}${PREFIX}/share/dsg/configs/org.deepin.dde.daemon/org.deepin.dde.daemon.power.json
 
 	mkdir -pv ${DESTDIR}${PREFIX}/share/dsg/configs/org.deepin.dde.lightdm-deepin-greeter

@deepin-bot

deepin-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

TAG Bot

New tag: 6.1.102
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #1207

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