107
107
'archived' : 'uses an archived toolchain' ,
108
108
'inactive' : 'no activity for > 6 months' ,
109
109
'obsolete' : 'obsoleted by more recent PRs' ,
110
+ 'retest' : 'closing and reopening to trigger tests' ,
110
111
}
111
112
112
113
@@ -668,7 +669,7 @@ def _easyconfigs_pr_common(paths, ecs, start_branch=None, pr_branch=None, start_
668
669
if paths ['easyconfigs' ]:
669
670
for path in paths ['easyconfigs' ]:
670
671
if not os .path .exists (path ):
671
- non_existing_paths .append (path )
672
+ non_existing_paths .append (path )
672
673
else :
673
674
ec_paths .append (path )
674
675
@@ -1109,6 +1110,8 @@ def close_pr(pr, motivation_msg=None):
1109
1110
1110
1111
dry_run = build_option ('dry_run' ) or build_option ('extended_dry_run' )
1111
1112
1113
+ reopen = motivation_msg == VALID_CLOSE_PR_REASONS ['retest' ]
1114
+
1112
1115
if not motivation_msg :
1113
1116
print_msg ("No reason or message specified, looking for possible reasons\n " )
1114
1117
possible_reasons = reasons_for_closing (pr_data )
@@ -1120,15 +1123,18 @@ def close_pr(pr, motivation_msg=None):
1120
1123
motivation_msg = ", " .join ([VALID_CLOSE_PR_REASONS [reason ] for reason in possible_reasons ])
1121
1124
print_msg ("\n No reason specified but found possible reasons: %s.\n " % motivation_msg , prefix = False )
1122
1125
1123
- msg = "@%s, this PR is being closed for the following reason(s): %s.\n " % (pr_data ['user' ]['login' ], motivation_msg )
1124
- msg += "Please don't hesitate to reopen this PR or add a comment if you feel this contribution is still relevant.\n "
1125
- msg += "For more information on our policy w.r.t. closing PRs, see "
1126
- msg += "https://easybuild.readthedocs.io/en/latest/Contributing.html"
1127
- msg += "#why-a-pull-request-may-be-closed-by-a-maintainer"
1126
+ msg = "@%s, this PR is being closed for the following reason(s): %s." % (pr_data ['user' ]['login' ], motivation_msg )
1127
+ if not reopen :
1128
+ msg += "\n Please don't hesitate to reopen this PR or add a comment if you feel this contribution is still "
1129
+ msg += "relevant.\n For more information on our policy w.r.t. closing PRs, see "
1130
+ msg += "https://easybuild.readthedocs.io/en/latest/Contributing.html"
1131
+ msg += "#why-a-pull-request-may-be-closed-by-a-maintainer"
1128
1132
post_comment_in_issue (pr , msg , account = pr_target_account , repo = pr_target_repo , github_user = github_user )
1129
1133
1130
1134
if dry_run :
1131
- print_msg ("[DRY RUN] Closed %s/%s pull request #%s" % (pr_target_account , pr_target_repo , pr ), prefix = False )
1135
+ print_msg ("[DRY RUN] Closed %s/%s PR #%s" % (pr_target_account , pr_target_repo , pr ), prefix = False )
1136
+ if reopen :
1137
+ print_msg ("[DRY RUN] Reopened %s/%s PR #%s" % (pr_target_account , pr_target_repo , pr ), prefix = False )
1132
1138
else :
1133
1139
github_token = fetch_github_token (github_user )
1134
1140
if github_token is None :
@@ -1139,6 +1145,11 @@ def close_pr(pr, motivation_msg=None):
1139
1145
status , data = pull_url .post (body = body )
1140
1146
if not status == HTTP_STATUS_OK :
1141
1147
raise EasyBuildError ("Failed to close PR #%s; status %s, data: %s" , pr , status , data )
1148
+ if reopen :
1149
+ body = {'state' : 'open' }
1150
+ status , data = pull_url .post (body = body )
1151
+ if not status == HTTP_STATUS_OK :
1152
+ raise EasyBuildError ("Failed to reopen PR #%s; status %s, data: %s" , pr , status , data )
1142
1153
1143
1154
1144
1155
def list_prs (params , per_page = GITHUB_MAX_PER_PAGE , github_user = None ):
0 commit comments