From b2b115b7bd2f5f4d041a8b31cae0c5e6e18609b4 Mon Sep 17 00:00:00 2001 From: Konstantin Kharlamov Date: Fri, 18 Dec 2020 17:32:09 +0300 Subject: [PATCH] Mention in docs what determines a succeeded pipeline (#282) * marge.app: print stdout/stderr for Exceptions This fixes the following problem: bot executes various commands with the `timeout` arg, and may throw a TimeoutExpired exception. However, printing TimeoutExpired exception won't print stdout and stderr. Due to absence of stdout/stderr anywhere in the output this confuses and looks like the command didn't manage to get too far in execution. Like for example, as if the remote server didn't respond, making a `git clone` to time out. Signed-off-by: Konstantin Kharlamov * README.md: mention what determines whether marge-bot waits for pipeline Fixes: #281 Signed-off-by: Konstantin Kharlamov --- README.md | 6 +++++- marge.app | 11 ++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ce69bf9e..9f1b4043 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,10 @@ message on the merge-request, so you'll get notified. Marge-bot can handle an adversarial environment where some developers prefer to merge their own changes, so the barrier for adoption is really low. +Whether marge-bot will or not wait for pipeline to succeed depends on the value of "✓ +Pipelines must succeed" checkbox in your repo. It is available in all Gitlab +versions, so should not be a barrier. + Since she is at it, she can optionally provide some other goodies like tagging of commits (e.g. `Reviewed-by: ...`) or preventing merges during certain hours. @@ -240,7 +244,7 @@ docker run --restart=on-failure \ --config-file=/configuration/marge-bot-config.yaml ``` -By default docker will use the `latest` tag, which corresponds to the latest +By default docker will use the `latest` tag, which corresponds to the latest stable version. You can also use the `stable` tag to make this more explicit. If you want a development version, you can use the `master` tag to obtain an image built from the HEAD commit of the `master` branch. Note that this image diff --git a/marge.app b/marge.app index c8202d93..1d2b6c50 100755 --- a/marge.app +++ b/marge.app @@ -1,3 +1,12 @@ #!/usr/bin/env python3 import marge.app -marge.app.main() + +try: + marge.app.main() +except Exception as e: + print('Exception occured') + if hasattr(e, 'stdout'): + print(f'stdout was: {e.stdout}') + if hasattr(e, 'stderr'): + print(f'stderr was: {e.stderr}') + raise