Skip to content

Conversation

@migmartri
Copy link
Member

This PR is part of some refactoring that could simplify the implementation of #1686

The main change is that attestation add cmd now has available structured information of the material that was added, so then it can be rendered as part of #1686

To achieve that, we needed to update the underlying crafting state so the materials now can contain all its properties, as well as the identifier, as well as factoring out the material stateAPI->action translation code so it can be used outside of status command.

cc/ @Horiodino

Signed-off-by: Miguel Martinez <miguel@chainloop.dev>
@migmartri migmartri requested review from javirln and jiparis January 8, 2025 20:40
func() error {
if err := a.Run(cmd.Context(), attestationID, name, value, kind, annotations); err != nil {
// TODO: take the material output and show render it
_, err := a.Run(cmd.Context(), attestationID, name, value, kind, annotations)
Copy link
Member Author

Choose a reason for hiding this comment

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

this is the entrypoint that can help with implementing showing the material in the CLI

Signed-off-by: Miguel Martinez <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez <miguel@chainloop.dev>
material.Content = nMaterial.Content
}

// string materials don't have an artifact nor container, so a name is not available.
Copy link
Member

Choose a reason for hiding this comment

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

This probably is not true anymore. If the ID is outside the artifact, string materials would have an ID as well, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

not sure, since it's taking about name, ... let me double check

Signed-off-by: Miguel Martinez <miguel@chainloop.dev>
@migmartri migmartri merged commit 7dfb5c9 into chainloop-dev:main Jan 9, 2025
11 of 12 checks passed
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