Skip to content

Release 1.11#1588

Merged
dengbo11 merged 4 commits into
OpenAtom-Linyaps:release/1.11from
dengbo11:release-1.11
Feb 9, 2026
Merged

Release 1.11#1588
dengbo11 merged 4 commits into
OpenAtom-Linyaps:release/1.11from
dengbo11:release-1.11

Conversation

@dengbo11

@dengbo11 dengbo11 commented Feb 6, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

dengbo11 and others added 3 commits February 6, 2026 18:24
1. Add driver upgrade and improves detection accuracy with remote repository integration.
2. Optimize unit tests.
1. Update POT creation timestamp to 2026-02-06
2. Refresh source file line number references throughout the template
3. Add new translatable string for progress output control option
4. Remove obsolete cache generation failure message
5. Synchronize with latest CLI and builder source code locations

Log: Added CLI flag to suppress progress information output

Influence:
1. Test that the new "Don't output progress information" string appears
in help output
2. Verify that translation extraction process works correctly
3. Check that error messages with file references point to correct lines
4. Ensure no broken references to removed strings exist in code
5. Validate CLI behavior when progress output is disabled
Signed-off-by: reddevillg <reddevillg@gmail.com>
@deepin-ci-robot

Copy link
Copy Markdown
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: dengbo11

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

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @dengbo11, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a substantial refactoring and enhancement of the graphics driver detection and installation system, centralizing logic within a dedicated manager class and improving its interaction with the ll-cli tool. It also includes various improvements to command-line interface tools, such as updated bash completion for ll-builder and a simplified argument transformation in ll-cli. Furthermore, localization files have been updated to reflect these changes and improve message consistency.

Highlights

  • Driver Detection System Overhaul: The graphics driver detection and installation mechanism has been significantly refactored. This includes changes to the DriverDetectionManager and NVIDIADriverDetector classes, introducing new methods for checking upgradability and retrieving detailed package information from remote repositories using JSON output from ll-cli.
  • Improved ll-cli Integration: The driver installation logic has been moved from main.cpp into the DriverDetectionManager, now utilizing ll-cli install with repository and version information. The ll-cli search command now supports JSON output for better programmatic parsing.
  • Enhanced Driver Information Model: The GraphicsDriverInfo structure has been updated to include packageVersion and repoName, providing a more comprehensive representation of driver packages, and removing the isInstalled flag as installation status is now determined dynamically.
  • CLI Tooling Enhancements: The ll-cli and ll-builder tools received updates, including a simplified transformOldExec function in ll-cli, and new bash completion features for ll-builder's export and remove commands. The --exec option was removed from ll-builder build.
  • Localization Updates: The English localization files (po/en_US.po, po/linyaps.pot) have been updated with new and revised messages, including support for plural forms and new CLI options.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • apps/ll-cli/src/main.cpp
    • Added <string_view> header.
    • Refactored transformOldExec function for improved argument processing, replacing complex wordexp logic with a simpler loop and std::string_view comparison.
  • apps/ll-driver-detect/CMakeLists.txt
    • Removed CLI11::CLI11 from LINK_LIBRARIES.
    • Changed linglong::utils to linglong::linglong in LINK_LIBRARIES.
  • apps/ll-driver-detect/src/driver_detection_manager.cpp
    • Included linglong/utils/cmd.h.
    • Renamed detectAllDrivers to detectAvailableDrivers and updated its return type to std::vector<GraphicsDriverInfo>.
    • Modified driver detection logic to directly use std::vector<GraphicsDriverInfo> instead of DriverDetectionResult.
    • Updated logging to use packageVersion for driver information.
    • Added installDriverPackage method to handle driver installation using ll-cli.
  • apps/ll-driver-detect/src/driver_detection_manager.h
    • Removed DriverDetectionResult struct.
    • Updated detectAllDrivers signature to detectAvailableDrivers with the new return type.
    • Declared installDriverPackage method.
  • apps/ll-driver-detect/src/driver_detector.h
    • Modified GraphicsDriverInfo struct: removed version and isInstalled fields, added packageVersion and repoName.
    • Added pure virtual method checkPackageUpgradable.
  • apps/ll-driver-detect/src/main.cpp
    • Removed redundant include for linglong/utils/cmd.h.
    • Removed the standalone installDriverPackage function.
    • Updated calls to detectAllDrivers to detectAvailableDrivers.
    • Adjusted logic for checking detected drivers and displaying their information.
    • Updated calls to installDriverPackage to use the DriverDetectionManager instance.
  • apps/ll-driver-detect/src/nvidia_driver_detector.cpp
    • Added includes for linglong/package/version.h and nlohmann/json.hpp.
    • Refactored detect method to incorporate checks for installed and upgradable packages.
    • Replaced checkPackageExists with getPackageInfoFromRemoteRepo to retrieve detailed package information using ll-cli search --json.
    • Implemented checkPackageUpgradable method.
    • Added getInstalledGraphicsDriverInfo to parse ll-cli info --json output.
    • Added compareVersions helper function for version comparison.
  • apps/ll-driver-detect/src/nvidia_driver_detector.h
    • Updated method declarations to match changes in the .cpp file, including getPackageInfoFromRemoteRepo, checkPackageUpgradable, getInstalledGraphicsDriverInfo, and compareVersions.
  • libs/linglong/tests/ll-tests/CMakeLists.txt
    • Removed src/apps/ll-driver-detect/driver_detector_test.cpp from the test sources.
  • libs/linglong/tests/ll-tests/src/apps/ll-driver-detect/driver_detection_manager_test.cpp
    • Updated FakeSuccessDetector and FakeFailureDetector to align with the new GraphicsDriverInfo structure and DriverDetector interface.
    • Updated test calls from detectAllDrivers to detectAvailableDrivers.
  • libs/linglong/tests/ll-tests/src/apps/ll-driver-detect/driver_detector_test.cpp
    • File removed.
  • libs/linglong/tests/ll-tests/src/apps/ll-driver-detect/nvidia_driver_detector_test.cpp
    • Updated mock methods to reflect changes in NVIDIADriverDetector interface.
    • Modified test cases to validate the new detection and upgradability logic.
  • misc/share/bash-completion/completions/ll-builder
    • Added __ll_builder_get_commited_list function for dynamic completion.
    • Removed --exec option from build command completion.
    • Added --ref option and dynamic completion for export command.
    • Added remove command completion with --no-clean-objects option.
  • po/en_US.po
    • Updated POT-Creation-Date and Language to en_US.
    • Added Plural-Forms header.
    • Updated and added numerous msgid/msgstr pairs, reflecting changes in CLI messages and new driver detection notifications.
  • po/linyaps.pot
    • Updated POT-Creation-Date.
    • Synchronized message IDs with the latest source code changes.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Update CMakeLists version to 1.11.3.
