Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • postmarketOS/mrhlpr
  • longnoserob/mrhlpr
  • earboxer/mrhlpr
  • magdesign/mrhlpr
  • fossdd/mrhlpr
  • anjandev/mrhlpr
6 results
Show changes
Commits on Source (2)
......@@ -10,7 +10,8 @@ if [ "$(id -u)" = 0 ]; then
apk -q add \
py3-myst-parser \
py3-sphinx_rtd_theme \
py3-sphinxcontrib-autoprogram
py3-sphinxcontrib-autoprogram \
py3-sphinxcontrib-jquery
exec su "${TESTUSER:-build}" -c "sh -e $0"
fi
......
......@@ -35,6 +35,7 @@ extensions = [
"sphinx.ext.autosummary",
"sphinx.ext.doctest",
"sphinxcontrib.autoprogram",
"sphinxcontrib.jquery",
"myst_parser",
]
......
......@@ -549,16 +549,14 @@ def finish(
if skip_approve or (gl.user and mr.author and gl.user.id == mr.author.get("id")):
print("Skipping approval...")
else:
print("Approving MR...")
try:
mr.approve(git.sha())
# For some reason, approve fails with auth error if already approved...
except gitlab_api.GitlabAuthenticationError as e:
approved_by_ids = [ap["id"] for ap in mr.approval_state.get().rules[0]["approved_by"]]
if gl.user is None:
raise e
if gl.user.id not in approved_by_ids:
raise RuntimeError("Approving failed, and MR not yet approved") from e
if mr.approvals.get().attributes["user_has_approved"]:
print("MR has already been approved by you!")
else:
print("Approving MR...")
try:
mr.approve(git.sha())
except Exception as e:
raise RuntimeError("Approval failed, your approval was not added!") from e
if comment:
print("Adding the comment...")
......