Skip to content

feat(storage): add PatchSBOMAnnotations RPC and StorageClient wrapper - #59

Merged
matthyx merged 1 commit into
mainfrom
feat/patch-sbom-annotations
Sep 14, 2026
Merged

matthyx merged 1 commit into
mainfrom
feat/patch-sbom-annotations

Conversation

@matthyx

@matthyx matthyx commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements the server-side RPC and client wrapper proposed in https://github.com/armosec/private-node-agent/issues/464.

  • StorageService Proto:
    • Adds PatchSBOMAnnotations(PatchSBOMAnnotationsRequest) returns (PatchSBOMAnnotationsResponse) to StorageService.
    • Defines PatchSBOMAnnotationsRequest with image_digest, syft_version, set (map<string, string>), and delete (repeated string).
    • Defines PatchSBOMAnnotationsResponse with success, error_message, error_code, and sbom_metadata (SBOMMetadata).
    • Regenerates proto bindings with make proto.
  • StorageClient Wrapper:
    • Implements PatchSBOMAnnotations(ctx context.Context, imageDigest, syftVersion string, set map[string]string, del []string) (*proto.SBOMMetadata, error) on *StorageClient.
  • Unit Tests:
    • Adds tests for PatchSBOMAnnotations in storageclient_test.go covering successful set/delete merge, server-side failure responses, disconnected client error, and timeout handling.

Verification

  • make proto generated bindings cleanly.
  • go test ./... passes all test suites.

@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 7ab2c48a-8794-4d4c-ad01-d81d07588440


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@matthyx
matthyx force-pushed the feat/patch-sbom-annotations branch from fcfc14e to 2d4751a Compare August 17, 2026 09:57

@matthyx matthyx left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reviewed the proto additions, generated bindings, and the StorageClient.PatchSBOMAnnotations wrapper.

  • PatchSBOMAnnotations follows the exact same shape as the other unary wrappers in this file (withMetadata + callTimeout + Success check), so it's consistent with the rest of the client.
  • Proto changes are additive only (new RPC + two new messages, no field renumbering), so no wire compatibility concerns.
  • ERROR_CODE_SBOM_NOT_FOUND used in the test already exists in the ErrorCode enum, so that assertion is valid.
  • Tests cover the success/merge path, server-side failure, disconnected client, and call-timeout behavior — matches the coverage style of the neighboring GetSBOMStream tests.

Nit (non-blocking): the proto comment for PatchSBOMAnnotationsRequest doesn't say what happens when the same key appears in both set and delete. Worth a one-line doc clarification for whoever implements the server side, but not something to hold up this PR for.

No blockers found — this looks good to merge. Note: I couldn't submit a formal "Approve" review since GitHub doesn't allow approving your own pull request (this bot account is the PR author); flagging that here as the approval signal instead.

@matthyx matthyx moved this to WIP in KS PRs tracking Aug 17, 2026
Adds PatchSBOMAnnotations RPC to StorageService to enable atomic server-side
annotation updates on SBOM rows without downloading or re-uploading the full
S3 blob.

- Defines PatchSBOMAnnotationsRequest and PatchSBOMAnnotationsResponse in
  storage_service.proto.
- Regenerates proto bindings with make proto.
- Adds PatchSBOMAnnotations wrapper method to StorageClient.
- Adds comprehensive unit tests in storageclient_test.go covering success,
  server error, disconnected client, and call timeout handling.

Refs: armosec/private-node-agent#464
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
@matthyx
matthyx force-pushed the feat/patch-sbom-annotations branch from 2d4751a to 376ebc7 Compare September 14, 2026 15:47
@matthyx
matthyx merged commit 8aacf2f into main Sep 14, 2026
4 checks passed
@matthyx
matthyx deleted the feat/patch-sbom-annotations branch September 14, 2026 15:56
@matthyx matthyx moved this from WIP to To Archive in KS PRs tracking Sep 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

1 participant