Skip to content

Conversation

@fly602
Copy link
Contributor

@fly602 fly602 commented Nov 6, 2025

Removed the powermanager module as it appears to be redundant with the existing power1 module. The changes include:

  1. Removed powermanager from TEST list in Makefile
  2. Removed powermanager import from main.go
  3. Deleted D-Bus configuration file for powermanager service
  4. Removed powermanager-related comments from systemd service file
  5. Completely removed all powermanager source code files including daemon.go, manager.go, and utility files

The powermanager module provided similar functionality to the power1 module, including system power state checks (shutdown, reboot, suspend, hibernate) and virtual machine detection. This removal simplifies the codebase by eliminating duplicate functionality.

Influence:

  1. Verify system power management functions still work correctly through power1 module
  2. Test shutdown, reboot, suspend, and hibernate capabilities
  3. Confirm no regression in virtual machine detection
  4. Check D-Bus service availability for power-related operations
  5. Validate system daemon starts without powermanager dependencies

chore: 移除powermanager模块

移除powermanager模块,因为它与现有的power1模块功能重复。具体变更包括:

  1. 从Makefile的TEST列表中移除powermanager
  2. 从main.go中移除powermanager导入
  3. 删除powermanager服务的D-Bus配置文件
  4. 从systemd服务文件中移除powermanager相关注释
  5. 完全删除所有powermanager源代码文件,包括daemon.go、manager.go和工具 文件

powermanager模块提供的功能与power1模块相似,包括系统电源状态检查(关机、
重启、待机、休眠)和虚拟机检测。此次移除通过消除重复功能简化了代码库。

Influence:

  1. 验证通过power1模块的系统电源管理功能仍正常工作
  2. 测试关机、重启、待机和休眠功能
  3. 确认虚拟机检测功能无回归问题
  4. 检查电源相关操作的D-Bus服务可用性
  5. 验证系统守护进程在没有powermanager依赖的情况下正常启动

Summary by Sourcery

Remove the redundant powermanager module and clean up related configurations and code references

Enhancements:

  • Simplify the codebase by consolidating power management functionality into the existing power1 module

Build:

  • Remove powermanager from the TEST list in the Makefile

Deployment:

  • Delete the powermanager D-Bus configuration file

Chores:

  • Remove powermanager import from main.go
  • Remove powermanager comments from the systemd service file
  • Delete all powermanager source code files

@sourcery-ai
Copy link

sourcery-ai bot commented Nov 6, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR eliminates the redundant powermanager module by removing its references from build, initialization, service, and D-Bus configs, and deleting all module source files, consolidating power management under the existing power1 implementation.

Class diagram for removed powermanager module

classDiagram
    class PowerManager {
        +Shutdown()
        +Reboot()
        +Suspend()
        +Hibernate()
        +IsVirtualMachine()
    }
    class PowerManagerDaemon {
        +Start()
        +Stop()
        +HandleDBusRequests()
    }
    PowerManagerDaemon --> PowerManager
    %% All powermanager classes and their methods are removed
Loading

File-Level Changes

Change Details Files
Clean up build and daemon imports for the removed module
  • Removed powermanager from TEST list in Makefile
  • Deleted powermanager import in main.go
Makefile
bin/dde-system-daemon/main.go
Remove powermanager D-Bus configuration and service file references
  • Deleted powermanager D-Bus config file
  • Removed related comments from systemd service file
misc/conf/org.deepin.dde.PowerManager1.conf
misc/systemd/services/system/dde-system-daemon.service
Delete redundant powermanager module source code
  • Removed daemon, manager, utility, and auto-generated D-Bus files for powermanager
system/power_manager1/daemon.go
system/power_manager1/exported_methods_auto.go
system/power_manager1/manager.go
system/power_manager1/power_manager_dbusutil.go
system/power_manager1/utils.go

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

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes - here's some feedback:

  • Verify that all existing consumers referencing the old powermanager D-Bus interface have been migrated to the power1 interface to avoid broken integrations.
  • Double-check that no socket activation units or service files for power_manager1 remain in your systemd configurations after this removal.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Verify that all existing consumers referencing the old powermanager D-Bus interface have been migrated to the power1 interface to avoid broken integrations.
- Double-check that no socket activation units or service files for power_manager1 remain in your systemd configurations after this removal.

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.

Removed the powermanager module as it appears to be redundant with the
existing power1 module. The changes include:
1. Removed powermanager from TEST list in Makefile
2. Removed powermanager import from main.go
3. Deleted D-Bus configuration file for powermanager service
4. Removed powermanager-related comments from systemd service file
5. Completely removed all powermanager source code files including
daemon.go, manager.go, and utility files

