Skip to content
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

fix(attestation): push on dry-run #932

Merged
merged 2 commits into from
Jun 11, 2024

Conversation

migmartri
Copy link
Member

There was a problem while trying to att push an attestation that was initialized in dry-run mode. The validation error was

ERR invalid crafting state: validation error:
 - attestation.workflow.organization: value length must be at least 1 character [string.min_len]

This patch skips that schema validation when running in dry-run mode since in this mode it's know to not to be fully complete.

refs #796

Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
@@ -81,6 +81,10 @@ func newAttestationInitCmd() *cobra.Command {
return newGracefulError(err)
}

if res.DryRun {
logger.Info().Msg("The attestation is being crafted in dry-run mode. It will not get stored once rendered")
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 just removing the dry-run output from stdout and move it to stderr as we are doing lately in the rest of the code.

Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
Copy link
Member

@javirln javirln left a comment

Choose a reason for hiding this comment

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

Thanks Migue!

@migmartri migmartri merged commit 48a9540 into chainloop-dev:main Jun 11, 2024
13 checks passed
@migmartri migmartri deleted the fix-dry-run-push branch June 11, 2024 06:08
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.

None yet

2 participants