Skip to content

refactor: remove legacy dconfig migration call and dead code - #1771

Open
Ivy233 wants to merge 1 commit into
linuxdeepin:masterfrom
Ivy233:fix/dconfig-migration-switch
Open

Ivy233 wants to merge 1 commit into
linuxdeepin:masterfrom
Ivy233:fix/dconfig-migration-switch

Conversation

@Ivy233

@Ivy233 Ivy233 commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor
  1. Remove the Shell::dconfigsMigrate() call from startup because the 23 -> 25 upgrade path is no longer supported
  2. Keep Shell::dconfigsMigrate() as the public entry point for future migrations, but remove the always-empty mapping table and unreachable early-return path
  3. Remove the now-unused dconfigMigrate() helper and its DConfig includes

Log: Remove legacy dconfig migration call and dead code

Influence:

  1. dde-shell no longer performs legacy dconfig migrations at startup
  2. The Shell::dconfigsMigrate() API remains for future migrations
  3. No empty migration table or unreachable migration code remains

refactor: 移除旧 dconfig 迁移调用和死代码

  1. 23 -> 25 升级路径已不再支持,移除启动时的 Shell::dconfigsMigrate() 调用
  2. 保留 Shell::dconfigsMigrate() 作为后续迁移的公共入口,但删除恒空的迁移表与不可达的提前返回逻辑
  3. 删除不再使用的 dconfigMigrate() 辅助函数及其 DConfig 头文件引用

Log: 移除旧 dconfig 迁移调用和死代码

Influence:

  1. dde-shell 启动时不再执行旧 dconfig 迁移
  2. Shell::dconfigsMigrate() API 保留,供后续迁移复用
  3. shell.cpp 中不再保留空迁移表和不可达的迁移代码

PMS: TASK-394335

Summary by Sourcery

Enhancements:

  • Stop invoking legacy dconfig migrations during shell startup while retaining the migration API for future use.

@sourcery-ai

sourcery-ai Bot commented Oct 20, 2026

Copy link
Copy Markdown

Reviewer's Guide

Legacy DConfig migration support is restored but disabled by default through a compile-time switch. Normal startup no longer invokes dconfigsMigrate() or creates a DConfig object, while the migration table and logic remain available for future migrations after stale mappings are removed.

Flow diagram for the disabled legacy DConfig migration

flowchart TD
    Startup[Shell startup] --> Switch{EnableLegacyDConfigMigration}
    Switch -->|false| Continue[Continue startup without legacy migration]
    Switch -->|true| Migrate["Shell.dconfigsMigrate()"]
    Migrate --> DConfig[Create DConfig and apply migration mappings]
    DConfig --> Continue
Loading

File-Level Changes

Change Details Files
Gate legacy DConfig migration execution behind a compile-time-disabled switch.
  • Add EnableLegacyDConfigMigration with a default value of false.
  • Guard the startup migration call with if constexpr so no migration object is created in the default build.
  • Document the unsupported upgrade path and prerequisites for re-enabling migrations.
shell/main.cpp
Restore the legacy migration mappings and retain the migration implementation for future use.
  • Reintroduce mappings for dock, tray-loader, and launchpad configuration transitions.
  • Remove the empty-table early return so the restored mappings can be processed when enabled.
  • Continue reading migrated-state data before applying migrations.
shell/shell.cpp

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

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

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread shell/shell.cpp Outdated
@Ivy233
Ivy233 force-pushed the fix/dconfig-migration-switch branch from 111149b to 9343163 Compare October 20, 2026 09:26
@Ivy233 Ivy233 changed the title refactor: keep legacy dconfig migration framework behind a disabled s… refactor: stop invoking legacy dconfig migration Oct 20, 2026
@Ivy233
Ivy233 requested a review from BLumia October 20, 2026 09:28
BLumia
BLumia previously approved these changes Oct 20, 2026

@BLumia BLumia left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

手动狗头

@18202781743

Copy link
Copy Markdown
Contributor

之前上个pr的评论也修一下呀,不然代码不是还在那里,

@Ivy233
Ivy233 force-pushed the fix/dconfig-migration-switch branch from 9343163 to 91edcb4 Compare October 20, 2026 12:00
@Ivy233 Ivy233 changed the title refactor: stop invoking legacy dconfig migration refactor: remove legacy dconfig migration call and dead code Oct 20, 2026
@Ivy233

Ivy233 commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor Author

上一笔 PR 的评论已处理:移除了 shell.cpp 中恒空的 dconfigMigrationLists、不可达的提前返回,以及不再使用的 dconfigMigrate() 辅助函数;按 Blumia 的意见保留了 Shell::dconfigsMigrate() 这个 API,供后续迁移复用。启动处的调用已删除。最新提交:96da782f。

@Ivy233
Ivy233 force-pushed the fix/dconfig-migration-switch branch from 91edcb4 to 96da782 Compare October 20, 2026 12:01
1. Remove the Shell::dconfigsMigrate() call from startup because the
   23 -> 25 upgrade path is no longer supported
2. Keep the migration framework in shell.cpp for future reuse
3. Avoid creating DConfig objects for legacy migrations, preventing
   "Can't acquire config manager" and "DConfig is invalid" warnings

Log: Remove legacy dconfig migration call

Influence:
1. dde-shell no longer performs legacy dconfig migrations at startup
2. The migration framework remains available for future migrations
3. The legacy migration warnings no longer appear in the startup log

refactor: 停止调用旧 dconfig 迁移

1. 23 -> 25 升级路径已不再支持,移除启动时的 Shell::dconfigsMigrate()
   调用
2. 保留 shell.cpp 中的迁移框架,供后续迁移复用
3. 避免为旧迁移创建 DConfig 对象,消除 "Can't acquire config manager"
   和 "DConfig is invalid" 告警

Log: 移除旧 dconfig 迁移调用

Influence:
1. dde-shell 启动时不再执行旧 dconfig 迁移
2. 迁移框架仍保留,后续可继续复用
3. 启动日志中不再出现旧迁移相关告警

PMS: TASK-394335
@Ivy233
Ivy233 force-pushed the fix/dconfig-migration-switch branch from 96da782 to 3c001f3 Compare October 20, 2026 12:37
@Ivy233
Ivy233 requested a review from BLumia October 20, 2026 12:38
@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

🤖 AI 代码审查报告

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

Pass


📊 总体评价

项目 结果
审查结论 代码审查通过
评分详情 本次提交删除了 shell/main.cpp 中遗留的 dconfig 迁移调用 shell.dconfigsMigrate(),属于重构清理无用代码。变更仅一行删除,未引入新逻辑,语法逻辑、代码质量、代码性能、代码安全四维度均无问题,启发式扫描与 OCR 审查均未发现风险。

🔍 详细分析

1. 语法逻辑 ✅

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

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

建议: []


2. 代码质量 ✅

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

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

建议: []


3. 代码性能 ✅

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

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

建议: []


4. 代码安全 🔒

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

🔐 发现 0 个安全漏洞

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

建议: []


💡 改进建议代码示例

本次变更无需修复,删除操作本身即正确的清理方式。原代码片段: // 已删除:shell.dconfigsMigrate(); AppletConfigManager appletConfigManager; appletConfigManager.ensureAppletConfigs();

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

@deepin-bot

deepin-bot Bot commented Oct 20, 2026

Copy link
Copy Markdown

TAG Bot

New tag: 2.0.60
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #1773

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: BLumia, Ivy233

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

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.

4 participants