-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(cli): store material info in crafting state #1714
refactor(cli): store material info in crafting state #1714
Conversation
Signed-off-by: Miguel Martinez <miguel@chainloop.dev>
@@ -89,7 +89,9 @@ func newAttestationAddCmd() *cobra.Command { | |||
// optimistic locking. We retry the operation if the state has changed since we last read it. | |||
return runWithBackoffRetry( | |||
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) |
There was a problem hiding this comment.
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>
@@ -206,7 +206,7 @@ func (m *Attestation_Material) CraftingStateToIntotoDescriptor(name string) (*in | |||
|
|||
// string materials don't have an artifact nor container, so a name is not available. |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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>
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 #1686To 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