diff --git a/tools/check_file_diff_approvals.sh b/tools/check_file_diff_approvals.sh index 7f109a3ecaef60..ce43c6044aec4b 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\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 + 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