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 <ebardou@teklia.com>
This commit is contained in:
EvaBardou 2022-10-18 11:41:32 +02:00 коммит произвёл GitHub
Родитель f7ef321ea4
Коммит 263f0a405a
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 8 добавлений и 2 удалений

Просмотреть файл

@ -230,12 +230,18 @@ class CodeReview(PhabricatorActions):
) )
elif mode == "fail:mercurial": 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( failure = UnitResult(
namespace="code-review", namespace="code-review",
name="mercurial", name="mercurial",
result=UnitResultState.Fail, result=UnitResultState.Fail,
details="WARNING: The code review bot failed to apply your patch.\n\n```{}```".format( details="WARNING: The code review bot failed to apply your patch{}.\n\n```{}```".format(
extras["message"] extra_content, extras["message"]
), ),
format="remarkup", format="remarkup",
duration=extras.get("duration", 0), duration=extras.get("duration", 0),