The powermanager module provided similar functionality to the power1
module, including system power state checks (shutdown, reboot, suspend,
hibernate) and virtual machine detection. This removal simplifies the
codebase by eliminating duplicate functionality.

Influence:
1. Verify system power management functions still work correctly through
power1 module
2. Test shutdown, reboot, suspend, and hibernate capabilities
3. Confirm no regression in virtual machine detection
4. Check D-Bus service availability for power-related operations
5. Validate system daemon starts without powermanager dependencies

chore: 移除powermanager模块

移除powermanager模块,因为它与现有的power1模块功能重复。具体变更包括:
1. 从Makefile的TEST列表中移除powermanager
2. 从main.go中移除powermanager导入
3. 删除powermanager服务的D-Bus配置文件
4. 从systemd服务文件中移除powermanager相关注释
5. 完全删除所有powermanager源代码文件,包括daemon.go、manager.go和工具
文件

powermanager模块提供的功能与power1模块相似,包括系统电源状态检查(关机、
重启、待机、休眠)和虚拟机检测。此次移除通过消除重复功能简化了代码库。

Influence:
1. 验证通过power1模块的系统电源管理功能仍正常工作
2. 测试关机、重启、待机和休眠功能
3. 确认虚拟机检测功能无回归问题
4. 检查电源相关操作的D-Bus服务可用性
5. 验证系统守护进程在没有powermanager依赖的情况下正常启动
@deepin-ci-robot
Copy link

deepin pr auto review

这是一个关于删除 power_manager1 模块的代码变更审查。我来分析一下这个变更:

  1. 变更内容:
  • 删除了整个 power_manager1 模块的所有相关文件
  • 从 Makefile 中移除了相关测试路径
  • 从 main.go 中移除了相关导入
  • 更新了 go.mod 和 go.sum 中的依赖版本
  • 删除了相关的 D-Bus 配置文件
  • 更新了 systemd 服务配置文件中的注释
  1. 代码质量分析:
  • 变更看起来是完整的,所有相关文件都被正确删除
  • 依赖更新是合理的,删除了不再需要的模块
  • 配置文件的清理也很完整
  1. 安全性分析:
  • 删除了一个管理电源的模块,这可能涉及系统安全
  • 需要确认是否有其他模块替代了这些功能
  • D-Bus 配置的删除可能影响系统的电源管理接口
  1. 性能影响:
  • 移除这个模块可能会减少系统资源占用
  • 但需要确保不会影响系统的电源管理功能

改进建议:

  1. 迁移说明:
    建议在提交信息中添加说明,解释为什么删除这个模块,以及这些功能是否被其他模块替代。

  2. 文档更新:
    确保相关的系统文档也得到更新,反映这个变更。

  3. 测试验证:

  • 需要验证系统的电源管理功能是否仍然正常工作
  • 确认没有其他组件依赖这个已删除的模块
  1. 版本控制:
  • go.mod 和 go.sum 的更新是合理的,但建议检查依赖更新是否会影响其他功能
  • 确保新的依赖版本是稳定和安全的
  1. 配置文件:
  • systemd 服务配置文件中的注释更新是好的,但建议完全删除不再需要的注释,而不是仅仅更新它们
  • 确保所有相关的配置文件都被正确清理
  1. 向后兼容性:
  • 如果这个模块提供了公共 API,需要确保有适当的迁移路径
  • 考虑是否需要提供兼容性层或过渡期支持
  1. 错误处理:
  • 如果有其他组件可能尝试调用这个已删除模块的接口,需要确保有适当的错误处理
  1. 日志记录:
  • 考虑在相关位置添加日志,记录这个模块的移除,以便于问题排查
  1. 代码审查:
  • 建议进行全面的代码审查,确保没有遗漏任何相关引用
  • 特别检查是否有其他模块间接依赖这个模块
  1. 测试覆盖:
  • 确保相关的测试用例也被更新或删除
  • 添加新的测试用例来验证系统在移除这个模块后的行为

总的来说,这个变更看起来是合理的,但需要确保系统的电源管理功能不会受到影响。建议进行全面的测试验证,并确保有适当的文档说明这个变更。

@fly602 fly602 merged commit 2b07e55 into linuxdeepin:master Nov 6, 2025
13 of 14 checks passed
@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: fly602, 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

@fly602 fly602 deleted the rm-powermanager branch November 7, 2025 03:12
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