Skip to content

feat: add Debian trigger integration for config updates#111

Merged
zccrs merged 1 commit intolinuxdeepin:masterfrom
mhduiy:trigger
Jun 20, 2025
Merged

feat: add Debian trigger integration for config updates#111
zccrs merged 1 commit intolinuxdeepin:masterfrom
mhduiy:trigger

Conversation

@mhduiy
Copy link
Contributor

@mhduiy mhduiy commented Jun 20, 2025

  1. Added dconfig-trigger-handler script to process configuration file changes via D-Bus
  2. Implemented Debian trigger system to monitor config directories (/ usr/share/dsg/configs, /etc/dsg/configs, /var/lib/linglong entries)
  3. Created postinst script to handle trigger activation and timestamp management
  4. Added documentation explaining the trigger integration process and usage
  5. Updated CMakeLists and install files to deploy the trigger handler
  6. The changes enable automatic configuration updates when package installations modify config files

feat: 添加 Debian 触发器集成以支持配置自动更新

  1. 新增 dconfig-trigger-handler 脚本通过 D-Bus 处理配置文件变更
  2. 实现 Debian 触发器系统监控配置目录(/usr/share/dsg/configs, /etc/dsg/ configs, /var/lib/linglong 条目)
  3. 创建 postinst 脚本处理触发器激活和时间戳管理
  4. 添加文档说明触发器集成流程和使用方法
  5. 更新 CMakeLists 和安装文件以部署触发器处理程序
  6. 这些变更使得在包安装修改配置文件时能够自动更新配置

Summary by Sourcery

Integrate Debian triggers to automate configuration updates on package installation by adding a D-Bus handler script and updating build and Debian packaging files.

New Features:

  • Add dconfig-trigger-handler script to process configuration changes via D-Bus
  • Integrate Debian trigger system with a .triggers file to monitor config directories
  • Introduce postinst script to activate triggers and manage timestamp updates

Build:

  • Update CMakeLists and install manifests to deploy the trigger handler script

Deployment:

  • Add Debian packaging metadata (.triggers and .postinst) to support trigger integration

@github-actions
Copy link

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

@mhduiy mhduiy requested a review from 18202781743 June 20, 2025 08:52
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 @mhduiy - I've reviewed your changes and they look great!


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.

@sourcery-ai
Copy link

sourcery-ai bot commented Jun 20, 2025

Reviewer's Guide

Implements a Debian trigger mechanism that installs a D-Bus-based handler script and configures packaging hooks to automatically process configuration file updates.

Sequence diagram for Debian trigger-based config update process

sequenceDiagram
    participant DebianPkg as Debian Package System
    participant Trigger as Trigger System
    participant Handler as dconfig-trigger-handler
    participant DConfig as dde-dconfig-daemon (D-Bus)

    DebianPkg->>Trigger: Install/Update config file in monitored directory
    Trigger->>Handler: Activate dconfig-trigger-handler script
    Handler->>DConfig: Notify config change via D-Bus
    DConfig-->>Handler: Process config update
Loading

File-Level Changes

Change Details Files
Introduce D-Bus trigger handler script
  • Add dconfig-trigger-handler script to process config changes via D-Bus
  • Make the handler executable and install it to the daemon library directory
dconfig-center/dde-dconfig-daemon/scripts/dconfig-trigger-handler
Configure Debian trigger and post-install hooks
  • Define package triggers for config directories under /usr/share, /etc and /var/lib
  • Create postinst script to activate triggers and update timestamps
debian/dde-dconfig-daemon.triggers
debian/dde-dconfig-daemon.postinst
Update build and install configuration
  • Extend CMakeLists to install the trigger handler script
  • Adjust .install file to include the new handler deployment path
dconfig-center/dde-dconfig-daemon/CMakeLists.txt
debian/dde-dconfig-daemon.install

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

@mhduiy mhduiy requested a review from zccrs June 20, 2025 08:56
@zccrs zccrs requested a review from Copilot June 20, 2025 09:16
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR integrates Debian triggers to automate configuration updates during package installation by adding a D-Bus handler script, Debian packaging files, and related build/install configuration updates.

  • Added a new dconfig-trigger-handler script to process configuration file changes via D-Bus
  • Integrated Debian trigger system through new .triggers and postinst scripts for monitoring configuration directories and managing timestamps
  • Updated CMakeLists and install manifests, and adjusted packaging metadata for proper deployment

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
debian/dde-dconfig-daemon.triggers Added trigger definitions to monitor configuration directories
debian/dde-dconfig-daemon.postinst Introduced post-install script to reload systemd and update timestamps
debian/dde-dconfig-daemon.install Updated file list to deploy the new trigger handler script
dconfig-center/dde-dconfig-daemon/scripts/dconfig-trigger-handler New script to handle configuration updates via D-Bus
dconfig-center/dde-dconfig-daemon/CMakeLists.txt Updated installation steps to include the trigger handler script
.reuse/dep5 Added licensing information for new scripts
Comments suppressed due to low confidence (1)

dconfig-center/dde-dconfig-daemon/scripts/dconfig-trigger-handler:107

  • The logic creates the timestamp file before scanning for new files in process_newer_files_in_directory, which may lead to skipping configuration changes that occurred before the file was created. Consider performing the directory scan first and then updating the timestamp file after processing to ensure all relevant changes are captured.
    if [ ! -f "$TIMESTAMP_FILE" ]; then

@github-actions
Copy link

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

@github-actions
Copy link

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

1. Added dconfig-trigger-handler script to process configuration file changes via D-Bus
2. Implemented Debian trigger system to monitor config directories (/ usr/share/dsg/configs, /etc/dsg/configs, /var/lib/linglong entries)
3. Created postinst script to handle trigger activation and timestamp management
4. Added documentation explaining the trigger integration process and usage
5. Updated CMakeLists and install files to deploy the trigger handler
6. The changes enable automatic configuration updates when package installations modify config files

feat: 添加 Debian 触发器集成以支持配置自动更新

1. 新增 dconfig-trigger-handler 脚本通过 D-Bus 处理配置文件变更
2. 实现 Debian 触发器系统监控配置目录(/usr/share/dsg/configs, /etc/dsg/ configs, /var/lib/linglong 条目)
3. 创建 postinst 脚本处理触发器激活和时间戳管理
4. 添加文档说明触发器集成流程和使用方法
5. 更新 CMakeLists 和安装文件以部署触发器处理程序
6. 这些变更使得在包安装修改配置文件时能够自动更新配置
@github-actions
Copy link

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

@mhduiy mhduiy requested a review from zccrs June 20, 2025 09:34
@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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

@zccrs zccrs merged commit 59060ec into linuxdeepin:master Jun 20, 2025
19 of 20 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