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

Improve reporting of pipeline with wrong configuration #565

Merged
merged 9 commits into from
Mar 12, 2022

Conversation

olblak
Copy link
Member

@olblak olblak commented Mar 10, 2022

Improve reporting of pipeline with wrong configuration

Fix #552
This pull request allows to better identify which pipeline is failing due to a bad configuration.
Now It would show

+++++++++++
+ PREPARE +
+++++++++++

Loading Pipeline "updatecli/updatecli.d/golang.yaml"
Loading Pipeline "updatecli/updatecli.d/updatecli.yaml"
Loading Pipeline "updatecli/updatecli.d/venom.yaml"
ERROR: failed loading pipeline(s)
	* "updatecli/updatecli.d/golang.yaml" - scms ID "default2" referenced by pullrequest ID "default", doesn't exist
	* "updatecli/updatecli.d/updatecli.yaml" - scm id "default222" doesn't exist

instead of the old

+++++++++++
+ PREPARE +
+++++++++++

Loading Pipeline "updatecli/updatecli.d/golang.yaml"
Validating ""
Validating "GOLANG.YAML"
ERROR: ✗ scms ID "default2" referenced by pullrequest ID "default", doesn't exist
ERROR: Continuing and trying to go as far as possible

Test

To test this pull request, we needs updatecli configuration with wrong content and good content.

cp <to_package_directory>
go test

This pullrequest introduces a behavior change during the "prepare" stage.
Previously , it would just try to load as much configuration as possible and clone as much git repository as possible without failing. But now we exit if we couldn't load any pipeline or if something wrong happened with one of the git clones.

Additional Information

Tradeoff

Potential improvement

Implement the same behavior for git clones where it tries to clones as much repository as possible

Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
@olblak olblak added the bug Something isn't working label Mar 10, 2022
pkg/core/engine/main.go Outdated Show resolved Hide resolved
olblak and others added 3 commits March 11, 2022 14:24
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
dduportal
dduportal previously approved these changes Mar 11, 2022
Copy link
Contributor

@dduportal dduportal left a comment

Choose a reason for hiding this comment

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

Fine for me, but proposed improvement around the switch by asserting on the error's type.

It's not blocking but as soon as there is an else it's a smell: thanks for commenting as it helps to maintain this code (unless there is a unit test to help other maintainers than the one whom wrote the initial conditions).

pkg/core/engine/main.go Outdated Show resolved Hide resolved
pkg/core/engine/main.go Outdated Show resolved Hide resolved
Signed-off-by: Olblak <me@olblak.com>
@olblak olblak enabled auto-merge (squash) March 11, 2022 19:21
@olblak olblak self-assigned this Mar 11, 2022
@dduportal dduportal added enhancement New feature or request and removed bug Something isn't working labels Mar 12, 2022
@olblak olblak merged commit 3745f7a into updatecli:main Mar 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Validating "FILE" is displayed too often
3 participants