From f836fd0e1b28d04b7fbe509950e53024bf540e13 Mon Sep 17 00:00:00 2001 From: Tim McCormack Date: Mon, 29 Jul 2024 15:13:05 +0000 Subject: [PATCH] feat: Add runbook hint to merge_approved_prs.py Also fix the module description. --- tubular/scripts/merge_approved_prs.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tubular/scripts/merge_approved_prs.py b/tubular/scripts/merge_approved_prs.py index 4b417273..1d825f84 100755 --- a/tubular/scripts/merge_approved_prs.py +++ b/tubular/scripts/merge_approved_prs.py @@ -1,7 +1,11 @@ #! /usr/bin/env python3 """ -Command-line script to trigger a jenkins job +Script to merge private patches into a temporary commit for deployment. + +This is intended to be used with edx/edx-platform-private according to +2U's private patch process: +https://2u-internal.atlassian.net/wiki/spaces/ENG/pages/19466701/LMS+Studio+Security+Fix+Process """ from datetime import datetime import logging @@ -145,7 +149,14 @@ def octomerge( for pr in approved_prs ) )) - local_repo.octopus_merge(target_branch, [pr.head.sha for pr in approved_prs]) + try: + local_repo.octopus_merge(target_branch, [pr.head.sha for pr in approved_prs]) + except BaseException as e: + logging.error( + "Merging of private PRs failed; see this runbook for hints: " + "https://2u-internal.atlassian.net/wiki/spaces/ENG/pages/19466701/LMS+Studio+Security+Fix+Process#Deployments-are-failing-in-the-build_edxapp_amis%2Fprerelease_materials_job-step-in-GoCD" + ) + raise e else: logging.info("No PRs to merge")