Skip to content

feat: add dconfig meta org.deepin.ocr.json and install rule - #102

Merged
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
add-uos:feat/ocr-debugsource-dconfig
Nov 5, 2026
Merged

deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
add-uos:feat/ocr-debugsource-dconfig

Conversation

@add-uos

@add-uos add-uos commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

概要:deepin-ocr 调试模式适配——Part 2/2:DConfig meta + 安装规则(3 个文件)

配套提交:Part 1/2(日志分类化 + 动态日志监听,10 个文件)单独一个 PR;deepin-debug-config 侧 json + shell 在 Gerrit develop/snipe 另行提交。

改动内容(本 PR 3 个文件)

  1. DConfig meta(assets/configs/org.deepin.ocr.json)

    • log_rules 默认值:org.deepin.ocr*.debug=false;org.deepin.ocr*.info=false;org.deepin.ocr*.warning=true(warning=true 放最后,与 debug-config shell 的 warning case 完全一致)
    • visibility public
  2. 安装规则

    • install_dconfig.cmake 支持可选 APPID 参数
    • src/CMakeLists.txt 调用 INSTALL_DCONFIG("org.deepin.ocr.json" APPID "org.deepin.ocr"),安装到 share/dsg/configs/org.deepin.ocr/

验证

  • ✅ meta 经构建安装到 /usr/share/dsg/configs/org.deepin.ocr/,dde-dconfig 可读写
  • ✅ 编译通过(最终合并态)
  • ✅ 实测四级切换动态生效(依赖 Part 1 的动态监听,本 PR 单独合并时仅缺运行时行为,不影响编译)

Summary by Sourcery

Add OCR logging DConfig metadata and application-specific installation support.

New Features:

  • Add public DConfig metadata for OCR logging rules with warning-level logging enabled by default.

Enhancements:

  • Allow DConfig installation to target an optional application ID while preserving the existing default.
  • Install the OCR logging configuration under the application-specific DConfig directory.

@sourcery-ai

sourcery-ai Bot commented Oct 30, 2026

Copy link
Copy Markdown

Sorry @add-uos, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 5 days and 3 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@sourcery-ai

sourcery-ai Bot commented Oct 30, 2026

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

Reviewer's Guide

This PR adds public DConfig metadata for OCR debug logging and updates the CMake installation helper and call site to support installing configuration under an explicit application ID, enabling the runtime debug-config integration from Part 1.

Flow diagram for DConfig metadata installation

flowchart LR
    Meta[org.deepin.ocr.json\npublic log_rules metadata] --> Install[INSTALL_DCONFIG\nAPPID org.deepin.ocr]
    Install --> Path[share/dsg/configs/org.deepin.ocr/]
    Path --> DConfig[dde-dconfig\nread and write]
Loading

File-Level Changes

Change Details Files
Adds the OCR debug logging DConfig metadata and wires it into installation under the matching application ID.
  • Defines public metadata with warning-enabled default logging rules and debug/info disabled.
  • Extends the installation helper with an optional APPID while retaining the existing default.
  • Registers the new metadata for installation alongside the existing common configuration.
assets/configs/org.deepin.ocr.json
install_dconfig.cmake
src/CMakeLists.txt

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

- Add log_rules meta (default: warning-only, matching shell script)
- Extend INSTALL_DCONFIG cmake helper with optional APPID parameter
- Install meta to share/dsg/configs/org.deepin.ocr/
@add-uos
add-uos force-pushed the feat/ocr-debugsource-dconfig branch from e574e2d to 1b29359 Compare November 2, 2026 14:11
@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

🤖 AI 代码审查报告

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

Pass


📊 总体评价

项目 结果
审查结论 代码审查通过
评分详情 本次提交新增 DConfig meta 配置文件用于动态日志规则控制,并增强了 install_dconfig.cmake 以支持 APPID 参数。语法逻辑正确,代码质量良好,无安全漏洞。OCR 指出文件末尾缺少换行符的轻微风格问题,整体质量优秀。

🔍 详细分析

1. 语法逻辑 ✅

评价: 语法正确,逻辑清晰 ✅ 通过

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

建议: []


2. 代码质量 ✅

评价: 代码结构清晰,注释完整 ✅ 通过

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

建议: ['建议在 install_dconfig.cmake 和 src/CMakeLists.txt 文件末尾添加换行符,符合 POSIX 文件标准规范']


3. 代码性能 ✅

评价: 性能良好,资源使用合理 ✅ 通过

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

建议: []


4. 代码安全 🔒

评价: 存在0个安全漏洞 ✅ 通过

🔐 发现 0 个安全漏洞

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

建议: []


💡 改进建议代码示例

# 建议在文件末尾添加换行符(install_dconfig.cmake 和 src/CMakeLists.txt) # install_dconfig.cmake 末尾: # ... 原有内容 ... endif() # 文件末尾保留一个空行(换行符) # # src/CMakeLists.txt 末尾: # ... 原有内容 ... INSTALL_DCONFIG("org.deepin.ocr.json" APPID "org.deepin.ocr") # 文件末尾保留一个空行(换行符)

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

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: add-uos, lzwind

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

@add-uos

add-uos commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

/merge

@deepin-bot
deepin-bot Bot merged commit 643522a into linuxdeepin:master Nov 5, 2026
17 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