Skip to content

Commit

Permalink
Mention in docs what determines a succeeded pipeline (#282)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>

* README.md: mention what determines whether marge-bot waits for pipeline

Fixes: #281

Signed-off-by: Konstantin Kharlamov <[email protected]>
  • Loading branch information
Hi-Angel authored Dec 18, 2020
1 parent c5f6300 commit b2b115b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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
Expand Down
11 changes: 10 additions & 1 deletion marge.app
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit b2b115b

Please sign in to comment.