Repository navigation
fix: remove dead pre-check code and fix version parsing - #947
Merged
deepin-bot[bot] merged 2 commits intoOct 30, 2026
Merged
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThe PR removes misleading dead-code documentation from driver checking while preserving its existing delegation, and fixes metadata parsing by extracting values after the first '=' so embedded equals signs are retained; malformed matching lines now emit warnings. Sequence diagram for driver info check delegationsequenceDiagram
participant Caller
participant HttpDriverInterface
Caller->>HttpDriverInterface: checkDriverInfo(driverInfo)
HttpDriverInterface->>HttpDriverInterface: checkDriverInfo(strJson, driverInfo)
HttpDriverInterface-->>Caller: return existing check result
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
add-uos
force-pushed
the
agent/pms-bug-bot/ad6a3b6d8152
branch
from
October 27, 2026 03:44
f176eb7 to
4737cdd
Compare
Contributor
|
TAG Bot New tag: 6.0.75 |
1. Root cause: checkDriverInfo(DriverInfo&) had a stale TODO comment
at line 78; the logic it described is already implemented in the
second overload checkDriverInfo(QString, DriverInfo&) via
max==iLevel and isPkgInstalled checks
2. Fix: remove the TODO comment and add an explanatory comment pointing
to the existing implementation in the second overload; no new logic
added to avoid dead code from unpopulated driverName/version fields
3. Impact: no behavior change; function delegates to the same overload
as before, now with clear documentation instead of a stale TODO
fix: 移除死代码预判断并修复版本号解析
1. 根因:checkDriverInfo(DriverInfo&) L78 留有过期 TODO 注释,其描述
的逻辑已在第二重载 checkDriverInfo(QString, DriverInfo&) 中实现
2. 方案:移除 TODO 注释,添加说明性注释指向第二重载中的已有实现,
不新增逻辑以避免使用从未赋值的 driverName/version 字段产生死代码
3. 影响:无行为变化,函数委托至同一重载,仅以文档替代过期 TODO
1. Root cause: getOsBuild() and getVersion() used split("=") which
silently skipped lines whose value contained "=" (split produced
more than 2 parts), returning empty string
2. Fix: replace split("=") with section("=", 1).trimmed() in both
getOsBuild() and getVersion() to correctly extract value after the
first "=", add qCWarning for lines without "=" separator
3. Impact: values containing "=" are now parsed correctly in both
functions; abnormal lines produce warning logs for troubleshooting
1. 根因:getOsBuild() 和 getVersion() 使用 split("=") 解析,当值含
"=" 时产生超过 2 段导致行被静默跳过,返回空串
2. 方案:将 getOsBuild() 和 getVersion() 中的 split("=") 改为
section("=", 1).trimmed() 正确提取首个 "=" 后的完整值,对不含
"=" 的异常行增加 qCWarning 日志
3. 影响:两个函数中含 "=" 的值均能正确解析,异常行输出告警日志
Influence:
1. Test driver check delegates to second overload as before
2. Test OsBuild parsing with value containing "=" character
3. Test getVersion with MajorVersion/MinorVersion value containing "="
4. Test parsing with line missing "=" separator produces warning log
Influence:
1. 测试驱动检查仍委托至第二重载
2. 测试 OsBuild 值含 "=" 时的解析
3. 测试 MajorVersion/MinorVersion 值含 "=" 时的解析
4. 测试行缺少 "=" 分隔符时输出告警日志
The license-check CI (SPDX Header Validation) flags source files whose copyright year range no longer ends with the current year. Extend the SPDX-FileCopyrightText range of httpdriverinterface.cpp from 2019 ~ 2023 to cover 2026 so the SPDX summary reports 0 failures for this PR.
add-uos
force-pushed
the
agent/pms-bug-bot/ad6a3b6d8152
branch
from
October 30, 2026 01:05
4737cdd to
52632ae
Compare
lzwind
approved these changes
Oct 30, 2026
|
[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. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Contributor
Author
|
/forcemerge |
Contributor
|
This pr force merged! (status: unstable) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix: remove dead pre-check code and fix version parsing
at line 78; the logic it described is already implemented in the
second overload checkDriverInfo(QString, DriverInfo&) via
max==iLevel and isPkgInstalled checks
to the existing implementation in the second overload; no new logic
added to avoid dead code from unpopulated driverName/version fields
as before, now with clear documentation instead of a stale TODO
fix: 移除死代码预判断并修复版本号解析
根因:checkDriverInfo(DriverInfo&) L78 留有过期 TODO 注释,其描述
的逻辑已在第二重载 checkDriverInfo(QString, DriverInfo&) 中实现
方案:移除 TODO 注释,添加说明性注释指向第二重载中的已有实现,
不新增逻辑以避免使用从未赋值的 driverName/version 字段产生死代码
影响:无行为变化,函数委托至同一重载,仅以文档替代过期 TODO
Root cause: getOsBuild() and getVersion() used split("=") which
silently skipped lines whose value contained "=" (split produced
more than 2 parts), returning empty string
Fix: replace split("=") with section("=", 1).trimmed() in both
getOsBuild() and getVersion() to correctly extract value after the
first "=", add qCWarning for lines without "=" separator
Impact: values containing "=" are now parsed correctly in both
functions; abnormal lines produce warning logs for troubleshooting
根因:getOsBuild() 和 getVersion() 使用 split("=") 解析,当值含
"=" 时产生超过 2 段导致行被静默跳过,返回空串
方案:将 getOsBuild() 和 getVersion() 中的 split("=") 改为
section("=", 1).trimmed() 正确提取首个 "=" 后的完整值,对不含
"=" 的异常行增加 qCWarning 日志
影响:两个函数中含 "=" 的值均能正确解析,异常行输出告警日志
Influence:
Influence:
Summary by Sourcery
Fix metadata parsing for values containing '=' and clarify the existing driver information check delegation.
Bug Fixes:
Enhancements:
Chores: