feature: Return the image hash with final gRPC message#561
Conversation
There was a problem hiding this comment.
Pull request overview
This PR extends Trident’s gRPC servicing completion response to optionally include the SHA-384 (formatted as sha384:<hex>) for the image involved in the operation, and threads that value through the server task execution pipeline.
Changes:
- Adds
optional string image_hashtotrident.v1.Completedprotobuf message. - Updates servicing task plumbing to propagate an optional
Sha384Hashfrom operations into the finalCompletedresponse. - Updates Trident install/update/stream_image to return
(ExitKind, Option<Sha384Hash>)and adapts gRPC handlers / CLI call sites accordingly.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| proto/trident/v1/servicing.proto | Adds Completed.image_hash field and documents expected format. |
| crates/trident/src/server/tridentserver/servicingmgr.rs | Changes task result type to include optional hash and populates Completed.image_hash. Updates tests for new return type. |
| crates/trident/src/server/tridentserver/service_impl.rs | Wires image hash into specific gRPC preview services (commit/rebuild_raid) and adds helper to read hash from datastore. |
| crates/trident/src/server/tridentserver/mod.rs | Updates servicing_request signature to accept tasks returning (ExitKind, Option<Sha384Hash>). |
| crates/trident/src/main.rs | Adapts CLI install/update call sites to ignore the newly returned image hash. |
| crates/trident/src/lib.rs | Updates install/update/stream_image APIs to return (ExitKind, Option<Sha384Hash>) and propagates image metadata SHA-384. |
|
nit: bump harpoon-proto to 1.1? |
|
/AzurePipelines run [GITHUB]-trident-pr-e2e |
|
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Pull request overview
This PR extends the gRPC Completed message to optionally include the SHA-384 (metadata) hash of the OS image associated with a streamed servicing operation, and plumbs that value through the server/task execution path.
Changes:
- Add
optional string image_hash = 4toCompletedin the servicing proto. - Thread an
Option<Sha384Hash>through servicing task execution and setCompleted.image_hash(formatted assha384:<hash>). - Bump
trident-protocrate version to reflect the wire/API change.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| proto/trident/v1/servicing.proto | Adds Completed.image_hash field to the gRPC response schema. |
| crates/trident/src/server/tridentserver/servicingmgr.rs | Changes servicing task return type to include an optional SHA-384 and populates Completed.image_hash. Updates unit tests to compile with the new return type. |
| crates/trident/src/server/tridentserver/service_impl.rs | Retrieves/stashes stored image hash for operations that don’t directly stream, and adapts commit/rebuild responses to the new tuple return type. |
| crates/trident/src/server/tridentserver/mod.rs | Updates servicing request function bound to accept (ExitKind, Option<Sha384Hash>). |
| crates/trident/src/main.rs | Adapts CLI install/update call sites to the new tuple return type by mapping back to ExitKind. |
| crates/trident/src/lib.rs | Updates Trident::{install,update,stream_image} to return (ExitKind, Option<Sha384Hash>) and capture image hash where available. |
| crates/trident-proto/Cargo.toml | Bumps trident-proto version for the API change. |
| Cargo.lock | Updates lockfile for the trident-proto version bump. |
|
/AzurePipelines run [GITHUB]-trident-pr-e2e |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This adds an additional field to the Completed message returned by the gRPC server when streaming an image finishes that indicates the sha384 of the image that was streamed.