Skip to content

Conversation

@Piskoo
Copy link
Collaborator

@Piskoo Piskoo commented Oct 24, 2025

This PR adds support for multiple tools extraction to metadata, while maintaining backwards compatibility.

Example

# legacy keys (first found tool)
chainloop.material.tool.name: Hub
chainloop.material.tool.version: 2025.4.2
# new key (all found tools)
chainloop.material.tools: [
  "Hub@2025.4.2",
  "cyclonedx-core-java@5.0.5"
]

Signed-off-by: Sylwester Piskozub <sylwesterpiskozub@gmail.com>
Signed-off-by: Sylwester Piskozub <sylwesterpiskozub@gmail.com>
Signed-off-by: Sylwester Piskozub <sylwesterpiskozub@gmail.com>
@Piskoo Piskoo marked this pull request as ready for review October 24, 2025 14:11
@migmartri
Copy link
Member

migmartri commented Oct 24, 2025

I am not a fan of keys with dynamic namespacing, it makes it very hard to consume, but @jiparis might have a different opinion.

I'd rather to have smth like

chainloop.material.tools: ["Hub@2025.4.2", "baz@deadbeed"] 

Signed-off-by: Sylwester Piskozub <sylwesterpiskozub@gmail.com>
Signed-off-by: Sylwester Piskozub <sylwesterpiskozub@gmail.com>
m.Annotations[AnnotationToolNameKey] = meta.Tools[0].Name
m.Annotations[AnnotationToolVersionKey] = meta.Tools[0].Version
// Extract all tools and set annotations
var tools []Tool
Copy link
Member

Choose a reason for hiding this comment

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

so even if we have one tool, it will use also the new annotation correct?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Correct, example:

WRN API contacted in insecure mode
INF uploading sbom.cyclonedx-1.5.json - sha256:5ca3508f02893b0419b266927f66c7b9dd8b11dbea7faf7cdb9169df8f69d8e3
INF material added to attestation
┌─────────────┬─────────────────────────────────────────────────────────────────────────┐
│ Name        │ skynet-sbom                                                             │
├─────────────┼─────────────────────────────────────────────────────────────────────────┤
│ Type        │ SBOM_CYCLONEDX_JSON                                                     │
├─────────────┼─────────────────────────────────────────────────────────────────────────┤
│ Required    │ No                                                                      │
├─────────────┼─────────────────────────────────────────────────────────────────────────┤
│ Value       │ sbom.cyclonedx-1.5.json                                                 │
├─────────────┼─────────────────────────────────────────────────────────────────────────┤
│ Digest      │ sha256:5ca3508f02893b0419b266927f66c7b9dd8b11dbea7faf7cdb9169df8f69d8e3 │
├─────────────┼─────────────────────────────────────────────────────────────────────────┤
│ Annotations │ ------                                                                  │
├─────────────┼─────────────────────────────────────────────────────────────────────────┤
│             │ chainloop.material.tools: ["syft@0.101.1"]                              │
├─────────────┼─────────────────────────────────────────────────────────────────────────┤
│             │ chainloop.material.tool.name: syft                                      │
├─────────────┼─────────────────────────────────────────────────────────────────────────┤
│             │ chainloop.material.tool.version: 0.101.1                                │
└─────────────┴─────────────────────────────────────────────────────────────────────────┘

Copy link
Member

@migmartri migmartri left a comment

Choose a reason for hiding this comment

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

LGTM, let's check with @jiparis

wantDigest: "sha256:fe2636fb6c698a29a315278b762b2000efd5959afe776ee4f79f1ed523365a33",
wantFilename: "sbom-spdx.json",
annotations: map[string]string{
"chainloop.material.tool.name": "syft",
Copy link
Member

Choose a reason for hiding this comment

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

yes, this one, thanks

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.

2 participants