feat(attestation): preserve chainloop.* annotations in NormalizedMaterial#2874
Merged
migmartri merged 3 commits intochainloop-dev:mainfrom Mar 18, 2026
Merged
Conversation
…rial Previously, normalizeMaterial() stripped all chainloop.* prefixed annotations from NormalizedMaterial.Annotations. This made internal system annotations (e.g. chainloop.material.size, chainloop.material.cas, chainloop.material.tool.name) unavailable to downstream consumers such as the attestation service, graph view, and policy evaluation. Remove the continue that skipped chainloop.* keys and add a structValueToString helper to correctly convert all structpb value types (string, bool, number) since some annotations like chainloop.material.cas are stored as BoolValue, for which GetStringValue() returns "". Fixes: chainloop-dev#2872 Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
There was a problem hiding this comment.
1 issue found across 4 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="pkg/attestation/renderer/chainloop/v02.go">
<violation number="1" location="pkg/attestation/renderer/chainloop/v02.go:532">
P2: `structValueToString` still drops non-scalar annotation values by converting them to an empty string.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
…ToString JSON-marshal StructValue and ListValue types instead of returning an empty string, so annotations stored as complex types are preserved. Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
Update plugin SDK summary table golden files to include the newly preserved chainloop.* annotations in material output. Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
javirln
approved these changes
Mar 18, 2026
Piskoo
approved these changes
Mar 18, 2026
Member
Author
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
normalizeMaterial()was stripping allchainloop.*prefixed annotations fromNormalizedMaterial.Annotations, making internal system annotations (e.g.chainloop.material.size,chainloop.material.cas,chainloop.material.tool.name) unavailable to downstream consumerscontinuethat skippedchainloop.*keys so all annotations flow through to the mapstructValueToStringhelper to correctly serialize all structpb value types — necessary because some annotations likechainloop.material.casare stored asBoolValue(for whichGetStringValue()returns"")Closes #2872