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
Needs improved error handling and validation for automation #153
Comments
Thanks for reporting this @amimas ! We really do want this app to use proper exit codes as we run it in CI too. I'll check it out and first try to fix all the cases with exit code 0 while it should be non-zero. Then I’ll take a look at the dry run behavior. |
Sorry for keeping this on hold for so long, @amimas . Originally Gitlabform was ignoring all errors. But some users wanted a different behaviour, so we added it in #137 - now with Now I think that we need another feature, mutually exclusive with the above one: proceed forward on errors, but at the end exit with non-zero. I will implement it along with possible cleanup of the exit codes based on this issue. :) |
(This is a breaking change because GitLabForm v1.x exited with 0 in such case!) List the groups and projects that have failed, with their numbers. Add --start-from-group to allow retries from a given group number. (We used to have only --start-from for projects.) Always print the stacktraces on processing errors. Unify and document (in -h output) the exit codes used. Fixes #153.
On second thought the "proceed forward on errors, but at the end exit with non-zero" should be the default behavior as this is the right thing to do. If someone wants to ignore those errors, then they can always do As this is technically a backward-incompatible change I used this as an excuse to kick-off work on v2.0. 😅 2.0.0b1 contains these changes: main...v2.0.0b1 Can you please try out this version, @amimas ? |
(This is a breaking change because GitLabForm v1.x exited with 0 in such case!) List the groups and projects that have failed, with their numbers. Add --start-from-group to allow retries from a given group number. (We used to have only --start-from for projects.) Always print the stacktraces on processing errors. Unify and document (in -h output) the exit codes used. Fixes #153.
v2 final has been released. Please reopen this ticket if you still have issues. |
Thanks @gdubicki !! I haven't had a chance to try out v2 yet. I agree with the exit strategy mentioned above and glad to hear it's been implemented. Can't wait to try it out. |
I'm relatively new to GitlabForm. While setting up GitlabForm I noticed that the error handling is not consistent.
For example: if I provide an invalid config file path, GitlabForm quits with exit code
1
. But, if my configuration is invalid, GitlabForm quits with exit code0
.Right now my config mentions a project that does not exist. As a result, when GitlabForm is executed, it shows
NotFoundException
error but does not quit with a non-zero exit code.I had another error in the configuration which had also resulted in following exception but GitlabForm did not quit with a non-zero exit code.
This will be considered as successful if we rely on applying this configuration through GitLab CI pipeline (after change are merged or a scheduled pipeline). That means we can't rely on the pipeline's status. I have to manually inspect the log for every execution.
In addition, if I run the same config file (containing invalid project name) with
--noop
parameter for a dry run, it runs successfully without any error, which is misleading in this case. That means I can't rely on the dry run for an MR build or a branch build before config changes are merged.This issue could probably be split into 2. I'm curious to know if others have come across these issues and what workaround is being used, if any.
The text was updated successfully, but these errors were encountered: