Skip to content

MCP-driven machineImage Capabilities management - #48

Merged
anton-paulovich merged 1 commit into
masterfrom
capability-source-of-truth
Sep 1, 2026
Merged

anton-paulovich merged 1 commit into
masterfrom
capability-source-of-truth

Conversation

@anton-paulovich

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI lite review requested due to automatic review settings September 1, 2026 08:00

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

Pull request overview

This PR shifts OCI image capability handling to be driven by the CloudProfile’s spec.machineCapabilities: the controller passes capability annotation keys into the OCI source, the OCI source extracts/normalizes those annotations into Capabilities, and the image updater filters capability values based on the MachineCapabilities allowlist before writing capabilityFlavors.

Changes:

  • Extend OCISourceFactory / OCI source construction to accept a list of capability annotation keys from the controller.
  • Update OCI source capability extraction to support arbitrary annotation keys and normalize underscore-prefixed feature values (e.g. _usiusi).
  • Add capability filtering in the OS image updater based on CloudProfileSpec.MachineCapabilities, with updated/expanded tests.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
controllers/managedcloudprofile_controller.go Extends OCISourceFactory interface to accept capability keys.
controllers/managedcloudprofile_controller_test.go Updates test factories/mocks to match the new factory method signature.
controllers/cloud_profile.go Derives capability annotation keys from spec.machineCapabilities and passes them into the OCI source factory.
cloudprofilesync/ossync/source/oci/os_source.go Adds capability-key-driven annotation parsing and normalization; wires capability keys into OCI source.
cloudprofilesync/ossync/source/oci/os_source_test.go Updates tests for new OCI capability parsing/normalization behavior.
cloudprofilesync/ossync/os_image_updater.go Filters extracted capabilities against declared MachineCapabilities before writing capability flavors.
cloudprofilesync/ossync/os_image_updater_test.go Adds tests validating capability filtering behavior.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread cloudprofilesync/ossync/source/oci/os_source.go Outdated
Comment thread cloudprofilesync/ossync/os_image_updater.go Outdated
@anton-paulovich

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

Comment thread cloudprofilesync/ossync/source/oci/os_source.go Outdated
Comment thread cloudprofilesync/ossync/os_image_updater.go Outdated
Comment thread cloudprofilesync/ossync/source/oci/os_source.go Outdated
Comment thread cloudprofilesync/ossync/source/oci/os_source.go Outdated

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Comment thread cloudprofilesync/ossync/source/oci/os_source.go Outdated
Signed-off-by: Anton Paulovich <a.paulovich@sap.com>
Copilot AI review requested due to automatic review settings September 1, 2026 09:12
@anton-paulovich
anton-paulovich force-pushed the capability-source-of-truth branch from 8c913be to f9e2512 Compare September 1, 2026 09:12
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

Merging this branch changes the coverage (1 decrease, 2 increase)

Impacted Packages Coverage Δ 🤖
github.com/cobaltcore-dev/cloud-profile-sync/cloudprofilesync/ossync 95.45% (+1.63%) 👍
github.com/cobaltcore-dev/cloud-profile-sync/cloudprofilesync/ossync/source/oci 86.90% (-0.24%) 👎
github.com/cobaltcore-dev/cloud-profile-sync/controllers 70.08% (+10.98%) 🎉

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/cobaltcore-dev/cloud-profile-sync/cloudprofilesync/ossync/os_image_updater.go 95.45% (+1.63%) 132 (+51) 126 (+50) 6 (+1) 👍
github.com/cobaltcore-dev/cloud-profile-sync/cloudprofilesync/ossync/source/oci/os_source.go 86.90% (-0.24%) 84 (+14) 73 (+12) 11 (+2) 👎
github.com/cobaltcore-dev/cloud-profile-sync/controllers/cloud_profile.go 46.67% (-2.31%) 120 (+22) 56 (+8) 64 (+14) 👎
github.com/cobaltcore-dev/cloud-profile-sync/controllers/managedcloudprofile_controller.go 100.00% (ø) 34 (+2) 34 (+2) 0

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • github.com/cobaltcore-dev/cloud-profile-sync/cloudprofilesync/ossync/os_image_updater_test.go
  • github.com/cobaltcore-dev/cloud-profile-sync/cloudprofilesync/ossync/source/oci/os_source_test.go
  • github.com/cobaltcore-dev/cloud-profile-sync/controllers/managedcloudprofile_controller_test.go

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Comment thread cloudprofilesync/ossync/source/oci/os_source.go
@anton-paulovich anton-paulovich changed the title MCP-driven capability management MCP-driven machineImage Capabilities management Sep 1, 2026
@anton-paulovich
anton-paulovich merged commit 1c471eb into master Sep 1, 2026
8 checks passed
@anton-paulovich
anton-paulovich deleted the capability-source-of-truth branch September 1, 2026 10:06
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