Skip to content

Commit 616f7c1

Browse files
authored
[CP][CI] release branch template pre-commit (#78700)
* fix * devpr * fix
1 parent bb09abe commit 616f7c1

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

.github/workflows/CheckPRTemplate.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Check PR Template
22

33
on:
44
pull_request:
5-
branches: [develop]
5+
branches: [develop, release/**]
66
types: [opened, synchronize, reopened, edited]
77

88
jobs:

.github/workflows/Codestyle-Check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Codestyle-Check
22

33
on:
44
pull_request:
5-
branches: ["develop"]
5+
branches: [develop, release/**]
66

77
jobs:
88
check-bypass:

tools/CheckPRTemplate.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
REPO_TEMPLATE = {
2727
"Paddle": r'''### PR Category(.*[^\s].*)### PR Types(.*[^\s].*)### Description(.*[^\s].*)### 是否引起精度变化(.*[^\s].*)'''
2828
}
29-
elif BRANCH.startswith("fleety_"):
29+
elif BRANCH.startswith("release"):
3030
REPO_TEMPLATE = {
3131
"Paddle": r'''### PR Category(.*[^\s].*)### PR Types(.*[^\s].*)### Description(.*?devPR:https://github\.com/PaddlePaddle/Paddle/pull/.*?)(?:\n###|\Z)'''
3232
}
@@ -109,13 +109,13 @@ def parameter_accuracy(body):
109109
single_mess += f'{i}.'
110110
if len(single_mess) != 0:
111111
message += f'{key} should be in {test_list}. but now is [{single_mess}].'
112-
if BRANCH.startswith("fleety_"):
112+
if BRANCH.startswith("release"):
113113
PR_dic['Description'] = body[changes_end + len('### Description') :]
114114
des_pr_id = extract_pr_links(PR_dic['Description'])
115115
if len(des_pr_id) == 0 or not check_link_accessible(
116116
"https://github.com/PaddlePaddle/Paddle/pull/" + str(des_pr_id[0])
117117
):
118-
message += 'The PR link does not exist. To merge into the fleety branch, you need to merge into the develop branch first and then cherry-pick it to the fleety branch. Please merge into develop first and fill in the PR link in the Description'
118+
message += 'The PR link does not exist. To merge into the release branch, you need to merge into the develop branch first and then cherry-pick it to the release branch. Please merge into develop first and fill in the PR link in the Description. Use this format: devPR:https://github.com/PaddlePaddle/Paddle/pull/xxxx'
119119

120120
if BRANCH.startswith("develop"):
121121
accuracy_start = body.find('### 是否引起精度变化')
@@ -277,8 +277,8 @@ def checkPRTemplate(repo, body, CHECK_TEMPLATE):
277277
elif result is None:
278278
res = False
279279
message = parameter_accuracy(body)
280-
if BRANCH.startswith("fleety_") and len(message) == 0:
281-
message = 'The PR link does not exist. To merge into the fleety branch, you need to merge into the develop branch first and then cherry-pick it to the fleety branch. Please merge into develop first and fill in the PR link in the Description'
280+
if BRANCH.startswith("release") and len(message) == 0:
281+
message = 'The PR link does not exist. To merge into the release branch, you need to merge into the develop branch first and then cherry-pick it to the release branch. Please merge into develop first and fill in the PR link in the Description. Use this format: devPR:https://github.com/PaddlePaddle/Paddle/pull/xxxx'
282282
return res, message
283283

284284

0 commit comments

Comments
 (0)