@deepin-ci-robot

Copy link
Copy Markdown
Collaborator

deepin pr auto review

代码审查报告

总体评估

此次代码变更主要涉及驱动检测模块的重构和版本更新,包括驱动检测逻辑的改进、命令行参数处理的优化以及国际化文本的更新。整体代码质量较好,但存在一些可以改进的地方。

详细审查

1. apps/ll-cli/src/main.cpp 变更

语法逻辑

  • transformOldExec 函数简化了参数处理逻辑,移除了复杂的 wordexp 处理
  • ✅ 使用 std::string_view 替代 std::string 提高效率

代码质量

  • ⚠️ 新实现虽然更简单,但丢失了原有的参数展开功能(如通配符处理)
  • ⚠️ 缺少对 --exec 参数后参数数量的验证

改进建议

std::vector<std::string> transformOldExec(int argc, char **argv) noexcept
{
    std::vector<std::string> res;
    for (int i = argc - 1; i > 0; --i) {
        if (std::string_view(argv[i]) == "--exec") {
            // 验证后面是否有参数
            if (i + 1 >= argc) {
                qWarning() << "Missing argument after --exec";
                res.emplace_back("--exec"); // 保留原参数
                continue;
            }
            res.emplace_back("--");
        } else {
            res.emplace_back(argv[i]);
        }
    }
    return res;
}

2. apps/ll-driver-detect/src/driver_detection_manager.cpp 变更

语法逻辑

  • ✅ 将 installDriverPackage 从全局函数移为类成员函数,封装性更好
  • ✅ 简化了返回类型,直接返回 std::vector<GraphicsDriverInfo>

代码性能

  • ⚠️installDriverPackage 中使用字符串拼接构建 packageRef,可以考虑使用 fmt 库或 std::ostringstream 提高效率

改进建议

auto packageRef = fmt::format("{}/{}", info.packageName, info.packageVersion);

3. apps/ll-driver-detect/src/nvidia_driver_detector.cpp 变更

语法逻辑

  • ✅ 使用 JSON 解析替代简单的字符串匹配,更健壮
  • ✅ 添加了版本比较功能

代码安全

  • ⚠️ getPackageInfoFromRemoteRepo 中对 JSON 解析的异常处理不够全面
  • ⚠️ compareVersions 函数中版本解析失败时返回 false 可能导致误判

改进建议

bool NVIDIADriverDetector::compareVersions(std::string_view v1, std::string_view v2) const noexcept
{
    auto ver1 = package::Version::parse(std::string(v1));
    auto ver2 = package::Version::parse(std::string(v2));

    if (!ver1 || !ver2) {
        LogW("Failed to parse versions: {} , {}", v1, v2);
        // 返回错误状态而不是简单的false
        return false;
    }

    return *ver1 > *ver2;  // 解引用比较
}

4. 国际化文本更新

代码质量

  • ✅ 更新了日期和版本号
  • ✅ 修正了一些语法错误

改进建议

  • 建议添加更多上下文注释,帮助翻译人员理解文本用途
  • 对于技术术语,考虑添加术语表或注释

安全性考虑

  1. 命令注入风险

    • installDriverPackage 中直接使用 packageRef 构建命令,需要确保输入已经过验证
    • 建议添加参数验证,防止特殊字符注入
  2. JSON 解析

    • nvidia_driver_detector.cpp 中的 JSON 解析需要更严格的验证
    • 建议添加对 JSON 结构的完整验证

性能优化建议

  1. 字符串处理

    • 考虑使用 std::string_view 替代部分字符串拷贝
    • 对于频繁的字符串拼接,考虑使用 fmt
  2. 版本比较

    • 可以缓存解析后的版本对象,避免重复解析

总结

此次代码变更整体质量良好,主要改进了驱动检测模块的结构和功能。建议在以下几个方面进行改进:

  1. 加强输入验证和异常处理
  2. 优化字符串处理性能
  3. 完善错误处理机制
  4. 添加更多单元测试覆盖边界情况

代码风格基本一致,符合项目规范,建议继续保持。

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a significant refactoring of the driver detection and installation logic, centralizing functionality within the DriverDetectionManager and simplifying data structures. The argument parsing in ll-cli has been made safer and more straightforward. While these are positive changes for maintainability and security, I've identified a few critical issues: a logic bug in version comparison that could lead to incorrect upgrade decisions, and incomplete mock implementations in tests that will likely break the build. Addressing these issues is crucial before merging.

return false;
}

return v1 > v2;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

critical

There's a critical logic bug in the version comparison. The function parses the version strings into package::Version objects (ver1 and ver2) but then proceeds to compare the raw std::string_views (v1 > v2). This will result in lexicographical string comparison, which is incorrect for semantic versioning (e.g., "10.0.0" would be considered less than "9.0.0"). The comparison should be performed on the parsed Version objects.

Suggested change
return v1 > v2;
return *ver1 > *ver2;

@@ -16,18 +16,13 @@ using namespace linglong::driver::detect;
class FakeSuccessDetector : public DriverDetector

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

critical

The FakeSuccessDetector class inherits from DriverDetector but does not implement all of its pure virtual functions. The functions checkPackageInstalled and checkPackageUpgradable are missing. This will cause a compilation error. Please add dummy implementations for these methods.

class FakeSuccessDetector : public DriverDetector
{
public:
    FakeSuccessDetector(std::string identify, std::string name, std::string version)
        : info_{ std::move(identify), std::move(name), std::move(version) }
    {
    }

    linglong::utils::error::Result<GraphicsDriverInfo> detect() override { return info_; }

    utils::error::Result<bool> checkPackageInstalled(const std::string &) override
    {
        return false;
    }

    utils::error::Result<bool> checkPackageUpgradable(const std::string &) override
    {
        return false;
    }

    std::string getDriverIdentify() const override { return info_.identify; }

private:
    GraphicsDriverInfo info_;
};

#include "driver_detection_manager.h"
#include "driver_detector.h"
#include "linglong/utils/cmd.h"
#include "linglong/utils/global/initialize.h"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The header linglong/utils/global/initialize.h is included twice in this file (here and on line 14). To keep the code clean, one of these redundant includes should be removed.

@codecov

codecov Bot commented Feb 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 2.02020% with 97 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...ps/ll-driver-detect/src/nvidia_driver_detector.cpp 0.00% 58 Missing and 10 partials ⚠️
.../ll-driver-detect/src/driver_detection_manager.cpp 11.76% 14 Missing and 1 partial ⚠️
apps/ll-driver-detect/src/main.cpp 0.00% 10 Missing ⚠️
apps/ll-cli/src/main.cpp 0.00% 4 Missing ⚠️
Files with missing lines Coverage Δ
...ps/ll-driver-detect/src/driver_detection_manager.h 100.00% <ø> (+80.00%) ⬆️
apps/ll-driver-detect/src/driver_detector.h 100.00% <ø> (ø)
apps/ll-driver-detect/src/nvidia_driver_detector.h 50.00% <ø> (ø)
apps/ll-cli/src/main.cpp 0.00% <0.00%> (ø)
apps/ll-driver-detect/src/main.cpp 0.00% <0.00%> (ø)
.../ll-driver-detect/src/driver_detection_manager.cpp 21.42% <11.76%> (-18.58%) ⬇️
...ps/ll-driver-detect/src/nvidia_driver_detector.cpp 9.37% <0.00%> (-13.89%) ⬇️

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dengbo11 dengbo11 merged commit 0d09bde into OpenAtom-Linyaps:release/1.11 Feb 9, 2026
14 of 16 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