Skip to content

feature: Return the image hash with final gRPC message#561

Merged
fintelia merged 4 commits into
mainfrom
user/jbehrens/return-hash
Mar 19, 2026
Merged

feature: Return the image hash with final gRPC message#561
fintelia merged 4 commits into
mainfrom
user/jbehrens/return-hash

Conversation

@fintelia
Copy link
Copy Markdown
Contributor

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.

@fintelia fintelia requested a review from a team as a code owner March 16, 2026 20:45
Copilot AI review requested due to automatic review settings March 16, 2026 20:45
Copy link
Copy Markdown
Contributor

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 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_hash to trident.v1.Completed protobuf message.
  • Updates servicing task plumbing to propagate an optional Sha384Hash from operations into the final Completed response.
  • 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.

Comment thread crates/trident/src/server/tridentserver/service_impl.rs
Comment thread crates/trident/src/server/tridentserver/service_impl.rs
Comment thread crates/trident/src/server/tridentserver/servicingmgr.rs
Comment thread proto/trident/v1/servicing.proto Outdated
Comment thread crates/trident/src/server/tridentserver/servicingmgr.rs
Comment thread proto/trident/v1/servicing.proto
Comment thread crates/trident/src/lib.rs
frhuelsz
frhuelsz previously approved these changes Mar 17, 2026
@frhuelsz
Copy link
Copy Markdown
Contributor

nit: bump harpoon-proto to 1.1?

Copilot AI review requested due to automatic review settings March 18, 2026 18:44
@fintelia
Copy link
Copy Markdown
Contributor Author

/AzurePipelines run [GITHUB]-trident-pr-e2e

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Copy Markdown
Contributor

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 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 = 4 to Completed in the servicing proto.
  • Thread an Option<Sha384Hash> through servicing task execution and set Completed.image_hash (formatted as sha384:<hash>).
  • Bump trident-proto crate 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.

Comment thread crates/trident/src/server/tridentserver/servicingmgr.rs
@fintelia
Copy link
Copy Markdown
Contributor Author

/AzurePipelines run [GITHUB]-trident-pr-e2e

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@fintelia fintelia merged commit d199e3a into main Mar 19, 2026
92 checks passed
@fintelia fintelia deleted the user/jbehrens/return-hash branch March 19, 2026 23:05
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