From 950fda48fc77403ade987ea7d8cac4f156bf62ca Mon Sep 17 00:00:00 2001 From: Yangrl <2535184404@qq.com> Date: Thu, 21 Dec 2023 10:40:55 +0000 Subject: [PATCH 1/3] forbiden_cc_test --- tools/check_file_diff_approvals.sh | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/tools/check_file_diff_approvals.sh b/tools/check_file_diff_approvals.sh index 7f109a3ecaef60..ca8e3bd3c57d86 100644 --- a/tools/check_file_diff_approvals.sh +++ b/tools/check_file_diff_approvals.sh @@ -90,6 +90,7 @@ API_FILES=("CMakeLists.txt" "python/paddle/autograd/ir_backward.py" "python/paddle/autograd/backward_utils.py" "paddle/scripts/paddle_build.sh" + "paddle/phi/infermeta/spmd_rules" ) approval_line=`curl -H "Authorization: token ${GITHUB_API_TOKEN}" https://api.github.com/repos/PaddlePaddle/Paddle/pulls/${GIT_PR_ID}/reviews?per_page=10000` @@ -224,9 +225,12 @@ for API_FILE in ${API_FILES[*]}; do elif [ "${API_FILE}" == "python/paddle/autograd/ir_backward.py" ] || [ "${API_FILE}" == "python/paddle/autograd/backward_utils.py" ]; then echo_line="You must be approved by Aurelius84(zhangliujie) or cxxly(chenxiaoxu) or xiaoguoguo626807(wangruting) or changeyoung98(chenzhiyang) for python/paddle/autograd/ir_backward.py or python/paddle/autograd/backward_utils.py changes.\n" check_approval 1 Aurelius84 cxxly xiaoguoguo626807 changeyoung98 - elif [ "${API_FILE}" == "paddle/scripts/paddle_build.sh" ]; then - echo_line="You must have one RD (tianshuo78520a or risemeup1 or zhangbo9674 or XieYunshen) for ${API_FILE} changes, which manages the Paddle CI on Linux.\n " - check_approval 1 tianshuo78520a risemeup1 zhangbo9674 XieYunshen + elif [ "${API_FILE}" == "paddle/scripts/paddle_build.sh" ]; then + echo_line="You must have one RD (tianshuo78520a or risemeup1 or zhangbo9674 or XieYunshen) for ${API_FILE} changes, which manages the Paddle CI on Linux.\n " + check_approval 1 tianshuo78520a risemeup1 zhangbo9674 XieYunshen + elif [ "${API_FILE}" == "paddle/phi/infermeta/spmd_rules" ]; then + echo_line="You must have one RD (liuzhenhai(liuzhenhai93) or liyurui(LiYuRio) or shenliang03(ForFishes) or zhangyichen03(pkuzyc) or chenqiuliang(zhiqiu)) approval for changing ${API_FILE} , which manages the code for spmd_rules.\n" + check_approval 1 liuzhenhai93 LiYuRio ForFishes pkuzyc zhiqiu else echo_line="You must have one RD (XiaoguangHu01,chenwhql,zhiqiu,Xreki,luotao1,qili93,Aurelius84) approval for ${API_FILE}, which manages the underlying code for fluid.\n" check_approval 1 XiaoguangHu01 chenwhql zhiqiu Xreki luotao1 qili93 Aurelius84 @@ -291,6 +295,12 @@ if [ "${HAS_USED_CCTESTOLD}" != "" ] && [ "${GIT_PR_ID}" != "" ]; then check_approval 1 phlrain risemeup1 zhangbo9674 Galaxy1458 fi +HAS_USED_CCTEST=`git diff -U0 upstream/$BRANCH |grep "cc_test" || true` +if [ "${HAS_USED_CCTEST}" != "" ] && [ "${GIT_PR_ID}" != "" ]; then + echo_line="Paddle utest will gradually discard cc_test, insteadly, the paddle_test is recommended, if you must use cc_test, you must be approved by risemeup1 or zhangbo9674 or Galaxy1458 for using cc_test. Thanks!\n" + check_approval 1 risemeup1 zhangbo9674 Galaxy1458 +fi + HAS_MODIFIED_API_COMPAT_YAML=`git diff --name-only upstream/$BRANCH | grep "paddle/phi/api/yaml/op_compat.yaml" || true` if [ "${HAS_MODIFIED_API_COMPAT_YAML}" != "" ] && [ "${GIT_PR_ID}" != "" ]; then echo_line="You must be approved by chenwhql or zyfncg or heavyrain-lzy for paddle/phi/api/yaml/op_compat.yaml changes, which manages the extra params of Op and name mapping between Yaml and OpMaker. In order to ensure compatibility of framework, this file isn't allowed to be modified at will!\n" @@ -390,6 +400,13 @@ if [ "${DEPRECATED_FLAKE8}" != "" ] && [ "${GIT_PR_ID}" != "" ]; then check_approval 1 SigureMo gouzil fi +TEST_FILE_ADDED_LINES=$(git diff -U0 upstream/$BRANCH -- test |grep "^+") +ENABLE_TO_STATIC_CHECK=`echo "$TEST_FILE_ADDED_LINES" | grep "enable_to_static(" || true` +if [ "${ENABLE_TO_STATIC_CHECK}" != "" ] && [ "${GIT_PR_ID}" != "" ]; then + echo_line="You must have one RD (SigureMo, Aurelius84 or 2742195759) approval for using 'paddle.jit.enable_to_static', we recommend using 'enable_to_static_guard' in the related test files.\n" + check_approval 1 SigureMo Aurelius84 2742195759 +fi + HAS_MODIFIED_PHI_FILES=`git diff --name-only upstream/$BRANCH | grep "paddle/phi/" || true` PHI_INCLUDE_FLUID_FILES="" for CHANGE_FILE in ${HAS_MODIFIED_PHI_FILES}; do From 638c9dfb7b1c4110784201cf0e47e0df1e70bc77 Mon Sep 17 00:00:00 2001 From: Yangrl <2535184404@qq.com> Date: Thu, 21 Dec 2023 10:43:20 +0000 Subject: [PATCH 2/3] forbiden_cc_test, test=document_fix --- tools/check_file_diff_approvals.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/check_file_diff_approvals.sh b/tools/check_file_diff_approvals.sh index ca8e3bd3c57d86..7341f4fcfb2280 100644 --- a/tools/check_file_diff_approvals.sh +++ b/tools/check_file_diff_approvals.sh @@ -297,7 +297,7 @@ fi HAS_USED_CCTEST=`git diff -U0 upstream/$BRANCH |grep "cc_test" || true` if [ "${HAS_USED_CCTEST}" != "" ] && [ "${GIT_PR_ID}" != "" ]; then - echo_line="Paddle utest will gradually discard cc_test, insteadly, the paddle_test is recommended, if you must use cc_test, you must be approved by risemeup1 or zhangbo9674 or Galaxy1458 for using cc_test. Thanks!\n" + echo_line="Paddle utest will gradually discard cc_test\n insteadly, the paddle_test is recommended,\n if you must use cc_test, you must be approved by risemeup1 or zhangbo9674 or Galaxy1458 for using cc_test. Thanks!\n" check_approval 1 risemeup1 zhangbo9674 Galaxy1458 fi From 743f971701b459a2b56b1ea984e45460e835b9dd Mon Sep 17 00:00:00 2001 From: Yangrl <2535184404@qq.com> Date: Thu, 21 Dec 2023 10:49:50 +0000 Subject: [PATCH 3/3] forbiden_cc_test, test=document_fix --- tools/check_file_diff_approvals.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/check_file_diff_approvals.sh b/tools/check_file_diff_approvals.sh index 7341f4fcfb2280..ce43c6044aec4b 100644 --- a/tools/check_file_diff_approvals.sh +++ b/tools/check_file_diff_approvals.sh @@ -297,7 +297,7 @@ fi HAS_USED_CCTEST=`git diff -U0 upstream/$BRANCH |grep "cc_test" || true` if [ "${HAS_USED_CCTEST}" != "" ] && [ "${GIT_PR_ID}" != "" ]; then - echo_line="Paddle utest will gradually discard cc_test\n insteadly, the paddle_test is recommended,\n if you must use cc_test, you must be approved by risemeup1 or zhangbo9674 or Galaxy1458 for using cc_test. Thanks!\n" + echo_line="Paddle utest will gradually discard cc_test\n instead, the paddle_test is recommended,\n if you must use cc_test, you must be approved by risemeup1 or zhangbo9674 or Galaxy1458 for using cc_test. Thanks!\n" check_approval 1 risemeup1 zhangbo9674 Galaxy1458 fi