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(conditions) prints validation error when found #398

Merged
merged 1 commit into from
Nov 26, 2021

Conversation

dduportal
Copy link
Contributor

This PR is a fix for a bug I found while working on #289 .

It ensures that the validation error messages are printed to the end user when a condition failed to be validated.

Test

With a manifest having the following condition (missing spec.file)

# ...
conditions:
  checkUsername:
    kind: yaml
    spec:
      key: github.username

With updatecli 0.16.0, you got:

# ...
CONDITIONS:
===========

checkUsername
-------------
✗ condition not met, skipping pipeline

=> result is expected but no message to help the end user.

With this PR, you got:

$ go build -o ./dist/updatecli && ./dist/updatecli diff
# ...
CONDITIONS:
===========

checkUsername
-------------
ERROR: Validation error: the provided manifest configuration had the following validation errors:
Invalid spec for yaml resource: 'file' is empty.

✗ condition not met, skipping pipeline

=> which is clearly an improvement

Additional Information

Tradeoff

Potential improvement

Signed-off-by: Damien Duportal <damien.duportal@gmail.com>
@dduportal dduportal added bug Something isn't working condition Modify condition resource labels Nov 26, 2021
@dduportal dduportal added this to the 0.16.1 milestone Nov 26, 2021
@dduportal
Copy link
Contributor Author

@olblak I've added this to the 0.16.1 as it's clearly worth a patch: sounds good for you?

@olblak olblak merged commit 1efbf60 into updatecli:main Nov 26, 2021
@dduportal dduportal deleted the fix/condition-validations branch November 26, 2021 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working condition Modify condition resource
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants