Skip to content

Conversation

@18202781743
Copy link
Contributor

@18202781743 18202781743 commented Jul 11, 2025

  1. Removed INSTALL_DEBIAN_TRIGGER CMake option and associated trigger
    handler script
  2. Simplified post-install trigger handling by directly calling D-Bus
    reload interface
  3. Eliminated intermediate script layer for more direct and reliable
    configuration reloads
  4. Updated Debian packaging rules to reflect these changes

The changes were made to:

  • Reduce maintenance overhead by removing an unnecessary script layer
  • Improve reliability by directly interacting with D-Bus service
  • Simplify the configuration reload process
  • Remove unused build configuration option

refactor: 移除触发器处理脚本并简化重载逻辑

  1. 移除了INSTALL_DEBIAN_TRIGGER CMake选项及相关触发器处理脚本
  2. 简化了安装后触发器处理,直接调用D-Bus重载接口
  3. 消除了中间脚本层,使配置重载更直接可靠
  4. 更新了Debian打包规则以反映这些变更

这些变更是为了:

  • 通过移除不必要的脚本层减少维护开销
  • 通过直接与D-Bus服务交互提高可靠性
  • 简化配置重载流程
  • 移除未使用的构建配置选项

Summary by Sourcery

Remove the INSTALL_DEBIAN_TRIGGER CMake option and trigger handler script, simplify the configuration reload process by invoking the D-Bus interface directly, and update Debian packaging rules accordingly

Enhancements:

  • Eliminate intermediate trigger handler script for more direct and reliable D-Bus configuration reloads

Build:

  • Remove INSTALL_DEBIAN_TRIGGER option and associated script from CMakeLists
  • Update Debian packaging rules to reflect removal of the trigger handler script

@18202781743 18202781743 requested review from BLumia and mhduiy July 11, 2025 06:16
@github-actions
Copy link

  • 检测到debian目录文件有变更: debian/dde-dconfig-daemon.postinst,debian/rules

@sourcery-ai
Copy link

sourcery-ai bot commented Jul 11, 2025

Reviewer's Guide

This refactor removes the redundant trigger handler script and CMake option, replacing the multi-step reload process with a direct D-Bus reload call and updating Debian packaging accordingly.

Sequence diagram for simplified post-install configuration reload

sequenceDiagram
    participant Postinst as Debian postinst script
    participant DConfigDaemon as dde-dconfig-daemon (D-Bus service)
    Postinst->>DConfigDaemon: Call D-Bus reload interface
    DConfigDaemon-->>Postinst: Reload complete
Loading

File-Level Changes

Change Details Files
Remove trigger handler script and CMake option
  • Deleted INSTALL_DEBIAN_TRIGGER option from CMakeLists.txt
  • Removed conditional installation of the reload handler script
  • Deleted the dde-dconfig-daemon-reload-handler script file
dconfig-center/dde-dconfig-daemon/CMakeLists.txt
dconfig-center/dde-dconfig-daemon/scripts/dde-dconfig-daemon-reload-handler
Simplify post-install reload to use D-Bus interface
  • Updated debian/dde-dconfig-daemon.postinst to call D-Bus for configuration reload
  • Removed references to the old trigger script in Debian rules
debian/dde-dconfig-daemon.postinst
debian/rules

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 @18202781743 - I've reviewed your changes - here's some feedback:

  • Add error handling and logging around the direct D-Bus reload call in the postinst script to gracefully handle cases where the daemon isn’t ready or the message bus is unavailable.
  • Ensure that upgrading from earlier versions properly cleans up any leftover trigger handler scripts under /lib/dde-dconfig-daemon to avoid stale files after the refactor.
  • Validate the new reload logic across all install scenarios (initial install, upgrade, containerized environments) to confirm the daemon is active before invoking D-Bus reload.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Add error handling and logging around the direct D-Bus reload call in the postinst script to gracefully handle cases where the daemon isn’t ready or the message bus is unavailable.
- Ensure that upgrading from earlier versions properly cleans up any leftover trigger handler scripts under /lib/dde-dconfig-daemon to avoid stale files after the refactor.
- Validate the new reload logic across all install scenarios (initial install, upgrade, containerized environments) to confirm the daemon is active before invoking D-Bus reload.

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.

