Skip to content

Release 1.12.3#1650

Merged
dengbo11 merged 18 commits into
OpenAtom-Linyaps:release/1.12from
dengbo11:release-1.12
Apr 24, 2026
Merged

Release 1.12.3#1650
dengbo11 merged 18 commits into
OpenAtom-Linyaps:release/1.12from
dengbo11:release-1.12

Conversation

@dengbo11

Copy link
Copy Markdown
Collaborator

No description provided.

guanzi008 and others added 18 commits April 24, 2026 16:19
Return empty RefStatistics when building against ostree versions that do not provide ostree_commit_get_object_sizes.

(cherry picked from commit 20644c8)
 - Make OSTreeRepo::loadFromPath read repo config only
 - Make OSTreeRepo::create prefer repo config and persist fallback config
   when absent
 - Add repo and repo cache tests

Signed-off-by: reddevillg <reddevillg@gmail.com>
Work around Qt 6 D-Bus bug where unregistered meta types
cause runtime failures. This issue affects various distributions shipping
affected Qt 6 versions (e.g., Ubuntu 24.04).

Link: https://qt-project.atlassian.net/browse/QTBUG-108822
Signed-off-by: ComixHe <ComixHe1895@outlook.com>
Refactor getRunningAppContainers to return Result type for better error
handling
Add container ID prefix matching for more flexible container selection
Improve error messages for multiple matching containers
Update all callers to handle the new Result type properly

The changes enhance container management by:
1. Changing getRunningAppContainers to return utils::error::Result for
proper error propagation
2. Adding container ID prefix matching in addition to package ID
matching
3. Providing clearer error messages when multiple containers match
4. Updating enter, kill, and getBundleDir methods to handle the new
error handling pattern
5. Fixing path output in getLayerDir to use string() method

This improves user experience by allowing partial container ID matching
and providing more specific error messages when multiple containers
are found.

Log: Improved container selection with better error messages and partial
ID matching

Influence:
1. Test container enter command with partial container ID
2. Verify error messages when multiple containers match a prefix
3. Test kill command with different container identification methods
4. Verify bundle and layer directory inspection commands work correctly
5. Test edge cases with no containers found or multiple matches
6. Validate error handling for invalid container references
- Add URL encode/decode utilities for D-Bus address options
- Refactor D-Bus address parsing to follow specification
- Update trim/split to return string_view for efficiency

Signed-off-by: ComixHe <ComixHe1895@outlook.com>
The `<climits>` header is required for PATH_MAX constants.
* i18n: Translate policy.ts in pt_BR

100% translated source file: 'policy.ts'
on 'pt_BR'.

* i18n: Translate po/en_US.po in pt_BR

83% of minimum 50% translated source file: 'po/en_US.po'
on 'pt_BR'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* i18n: Translate po/en_US.po in pt_BR

87% of minimum 50% translated source file: 'po/en_US.po'
on 'pt_BR'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* i18n: Translate po/en_US.po in pt_BR

90% of minimum 50% translated source file: 'po/en_US.po'
on 'pt_BR'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* i18n: Translate po/en_US.po in pt_BR

92% of minimum 50% translated source file: 'po/en_US.po'
on 'pt_BR'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* i18n: Translate po/en_US.po in pt_BR

98% of minimum 50% translated source file: 'po/en_US.po'
on 'pt_BR'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* i18n: Translate po/en_US.po in pt_BR

100% translated source file: 'po/en_US.po'
on 'pt_BR'.

---------

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
- Centralize third-party library target generation in gen_library_target()
- Support static/in-box builder utility linking for all deps

Signed-off-by: reddevillg <reddevillg@gmail.com>
Extract the fallback mechanism for pulling binary modules info reusable
helper functions.  When pulling a binary module fails with "No such branch",
the code now falls back to the runtime ref.

Signed-off-by: reddevillg <reddevillg@gmail.com>
1. Add systemd sandboxing directives to enhance service security
isolation
2. Implement ProtectSystem=full with specific ReadWritePaths for
necessary data access
3. Enable kernel and control group protection mechanisms
pressure
4. Remove explicit Restart policy, likely relying on D-Bus activation
behavior

