Skip to content

Commit b8f193c

Browse files
authored
Merge pull request #3751 from migueldiascosta/milestone_warnings
warn about generic milestone in --review-pr and --merge-pr
2 parents c31e961 + f212e4f commit b8f193c

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

easybuild/framework/easyconfig/tools.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,12 @@ def review_pr(paths=None, pr=None, colored=True, branch='develop', testing=False
539539
if missing_labels:
540540
lines.extend(['', "This PR should be labelled with %s" % ', '.join(["'%s'" % ml for ml in missing_labels])])
541541

542+
if not pr_data['milestone']:
543+
lines.extend(['', "This PR should be associated with a milestone"])
544+
elif '.x' in pr_data['milestone']['title']:
545+
lines.extend(['', "This PR is associated with a generic '.x' milestone, "
546+
"it should be associated to the next release milestone once merged"])
547+
542548
return '\n'.join(lines)
543549

544550

easybuild/tools/github.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1183,7 +1183,10 @@ def not_eligible(msg):
11831183
# check whether a milestone is set
11841184
msg_tmpl = "* milestone is set: %s"
11851185
if pr_data['milestone']:
1186-
print_msg(msg_tmpl % "OK (%s)" % pr_data['milestone']['title'], prefix=False)
1186+
milestone = pr_data['milestone']['title']
1187+
if '.x' in milestone:
1188+
milestone += ", please change to the next release milestone once the PR is merged"
1189+
print_msg(msg_tmpl % "OK (%s)" % milestone, prefix=False)
11871190
else:
11881191
res = not_eligible(msg_tmpl % 'no milestone found')
11891192

0 commit comments

Comments
 (0)