1. Removed INSTALL_DEBIAN_TRIGGER CMake option and associated trigger
handler script
2. Simplified post-install trigger handling by directly calling D-Bus
reload interface
3. Eliminated intermediate script layer for more direct and reliable
configuration reloads
4. Updated Debian packaging rules to reflect these changes

The changes were made to:
- Reduce maintenance overhead by removing an unnecessary script layer
- Improve reliability by directly interacting with D-Bus service
- Simplify the configuration reload process
- Remove unused build configuration option

refactor: 移除触发器处理脚本并简化重载逻辑

1. 移除了INSTALL_DEBIAN_TRIGGER CMake选项及相关触发器处理脚本
2. 简化了安装后触发器处理,直接调用D-Bus重载接口
3. 消除了中间脚本层,使配置重载更直接可靠
4. 更新了Debian打包规则以反映这些变更

这些变更是为了:
- 通过移除不必要的脚本层减少维护开销
- 通过直接与D-Bus服务交互提高可靠性
- 简化配置重载流程
- 移除未使用的构建配置选项
@github-actions
Copy link

  • 检测到debian目录文件有变更: debian/dde-dconfig-daemon.install,debian/dde-dconfig-daemon.postinst,debian/rules

@deepin-ci-robot
Copy link

deepin pr auto review

代码审查意见:

  1. CMakeLists.txt 文件修改

    • 删除了 INSTALL_DEBIAN_TRIGGER 选项,这可能会影响 Debian 包的安装行为。如果这个选项被删除,需要确认是否有其他机制来处理配置文件变化。
  2. dde-dconfig-daemon-reload-handler 脚本删除

    • 脚本被删除,但 debian/dde-dconfig-daemon.postinst 文件中仍然引用了该脚本。需要更新 postinst 脚本,以直接使用 D-Bus 调用来代替脚本。
  3. debian/dde-dconfig-daemon.postinst 文件修改

    • 直接使用 D-Bus 调用来触发配置重载,这是一个改进,因为它减少了外部脚本的依赖。但是,需要确保 dbus-send 命令在所有目标系统上都可用,并且有适当的权限来执行。
  4. debian/dde-dconfig-daemon.install 文件修改

    • 删除了 usr/lib/dde-dconfig-daemon/*,这可能会影响其他依赖该目录的包。需要确认是否有其他包依赖于这个目录,并确保这些依赖关系得到妥善处理。
  5. debian/rules 文件修改

    • 删除了 -DINSTALL_DEBIAN_TRIGGER=ON 选项,这可能会影响构建过程。需要确认是否有其他机制来处理配置文件变化,或者这个选项是否确实不再需要。
  6. 代码风格和一致性

    • dde-dconfig-daemon-reload-handler 脚本中,main 函数被直接调用,而不是通过 main() 调用。这可能会导致脚本在某些环境中无法正确执行。建议使用 main() 调用。
  7. 错误处理

    • dde-dconfig-daemon-reload-handler 脚本中,log_error 函数使用了 >&2 来输出错误信息到标准错误流,这是一个好的做法。但是,在 debian/dde-dconfig-daemon.postinst 文件中,错误信息也被输出到标准输出流,这可能不是预期的行为。建议只将错误信息输出到标准错误流。
  8. 日志记录

    • dde-dconfig-daemon-reload-handler 脚本中,log_infolog_error 函数都使用了 2>/dev/null || true 来忽略日志记录的失败。这可能会导致日志丢失,特别是在日志系统不稳定的情况下。建议在日志记录失败时采取更严格的错误处理措施。

综上所述,建议在删除 dde-dconfig-daemon-reload-handler 脚本之前,确保所有相关的依赖和机制都已经得到妥善处理,并且所有相关的文档和配置文件都已经更新。同时,建议在日志记录和错误处理方面采取更严格的措施,以确保系统的健壮性和可靠性。

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

@github-actions
Copy link

  • 检测到debian目录文件有变更: debian/dde-dconfig-daemon.install,debian/dde-dconfig-daemon.postinst,debian/rules

@18202781743 18202781743 merged commit 259fda7 into linuxdeepin:master Jul 14, 2025
19 of 21 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