Influence:
1. Verify ll-package-manager service starts successfully with new
security constraints
2. Test package installation, removal, and update operations to ensure
file system access is preserved
3. Confirm service isolation prevents unauthorized access to /home and
system directories
4. Verify D-Bus activation works correctly for the PackageManager
service
5. Check system behavior and service status if the process encounters a
failure (verify no auto-restart)
1. Added trailing newline to policy_pt_BR.ts Brazilian Portuguese
translation file
2. The file previously ended without a newline character
3. This follows POSIX standards where text files should end with a
newline
4. Prevents "No newline at end of file" warnings in git diffs and editor
messages

Influence:
1. Verify the XML translation file is still valid and well-formed
2. Confirm polkit policy translations load correctly for Brazilian
Portuguese locale
3. Check that the file displays correctly in text editors without
warnings
1. Add QDirIterator::FollowSymlinks flag to directory iterator in
Cli::content method
2. This enables proper resolution of desktop files from symlinked
entries/share directories
3. Previously, symlinks in the entries directory were not being
followed, causing desktop files pointed to by symbolic links to be
missed
4. Add two test cases to verify symlink resolution works correctly:
   - contentResolvesDesktopFromSymlinkedEntriesShareDir: tests resolving
desktop from symlinked entries
   - contentResolvesOverlayDesktopFromSymlinkedEntriesShareDir: tests
overlay desktop resolution with symlinks

Influence:
1. Test content command with applications that have symlinked entries/
share directories
2. Verify desktop file discovery works correctly when entries/share is a
symlink to files/share
3. Test both default directory fallback and overlay directory scenarios
with symlinked paths
4. Verify no regression in normal (non-symlinked) directory traversal
5. Test that symlinked directories pointing outside expected paths are
handled safely
1. Removed MemoryMax=8G directive to allow the package manager service
to utilize available system memory without artificial constraints
2. Removed Restart=on-failure and RestartSec=10 directives to rely on
default system service supervision behavior

Influence:
1. Verify the ll-package-manager service starts successfully without the
removed directives
2. Monitor memory usage during large package operations to ensure system
stability without the 8G cap
3. Test service behavior under failure conditions to verify default
restart policies are appropriate
4. Confirm service functionality remains unchanged after configuration
modification
1. Prune when uninstalling an app.
2. Remove all refs/objects in ostree if they are not referenced by any
   app.

Signed-off-by: reddevillg <reddevillg@gmail.com>
1. Removed the check that prevented root users from writing to
states.json during cache rebuild
2. The previous workaround was needed when ll-cli could make states.json
owned by root, causing permission issues
3. This restriction is no longer necessary as the underlying ownership
issue has been addressed
4. Root users can now fully rebuild the repository cache without
skipping the write operation

Log: Root users can now rebuild the repository cache and persist changes
to states.json

Influence:
1. Test RepoCache rebuild functionality when running as root user
2. Verify states.json is correctly written and readable by both root and
non-root users
3. Test cache rebuild in scenarios where ll-cli initializes the
repository as root
4. Verify file ownership and permissions of states.json after root-
initiated rebuilds
5. Test cache persistence across multiple rebuild operations as root
6. Verify no permission denied errors occur during cache writes as root
release 1.12.3.
@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

@dengbo11 dengbo11 merged commit eb48f94 into OpenAtom-Linyaps:release/1.12 Apr 24, 2026
13 of 14 checks passed

@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 refactors the project to use std::filesystem::path instead of QDir for repository management, updates the OSTreeRepo and RepoCache APIs for better initialization and error handling, and improves D-Bus address parsing for container configuration. It also includes a version bump to 1.12.3, updated translations, and various cleanups in the build system and service files. Feedback focuses on the OSTreeRepo implementation, specifically recommending the replacement of assert with proper error handling for memory allocations, correcting the handling of "local" remotes and empty remote strings in ostree API calls, and fixing the incorrect use of ostree_parse_refspec when iterating over repository references.

Comment on lines +1194 to +1204
g_autoptr(GError) parseErr = nullptr;
g_autofree char *remote = nullptr;
g_autofree char *ref = nullptr;
if (ostree_parse_refspec(entry.refspec.c_str(), &remote, &ref, &parseErr) == FALSE) {
return LINGLONG_ERR(fmt::format("ostree_parse_refspec {}", ptr_view(parseErr)));
}

auto removedRef = this->removeOstreeRef(remote ? remote : "", ref ? ref : "", entry.commit);
if (!removedRef) {
return LINGLONG_ERR(removedRef);
}

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.

high

