From 263f0a405a461489e41e16813c58b1ae75874079 Mon Sep 17 00:00:00 2001 From: EvaBardou Date: Tue, 18 Oct 2022 11:41:32 +0200 Subject: [PATCH] Improve error message when CRB fails to apply a patch (#1353) * Improve error message when CRB fails to apply a patch * Nit Co-authored-by: EvaBardou --- events/code_review_events/workflow.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/events/code_review_events/workflow.py b/events/code_review_events/workflow.py index d07e1724..09b20265 100644 --- a/events/code_review_events/workflow.py +++ b/events/code_review_events/workflow.py @@ -230,12 +230,18 @@ class CodeReview(PhabricatorActions): ) elif mode == "fail:mercurial": + extra_content = "" + if build.missing_base_revision: + extra_content = " because the parent revision ({}) does not exist on mozilla-unified. If possible, you should publish that revision".format( + build.base_revision + ) + failure = UnitResult( namespace="code-review", name="mercurial", result=UnitResultState.Fail, - details="WARNING: The code review bot failed to apply your patch.\n\n```{}```".format( - extras["message"] + details="WARNING: The code review bot failed to apply your patch{}.\n\n```{}```".format( + extra_content, extras["message"] ), format="remarkup", duration=extras.get("duration", 0),