From 6656b6459c7069938c3ace66646048cee5527762 Mon Sep 17 00:00:00 2001 From: zjjlivein <1834792141@qq.com> Date: Thu, 18 Jan 2024 13:58:33 +0800 Subject: [PATCH 1/4] [CI] add ci approval pipelines --- scripts/ci_approval/check_pr_approval.py | 55 +++++++++ scripts/ci_approval/run_ci_approval.sh | 135 +++++++++++++++++++++++ 2 files changed, 190 insertions(+) create mode 100644 scripts/ci_approval/check_pr_approval.py create mode 100644 scripts/ci_approval/run_ci_approval.sh diff --git a/scripts/ci_approval/check_pr_approval.py b/scripts/ci_approval/check_pr_approval.py new file mode 100644 index 000000000000..5ec0fcbf07dd --- /dev/null +++ b/scripts/ci_approval/check_pr_approval.py @@ -0,0 +1,55 @@ +# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import json +import sys + + +def check_approval(count, required_reviewers): + json_buff = "" + for line in sys.stdin: + json_buff = "".join([json_buff, line]) + json_resp = json.loads(json_buff) + approves = 0 + approved_user_ids = [] + approved_user_logins = set() + for review in json_resp: + if review["state"] == "APPROVED": + approves += 1 + approved_user_ids.append(review["user"]["id"]) + approved_user_logins.add(review["user"]["login"]) + + # convert to int + required_reviewers_int = set() + required_reviewers_login = set() + for rr in required_reviewers: + if rr.isdigit(): + required_reviewers_int.add(int(rr)) + else: + required_reviewers_login.add(rr) + + if ( + len(set(approved_user_ids) & required_reviewers_int) + len(approved_user_logins & required_reviewers_login) + >= count + ): + print("TRUE") + else: + print("FALSE") + + +if __name__ == "__main__": + if len(sys.argv) > 1 and sys.argv[1].isdigit(): + check_approval(int(sys.argv[1]), sys.argv[2:]) + else: + print("Usage: python check_pr_approval.py [count] [required reviewer id] ...") diff --git a/scripts/ci_approval/run_ci_approval.sh b/scripts/ci_approval/run_ci_approval.sh new file mode 100644 index 000000000000..237da0b18d95 --- /dev/null +++ b/scripts/ci_approval/run_ci_approval.sh @@ -0,0 +1,135 @@ +#!/usr/bin/env bash + +# Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +failed_num=0 +echo_list=() +approval_line=`curl -H "Authorization: token ${GITHUB_API_TOKEN}" https://api.github.com/repos/PaddlePaddle/PaddleNLP/pulls/${GIT_PR_ID}/reviews?per_page=10000` + +function add_failed(){ + failed_num=`expr $failed_num + 1` + echo_list="${echo_list[@]}$1" +} + +function check_approval(){ + person_num=`echo $@|awk '{for (i=2;i<=NF;i++)print $i}'` + echo ${person_num} + APPROVALS=`echo ${approval_line}|python check_pr_approval.py $1 $person_num` + echo ${APPROVALS} + if [[ "${APPROVALS}" == "FALSE" && "${echo_line}" != "" ]]; then + add_failed "${failed_num}. ${echo_line}" + fi +} + +for file_name in `git diff --numstat upstream/${AGILE_COMPILE_BRANCH} |awk '{print $NF}'`;do + arr_file_name=(${file_name//// }) + dir1=${arr_file_name[0]} + dir2=${arr_file_name[1]} + dir3=${arr_file_name[2]} + dir4=${arr_file_name[3]} + echo "file_name:"${file_name}, "dir1:"${dir1}, "dir2:"${dir2},"dir3:"${dir3},".xx:" ${file_name##*.} + if [[ ${file_name} =~ "paddlenlp/trainer/training_args.py" ]] || [[ ${file_name} =~ "paddlenlp/trainer/trainer.py" ]] || [[ ${file_name} =~ "llm/run_pretrain.py" ]] || [[ ${file_name} =~ "llm/finetune_generation.py" ]];then + echo_line="You must have one RD (ZHUI, wawltor,ForFishes,sneaxiy,zhiqiu) approval for the changes of `llm/llama/auto_parallel/` " + check_approval 1 ZHUI wawltor ForFishes sneaxiy zhiqiu + elif [[ ${dir1} =~ "paddlenlp" ]];then + if [[ ${dir2} =~ "transformers" ]];then + echo_line="You must have one RD (wawltor) approval for the changes of `transformers` " + check_approval 1 sijunhe wawltor + elif [[ ${dir2} =~ "taskflow" ]];then + echo_line="You must have one RD (w5688414(Recommend),DesmonDay,wawltor) approval for the changes of `taskflow`" + check_approval 1 w5688414 DesmonDay wawltor + elif [[ ${dir3} =~ "trainer" ]];then + echo_line="You must have one RD (ZHUI(Recommend), wawltor) approval for the changes of `trainer`" + check_approval 1 ZHUI wawltor + elif [[ ${dir3} =~ "fast_transformer" ]] || [[ ${dir4} =~ "FasterTransformer" ]] ;then + echo_line="You must have one RD (guoshengCS(Recommend), wawltor) approval for the changes of `FT or FG`" + check_approval 1 guoshengCS wawltor + elif [[ ${dir3} =~ "llama" ]] || [[ ${dir3} =~ "gpt" ]];then + echo_line="You must have one RD (ZHUI, wawltor,ForFishes,sneaxiy,zhiqiu) approval for the changes of `llm/llama/auto_parallel/` " + check_approval 1 ZHUI wawltor ForFishes sneaxiy zhiqiu + fi + elif [[ ${dir1} =~ "model_zoo" ]];then # + if [[ ${dir2} =~ "gpt-3" ]] ;then + echo_line="You must have one RD (ZHUI, wawltor,ForFishes,sneaxiy,zhiqiu) approval for the changes of `model_zoo/gpt-3` " + check_approval 1 ZHUI wawltor ForFishes sneaxiy zhiqiu + fi + elif [[ ${dir1} =~ "llm" ]];then + if [[ ${dir3} =~ "auto_parallel" ]] ;then + echo_line="You must have one RD (ZHUI, wawltor,ForFishes,sneaxiy,zhiqiu) approval for the changes of `llm/llama/auto_parallel/` " + check_approval 1 ZHUI wawltor ForFishes sneaxiy zhiqiu + fi + elif [[ ${dir1} =~ "tests" ]];then # 新增单测 + if [[ ${dir2} =~ "transformers" ]] ;then + echo_line="You must have one RD (wawltor) approval for the changes of `transformers` " + check_approval 1 sijunhe wawltor + elif [[ ${dir2} =~ "taskflow" ]] || [[ ${dir2} =~ "prompt" ]];then + echo_line="You must have one RD (w5688414(Recommend),, wawltor) approval for the changes of `taskflow`" + check_approval 1 w5688414 wawltor + elif [[ ${dir2} =~ "llm" ]] ;then + echo_line="You must have one RD (wj-Mcat(Recommend), wawltor) approval for the changes of tests/llm/" + check_approval 1 wj-Mcat lugimzzz gongel wtmlon wawltor + elif [[ ${dir2} =~ "trainer" ]] ;then + echo_line="You must have one RD (ZHUI(Recommend), wawltor) approval for the changes of `trainer`" + check_approval 1 ZHUI wawltor + elif [[ ${dir2} =~ "ops" ]] || [[ ${dir2} =~ "embedding" ]];then + echo_line="You must have one RD (guoshengCS(Recommend),, wawltor) approval for the changes of `ops or embedding`" + check_approval 1 guoshengCS wawltor + elif [[ ${dir2} =~ "model_zoo" ]] ;then + echo_line="You must have one RD (wawltor(Recommend), sijunhe) approval for the changes of `model_zoo`" + check_approval 1 sijunhe wawltor + elif [[ ${dir2} =~ "cli" ]] || [[ ${dir2} =~ "generation" ]];then + echo_line="You must have one RD (wj-Mcat(Recommend), wawltor) approval for the changes of `llm/generation`" + check_approval 1 wj-Mcat wawltor + elif [[ ${dir2} =~ "test_tipc" ]];then + echo_line="You must have one RD (wj-Mcat(Recommend),lugimzzz, wawltor) approval for the changes of `test_tipc`" + check_approval 1 wj-Mcat lugimzzz wawltor + elif [[ ${dir2} =~ "dataaug" ]]|| [[ ${dir2} =~ "peft" ]];then + echo_line="You must have one RD (lugimzzz(Recommend), wawltor) approval for the changes of `dataaug/peft`" + check_approval 1 lugimzzz wawltor + elif [[ ${dir2} =~ "data" ]]|| [[ ${dir2} =~ "dataset" ]];then + echo_line="You must have one RD (KB-Ding(Recommend), wawltor) approval for the changes of `data/dataset`" + check_approval 1 KB-Ding wawltor + elif [[ ${dir2} =~ "layers" ]] || [[ ${dir2} =~ "metrics" ]] || [[ ${file_name} =~ "tests/llm/test_pretrain.py" ]];then + echo_line="You must have one RD (ZHUI(Recommend),DesmonDay,wawltor) approval for the changes of `layers/metrics/tests/llm/test_pretrain.py`" + check_approval 1 ZHUI DesmonDay wawltor + elif [[ ${dir2} =~ "utils" ]] ;then + echo_line="You must have one RD (wawltor(Recommend), sijunhe) approval for the changes of `tests/utils`" + check_approval 1 sijunhe wawltor + fi + elif [[ ${dir1} =~ "pipelines" ]];then # 影响编包 + echo_line="You must have one RD (w5688414(Recommend), wawltor) approval for the changes of `pipelines`" + check_approval 1 w5688414 junnyu wawltor + elif [[ ${dir1} =~ "ppdiffusers" ]];then # 影响编包 + echo_line="You must have one RD (junnyu(Recommend), wawltor) approval for the changes of `pipelines`" + check_approval 1 w5688414 junnyu wawltor + else + continue + fi +done + +if [ -n "${echo_list}" ];then + echo "**************************************************************" + echo "Please find RD for approval." + echo -e "${echo_list[@]}" + echo "There are ${failed_num} approved errors." + echo "**************************************************************" + exit 1 +else + echo "**************************************************************" + echo "CI APPROVAL PASSED." + echo "**************************************************************" + exit 0 +fi \ No newline at end of file From ff7d38f501f7481eb4dcd5e1801354601944b0f4 Mon Sep 17 00:00:00 2001 From: zjjlivein <1834792141@qq.com> Date: Thu, 18 Jan 2024 15:32:47 +0800 Subject: [PATCH 2/4] update --- scripts/ci_approval/run_ci_approval.sh | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/scripts/ci_approval/run_ci_approval.sh b/scripts/ci_approval/run_ci_approval.sh index 237da0b18d95..b2e2253cf0df 100644 --- a/scripts/ci_approval/run_ci_approval.sh +++ b/scripts/ci_approval/run_ci_approval.sh @@ -47,7 +47,7 @@ for file_name in `git diff --numstat upstream/${AGILE_COMPILE_BRANCH} |awk '{pri elif [[ ${dir1} =~ "paddlenlp" ]];then if [[ ${dir2} =~ "transformers" ]];then echo_line="You must have one RD (wawltor) approval for the changes of `transformers` " - check_approval 1 sijunhe wawltor + check_approval 1 wawltor elif [[ ${dir2} =~ "taskflow" ]];then echo_line="You must have one RD (w5688414(Recommend),DesmonDay,wawltor) approval for the changes of `taskflow`" check_approval 1 w5688414 DesmonDay wawltor @@ -70,11 +70,14 @@ for file_name in `git diff --numstat upstream/${AGILE_COMPILE_BRANCH} |awk '{pri if [[ ${dir3} =~ "auto_parallel" ]] ;then echo_line="You must have one RD (ZHUI, wawltor,ForFishes,sneaxiy,zhiqiu) approval for the changes of `llm/llama/auto_parallel/` " check_approval 1 ZHUI wawltor ForFishes sneaxiy zhiqiu + else + echo_line="You must have one RD (wj-Mcat(Recommend), wawltor) approval for the changes of `llm/`" + check_approval 1 wj-Mcat lugimzzz DesmonDay wawltor fi - elif [[ ${dir1} =~ "tests" ]];then # 新增单测 + elif [[ ${dir1} =~ "tests" ]];then if [[ ${dir2} =~ "transformers" ]] ;then echo_line="You must have one RD (wawltor) approval for the changes of `transformers` " - check_approval 1 sijunhe wawltor + check_approval 1 wawltor elif [[ ${dir2} =~ "taskflow" ]] || [[ ${dir2} =~ "prompt" ]];then echo_line="You must have one RD (w5688414(Recommend),, wawltor) approval for the changes of `taskflow`" check_approval 1 w5688414 wawltor @@ -88,8 +91,8 @@ for file_name in `git diff --numstat upstream/${AGILE_COMPILE_BRANCH} |awk '{pri echo_line="You must have one RD (guoshengCS(Recommend),, wawltor) approval for the changes of `ops or embedding`" check_approval 1 guoshengCS wawltor elif [[ ${dir2} =~ "model_zoo" ]] ;then - echo_line="You must have one RD (wawltor(Recommend), sijunhe) approval for the changes of `model_zoo`" - check_approval 1 sijunhe wawltor + echo_line="You must have one RD (wawltor(Recommend)) approval for the changes of `model_zoo`" + check_approval 1 wawltor elif [[ ${dir2} =~ "cli" ]] || [[ ${dir2} =~ "generation" ]];then echo_line="You must have one RD (wj-Mcat(Recommend), wawltor) approval for the changes of `llm/generation`" check_approval 1 wj-Mcat wawltor @@ -106,13 +109,13 @@ for file_name in `git diff --numstat upstream/${AGILE_COMPILE_BRANCH} |awk '{pri echo_line="You must have one RD (ZHUI(Recommend),DesmonDay,wawltor) approval for the changes of `layers/metrics/tests/llm/test_pretrain.py`" check_approval 1 ZHUI DesmonDay wawltor elif [[ ${dir2} =~ "utils" ]] ;then - echo_line="You must have one RD (wawltor(Recommend), sijunhe) approval for the changes of `tests/utils`" - check_approval 1 sijunhe wawltor + echo_line="You must have one RD (wawltor(Recommend)) approval for the changes of `tests/utils`" + check_approval 1 wawltor fi - elif [[ ${dir1} =~ "pipelines" ]];then # 影响编包 + elif [[ ${dir1} =~ "pipelines" ]];then echo_line="You must have one RD (w5688414(Recommend), wawltor) approval for the changes of `pipelines`" check_approval 1 w5688414 junnyu wawltor - elif [[ ${dir1} =~ "ppdiffusers" ]];then # 影响编包 + elif [[ ${dir1} =~ "ppdiffusers" ]];then echo_line="You must have one RD (junnyu(Recommend), wawltor) approval for the changes of `pipelines`" check_approval 1 w5688414 junnyu wawltor else From 388aa3b4aaeb8c5c6c0051bfb9d300f0a1532db5 Mon Sep 17 00:00:00 2001 From: zjjlivein <1834792141@qq.com> Date: Fri, 19 Jan 2024 11:11:42 +0800 Subject: [PATCH 3/4] update --- scripts/ci_approval/run_ci_approval.sh | 45 +++++++++++++------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/scripts/ci_approval/run_ci_approval.sh b/scripts/ci_approval/run_ci_approval.sh index b2e2253cf0df..f05ee3dac44e 100644 --- a/scripts/ci_approval/run_ci_approval.sh +++ b/scripts/ci_approval/run_ci_approval.sh @@ -14,7 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. - failed_num=0 echo_list=() approval_line=`curl -H "Authorization: token ${GITHUB_API_TOKEN}" https://api.github.com/repos/PaddlePaddle/PaddleNLP/pulls/${GIT_PR_ID}/reviews?per_page=10000` @@ -42,81 +41,81 @@ for file_name in `git diff --numstat upstream/${AGILE_COMPILE_BRANCH} |awk '{pri dir4=${arr_file_name[3]} echo "file_name:"${file_name}, "dir1:"${dir1}, "dir2:"${dir2},"dir3:"${dir3},".xx:" ${file_name##*.} if [[ ${file_name} =~ "paddlenlp/trainer/training_args.py" ]] || [[ ${file_name} =~ "paddlenlp/trainer/trainer.py" ]] || [[ ${file_name} =~ "llm/run_pretrain.py" ]] || [[ ${file_name} =~ "llm/finetune_generation.py" ]];then - echo_line="You must have one RD (ZHUI, wawltor,ForFishes,sneaxiy,zhiqiu) approval for the changes of `llm/llama/auto_parallel/` " + echo_line="You must have one RD (ZHUI, wawltor,ForFishes,sneaxiy,zhiqiu) approval for the changes of training_args.py/trainer.py/run_pretrain.py " check_approval 1 ZHUI wawltor ForFishes sneaxiy zhiqiu elif [[ ${dir1} =~ "paddlenlp" ]];then if [[ ${dir2} =~ "transformers" ]];then - echo_line="You must have one RD (wawltor) approval for the changes of `transformers` " + echo_line="You must have one RD (wawltor) approval for the changes of transformers " check_approval 1 wawltor elif [[ ${dir2} =~ "taskflow" ]];then - echo_line="You must have one RD (w5688414(Recommend),DesmonDay,wawltor) approval for the changes of `taskflow`" + echo_line="You must have one RD (w5688414(Recommend),DesmonDay,wawltor) approval for the changes of taskflow" check_approval 1 w5688414 DesmonDay wawltor elif [[ ${dir3} =~ "trainer" ]];then - echo_line="You must have one RD (ZHUI(Recommend), wawltor) approval for the changes of `trainer`" + echo_line="You must have one RD (ZHUI(Recommend), wawltor) approval for the changes of trainer" check_approval 1 ZHUI wawltor elif [[ ${dir3} =~ "fast_transformer" ]] || [[ ${dir4} =~ "FasterTransformer" ]] ;then - echo_line="You must have one RD (guoshengCS(Recommend), wawltor) approval for the changes of `FT or FG`" + echo_line="You must have one RD (guoshengCS(Recommend), wawltor) approval for the changes of FT or FG" check_approval 1 guoshengCS wawltor elif [[ ${dir3} =~ "llama" ]] || [[ ${dir3} =~ "gpt" ]];then - echo_line="You must have one RD (ZHUI, wawltor,ForFishes,sneaxiy,zhiqiu) approval for the changes of `llm/llama/auto_parallel/` " + echo_line="You must have one RD (ZHUI, wawltor,ForFishes,sneaxiy,zhiqiu) approval for the changes of llm/llama/auto_parallel/ " check_approval 1 ZHUI wawltor ForFishes sneaxiy zhiqiu fi elif [[ ${dir1} =~ "model_zoo" ]];then # if [[ ${dir2} =~ "gpt-3" ]] ;then - echo_line="You must have one RD (ZHUI, wawltor,ForFishes,sneaxiy,zhiqiu) approval for the changes of `model_zoo/gpt-3` " + echo_line="You must have one RD (ZHUI, wawltor,ForFishes,sneaxiy,zhiqiu) approval for the changes of model_zoo/gpt-3 " check_approval 1 ZHUI wawltor ForFishes sneaxiy zhiqiu fi elif [[ ${dir1} =~ "llm" ]];then if [[ ${dir3} =~ "auto_parallel" ]] ;then - echo_line="You must have one RD (ZHUI, wawltor,ForFishes,sneaxiy,zhiqiu) approval for the changes of `llm/llama/auto_parallel/` " + echo_line="You must have one RD (ZHUI, wawltor,ForFishes,sneaxiy,zhiqiu) approval for the changes of llm/llama/auto_parallel/ " check_approval 1 ZHUI wawltor ForFishes sneaxiy zhiqiu else - echo_line="You must have one RD (wj-Mcat(Recommend), wawltor) approval for the changes of `llm/`" + echo_line="You must have one RD (wj-Mcat(Recommend), wawltor) approval for the changes of llm" check_approval 1 wj-Mcat lugimzzz DesmonDay wawltor fi elif [[ ${dir1} =~ "tests" ]];then if [[ ${dir2} =~ "transformers" ]] ;then - echo_line="You must have one RD (wawltor) approval for the changes of `transformers` " + echo_line="You must have one RD (wawltor) approval for the changes of transformers " check_approval 1 wawltor elif [[ ${dir2} =~ "taskflow" ]] || [[ ${dir2} =~ "prompt" ]];then - echo_line="You must have one RD (w5688414(Recommend),, wawltor) approval for the changes of `taskflow`" + echo_line="You must have one RD (w5688414(Recommend),, wawltor) approval for the changes of taskflow" check_approval 1 w5688414 wawltor elif [[ ${dir2} =~ "llm" ]] ;then echo_line="You must have one RD (wj-Mcat(Recommend), wawltor) approval for the changes of tests/llm/" check_approval 1 wj-Mcat lugimzzz gongel wtmlon wawltor elif [[ ${dir2} =~ "trainer" ]] ;then - echo_line="You must have one RD (ZHUI(Recommend), wawltor) approval for the changes of `trainer`" + echo_line="You must have one RD (ZHUI(Recommend), wawltor) approval for the changes of trainer" check_approval 1 ZHUI wawltor elif [[ ${dir2} =~ "ops" ]] || [[ ${dir2} =~ "embedding" ]];then - echo_line="You must have one RD (guoshengCS(Recommend),, wawltor) approval for the changes of `ops or embedding`" + echo_line="You must have one RD (guoshengCS(Recommend),, wawltor) approval for the changes of ops or embedding" check_approval 1 guoshengCS wawltor elif [[ ${dir2} =~ "model_zoo" ]] ;then - echo_line="You must have one RD (wawltor(Recommend)) approval for the changes of `model_zoo`" + echo_line="You must have one RD (wawltor(Recommend)) approval for the changes of model_zoo" check_approval 1 wawltor elif [[ ${dir2} =~ "cli" ]] || [[ ${dir2} =~ "generation" ]];then - echo_line="You must have one RD (wj-Mcat(Recommend), wawltor) approval for the changes of `llm/generation`" + echo_line="You must have one RD (wj-Mcat(Recommend), wawltor) approval for the changes of llm/generation" check_approval 1 wj-Mcat wawltor elif [[ ${dir2} =~ "test_tipc" ]];then - echo_line="You must have one RD (wj-Mcat(Recommend),lugimzzz, wawltor) approval for the changes of `test_tipc`" + echo_line="You must have one RD (wj-Mcat(Recommend),lugimzzz, wawltor) approval for the changes of test_tipc" check_approval 1 wj-Mcat lugimzzz wawltor elif [[ ${dir2} =~ "dataaug" ]]|| [[ ${dir2} =~ "peft" ]];then - echo_line="You must have one RD (lugimzzz(Recommend), wawltor) approval for the changes of `dataaug/peft`" + echo_line="You must have one RD (lugimzzz(Recommend), wawltor) approval for the changes of dataaug/peft" check_approval 1 lugimzzz wawltor elif [[ ${dir2} =~ "data" ]]|| [[ ${dir2} =~ "dataset" ]];then - echo_line="You must have one RD (KB-Ding(Recommend), wawltor) approval for the changes of `data/dataset`" + echo_line="You must have one RD (KB-Ding(Recommend), wawltor) approval for the changes of data/dataset" check_approval 1 KB-Ding wawltor elif [[ ${dir2} =~ "layers" ]] || [[ ${dir2} =~ "metrics" ]] || [[ ${file_name} =~ "tests/llm/test_pretrain.py" ]];then - echo_line="You must have one RD (ZHUI(Recommend),DesmonDay,wawltor) approval for the changes of `layers/metrics/tests/llm/test_pretrain.py`" + echo_line="You must have one RD (ZHUI(Recommend),DesmonDay,wawltor) approval for the changes of layers/metrics/tests/llm/test_pretrain.py" check_approval 1 ZHUI DesmonDay wawltor elif [[ ${dir2} =~ "utils" ]] ;then - echo_line="You must have one RD (wawltor(Recommend)) approval for the changes of `tests/utils`" + echo_line="You must have one RD (wawltor(Recommend)) approval for the changes of tests/utils" check_approval 1 wawltor fi elif [[ ${dir1} =~ "pipelines" ]];then - echo_line="You must have one RD (w5688414(Recommend), wawltor) approval for the changes of `pipelines`" + echo_line="You must have one RD (w5688414(Recommend), wawltor) approval for the changes of pipelines" check_approval 1 w5688414 junnyu wawltor elif [[ ${dir1} =~ "ppdiffusers" ]];then - echo_line="You must have one RD (junnyu(Recommend), wawltor) approval for the changes of `pipelines`" + echo_line="You must have one RD (junnyu(Recommend), wawltor) approval for the changes of pipelines" check_approval 1 w5688414 junnyu wawltor else continue From b0f8d1992d7f518bf61b458a3a57135da0acbbaa Mon Sep 17 00:00:00 2001 From: zjjlivein <1834792141@qq.com> Date: Fri, 19 Jan 2024 11:20:52 +0800 Subject: [PATCH 4/4] update --- scripts/ci_approval/run_ci_approval.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/ci_approval/run_ci_approval.sh b/scripts/ci_approval/run_ci_approval.sh index f05ee3dac44e..bc55cc58d5df 100644 --- a/scripts/ci_approval/run_ci_approval.sh +++ b/scripts/ci_approval/run_ci_approval.sh @@ -41,8 +41,8 @@ for file_name in `git diff --numstat upstream/${AGILE_COMPILE_BRANCH} |awk '{pri dir4=${arr_file_name[3]} echo "file_name:"${file_name}, "dir1:"${dir1}, "dir2:"${dir2},"dir3:"${dir3},".xx:" ${file_name##*.} if [[ ${file_name} =~ "paddlenlp/trainer/training_args.py" ]] || [[ ${file_name} =~ "paddlenlp/trainer/trainer.py" ]] || [[ ${file_name} =~ "llm/run_pretrain.py" ]] || [[ ${file_name} =~ "llm/finetune_generation.py" ]];then - echo_line="You must have one RD (ZHUI, wawltor,ForFishes,sneaxiy,zhiqiu) approval for the changes of training_args.py/trainer.py/run_pretrain.py " - check_approval 1 ZHUI wawltor ForFishes sneaxiy zhiqiu + echo_line="You must have two RD: one from(ZHUI, wawltor),one from(ForFishes,sneaxiy,zhiqiu) approval for the changes of training_args.py/trainer.py/run_pretrain.py " + check_approval 2 ZHUI wawltor ForFishes sneaxiy zhiqiu elif [[ ${dir1} =~ "paddlenlp" ]];then if [[ ${dir2} =~ "transformers" ]];then echo_line="You must have one RD (wawltor) approval for the changes of transformers " @@ -57,18 +57,18 @@ for file_name in `git diff --numstat upstream/${AGILE_COMPILE_BRANCH} |awk '{pri echo_line="You must have one RD (guoshengCS(Recommend), wawltor) approval for the changes of FT or FG" check_approval 1 guoshengCS wawltor elif [[ ${dir3} =~ "llama" ]] || [[ ${dir3} =~ "gpt" ]];then - echo_line="You must have one RD (ZHUI, wawltor,ForFishes,sneaxiy,zhiqiu) approval for the changes of llm/llama/auto_parallel/ " - check_approval 1 ZHUI wawltor ForFishes sneaxiy zhiqiu + echo_line="You must have two RD: one from(ZHUI, wawltor),one from(ForFishes,sneaxiy,zhiqiu) approval for the changes of llm/llama/auto_parallel/ " + check_approval 2 ZHUI wawltor ForFishes sneaxiy zhiqiu fi elif [[ ${dir1} =~ "model_zoo" ]];then # if [[ ${dir2} =~ "gpt-3" ]] ;then - echo_line="You must have one RD (ZHUI, wawltor,ForFishes,sneaxiy,zhiqiu) approval for the changes of model_zoo/gpt-3 " - check_approval 1 ZHUI wawltor ForFishes sneaxiy zhiqiu + echo_line="You must have two RD: one from(ZHUI, wawltor),one from(ForFishes,sneaxiy,zhiqiu) approval for the changes of model_zoo/gpt-3 " + check_approval 2 ZHUI wawltor ForFishes sneaxiy zhiqiu fi elif [[ ${dir1} =~ "llm" ]];then if [[ ${dir3} =~ "auto_parallel" ]] ;then - echo_line="You must have one RD (ZHUI, wawltor,ForFishes,sneaxiy,zhiqiu) approval for the changes of llm/llama/auto_parallel/ " - check_approval 1 ZHUI wawltor ForFishes sneaxiy zhiqiu + echo_line="You must have two RD: one from(ZHUI, wawltor),one from(ForFishes,sneaxiy,zhiqiu) approval for the changes of llm/llama/auto_parallel/ " + check_approval 2 ZHUI wawltor ForFishes sneaxiy zhiqiu else echo_line="You must have one RD (wj-Mcat(Recommend), wawltor) approval for the changes of llm" check_approval 1 wj-Mcat lugimzzz DesmonDay wawltor