Using ostree_parse_refspec on the keys returned by ostree_repo_list_refs is incorrect. ostree_repo_list_refs returns ref names relative to refs/ (e.g., heads/master or remotes/origin/master). ostree_parse_refspec expects a format like REMOTE:REF. For the keys from list_refs, you should treat them as the full ref name and pass an empty remote to removeOstreeRef, which will correctly resolve and delete them relative to refs/.

        auto removedRef = this->removeOstreeRef("", entry.refspec, entry.commit);
        if (!removedRef) {
            return LINGLONG_ERR(removedRef);
        }

Comment on lines 345 to +346
ostreeRepo = ostree_repo_new(repoPath);
Q_ASSERT(ostreeRepo != nullptr);
assert(ostreeRepo != nullptr);

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

Using assert for checking the result of ostree_repo_new is not suitable for production code, as it is typically disabled in release builds. If ostree_repo_new fails (e.g., due to memory allocation issues), the program will crash on the subsequent ostree_repo_create call. It is better to check for nullptr and return a LINGLONG_ERR.

    ostreeRepo = ostree_repo_new(repoPath);
    if (ostreeRepo == nullptr) {
        return LINGLONG_ERR("failed to allocate ostree repo");
    }


std::string refspec = ostreeRefSpecFromLayerItem(layer);
std::string ref = ostreeRefFromLayerItem(layer);
auto refspec = remote.empty() ? ref : remote + ":" + ref;

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 string "local" is used in this project to represent a local repository (e.g., in importLayerDir). However, ostree does not recognize "local" as a special remote name. If remote is "local", it should be treated as an empty string so that the ref is resolved correctly as a local ref.

    auto refspec = (remote.empty() || remote == "local") ? ref : remote + ":" + ref;

Comment on lines 534 to 536
if (ostree_repo_set_ref_immediate(this->ostreeRepo.get(),
layer.repo.c_str(),
remote.c_str(),
ref.c_str(),

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 ostree_repo_set_ref_immediate function expects NULL for the remote argument when dealing with local refs. Passing an empty string ("") may not be handled the same way by the underlying GLib/Ostree implementation. It is safer to pass nullptr if the remote name is empty or "local".

        if (ostree_repo_set_ref_immediate(this->ostreeRepo.get(),
                                          (remote.empty() || remote == "local") ? nullptr : remote.c_str(),
                                          ref.c_str(),

@codecov

codecov Bot commented Apr 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 25.81262% with 388 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
libs/linglong/src/linglong/repo/ostree_repo.cpp 34.85% 141 Missing and 16 partials ⚠️
...glong/oci-cfg-generators/container_cfg_builder.cpp 0.00% 78 Missing ⚠️
...g/src/linglong/package_manager/package_manager.cpp 0.00% 50 Missing ⚠️
libs/linglong/src/linglong/cli/cli.cpp 0.00% 37 Missing and 1 partial ⚠️
apps/ll-package-manager/src/main.cpp 0.00% 24 Missing ⚠️
apps/ll-builder/src/main.cpp 0.00% 16 Missing ⚠️
libs/linglong/src/linglong/repo/repo_cache.cpp 33.33% 4 Missing and 8 partials ⚠️
libs/linglong/src/linglong/repo/config.cpp 33.33% 4 Missing and 2 partials ⚠️
apps/ll-cli/src/main.cpp 0.00% 3 Missing ⚠️
libs/common/src/linglong/common/strings.cpp 92.85% 0 Missing and 3 partials ⚠️
... and 1 more
Files with missing lines Coverage Δ
libs/common/src/linglong/common/strings.h 100.00% <ø> (ø)
libs/linglong/src/linglong/cli/cli.h 8.33% <ø> (ø)
...linglong/src/linglong/package/fallback_version.cpp 33.73% <100.00%> (ø)
...s/linglong/src/linglong/package/fallback_version.h 100.00% <100.00%> (ø)
...s/linglong/src/linglong/package_manager/action.cpp 46.51% <ø> (ø)
libs/linglong/src/linglong/repo/ostree_repo.h 9.09% <ø> (ø)
libs/linglong/src/linglong/repo/repo_cache.h 9.09% <ø> (-7.58%) ⬇️
...linglong/src/linglong/common/global/initialize.cpp 14.75% <0.00%> (ø)
apps/ll-cli/src/main.cpp 0.00% <0.00%> (ø)
libs/common/src/linglong/common/strings.cpp 97.29% <92.85%> (-2.71%) ⬇️
... and 8 more

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

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.

5 participants