Skip to content

Conversation

@al1img
Copy link
Collaborator

@al1img al1img commented Dec 22, 2025

No description provided.

Copilot AI review requested due to automatic review settings December 22, 2025 18:38
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a new image manager component for handling OCI (Open Container Initiative) image layers within the SM (Service Manager) module. The implementation provides functionality for unpacking layer archives, calculating directory digests, and determining unpacked layer sizes.

Key Changes:

  • Added ImageHandler class with methods for layer unpacking, size calculation, and digest computation
  • Refactored common utilities: renamed HashDir to CalculateDirDigest for better clarity and extracted ChangeOwner into a reusable utility function
  • Extended OCI spec support to handle rootfs configuration in image configs

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
src/sm/imagemanager/imagehandler.hpp Defines ImageHandler interface with Init, UnpackLayer, GetUnpackedLayerSize, and GetUnpackedLayerDigest methods
src/sm/imagemanager/imagehandler.cpp Implements image layer handling including OCI whiteout conversion to overlayfs format
src/sm/imagemanager/tests/imagemanager.cpp Adds test for layer unpacking, size calculation, and digest verification
src/sm/imagemanager/tests/CMakeLists.txt Build configuration for image manager tests
src/sm/imagemanager/CMakeLists.txt Build configuration for image manager module
src/sm/app/CMakeLists.txt Integrates image manager library into SM application
src/sm/CMakeLists.txt Adds image manager subdirectory to SM build
src/common/utils/image.hpp Renames HashDir to CalculateDirDigest and updates ParseDigest signature
src/common/utils/image.cpp Updates digest calculation to include relative file paths and standardizes error message casing
src/common/utils/filesystem.hpp Adds ChangeOwner utility function declaration
src/common/utils/filesystem.cpp Implements ChangeOwner to recursively change file/directory ownership
src/common/utils/fsplatform.cpp Refactors ChangeOwner to use new filesystem utility function
src/common/utils/tests/image.cpp Updates test name from HashDirTest to CalculateDirDigest
src/common/ocispec/imageconfig.cpp Adds rootfs parsing and serialization support for OCI image configs
src/common/ocispec/tests/ocispec.cpp Adds rootfs test data to image config test fixture

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Move ChangeOwner to filesystem in order to use it without FS platform instance.

Signed-off-by: Oleksandr Grytsov <[email protected]>
Rename HashDir to CalculateDirDigest and uses Digest type name.

Signed-off-by: Oleksandr Grytsov <[email protected]>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link

codecov bot commented Dec 23, 2025

Codecov Report

❌ Patch coverage is 83.76623% with 25 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (feature_unification@2fa25b0). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/sm/imagemanager/imagehandler.cpp 65.38% 18 Missing ⚠️
src/sm/imagemanager/tests/imagemanager.cpp 93.22% 4 Missing ⚠️
src/common/utils/image.cpp 50.00% 3 Missing ⚠️
Additional details and impacted files
@@                  Coverage Diff                   @@
##             feature_unification     #120   +/-   ##
======================================================
  Coverage                       ?   82.20%           
======================================================
  Files                          ?      266           
  Lines                          ?    25209           
  Branches                       ?     2620           
======================================================
  Hits                           ?    20724           
  Misses                         ?     4485           
  Partials                       ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

Implement image handler interface for SM image manger. Most parts are taken from
previous image module.

Signed-off-by: Oleksandr Grytsov <[email protected]>
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant