Skip to content

Commit f232500

Browse files
committed
use more sensible branch name for creating easyblocks PR with --new-pr
1 parent 5f77fa0 commit f232500

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

easybuild/tools/github.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -901,6 +901,8 @@ def _easyconfigs_pr_common(paths, ecs, start_branch=None, pr_branch=None, start_
901901
if pr_branch is None:
902902
if ec_paths and pr_target_repo == GITHUB_EASYCONFIGS_REPO:
903903
label = file_info['ecs'][0].name + re.sub('[.-]', '', file_info['ecs'][0].version)
904+
elif pr_target_repo == GITHUB_EASYBLOCKS_REPO and paths.get('py_files'):
905+
label = os.path.splitext(os.path.basename(paths['py_files'][0]))[0]
904906
else:
905907
label = ''.join(random.choice(ascii_letters) for _ in range(10))
906908
pr_branch = '%s_new_pr_%s' % (time.strftime("%Y%m%d%H%M%S"), label)

test/framework/options.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4020,7 +4020,7 @@ def test_new_branch_github(self):
40204020
regexs = [
40214021
r"^== fetching branch 'develop' from https://github.com/easybuilders/easybuild-easyconfigs.git\.\.\.",
40224022
r"^== copying files to .*/easybuild-easyconfigs\.\.\.",
4023-
r"^== pushing branch '.*' to remote '.*' \(%s\) \[DRY RUN\]" % remote,
4023+
r"^== pushing branch '[0-9]{14}_new_pr_toy00' to remote '.*' \(%s\) \[DRY RUN\]" % remote,
40244024
]
40254025
self._assert_regexs(regexs, txt)
40264026

@@ -4041,7 +4041,7 @@ def test_new_branch_github(self):
40414041
regexs = [
40424042
r"^== fetching branch 'develop' from https://github.com/easybuilders/easybuild-easyblocks.git\.\.\.",
40434043
r"^== copying files to .*/easybuild-easyblocks\.\.\.",
4044-
r"^== pushing branch '.*' to remote '.*' \(%s\) \[DRY RUN\]" % remote,
4044+
r"^== pushing branch '[0-9]{14}_new_pr_toy' to remote '.*' \(%s\) \[DRY RUN\]" % remote,
40454045
]
40464046
self._assert_regexs(regexs, txt)
40474047

@@ -4068,7 +4068,7 @@ def test_new_branch_github(self):
40684068
regexs = [
40694069
r"^== fetching branch 'develop' from https://github.com/easybuilders/easybuild-framework.git\.\.\.",
40704070
r"^== copying files to .*/easybuild-framework\.\.\.",
4071-
r"^== pushing branch '.*' to remote '.*' \(%s\) \[DRY RUN\]" % remote,
4071+
r"^== pushing branch '[0-9]{14}_new_pr_[A-Za-z]{10}' to remote '.*' \(%s\) \[DRY RUN\]" % remote,
40724072
]
40734073
self._assert_regexs(regexs, txt)
40744074

0 commit comments

Comments
 (0)