diff --git a/tools/check_file_diff_approvals.sh b/tools/check_file_diff_approvals.sh index caacecf446a82344192a4f7cd2c0e127ea1a94a1..503c763c08ca8bf9ec46488b50dca1bd96147e04 100644 --- a/tools/check_file_diff_approvals.sh +++ b/tools/check_file_diff_approvals.sh @@ -236,7 +236,7 @@ if [ "${HAS_MODIFIED_TENSOR}" != "" ] && [ "${GIT_PR_ID}" != "" ]; then fi HAS_MODIFIED_LOD_TENSOR=`git diff --name-only upstream/$BRANCH | grep "paddle/fluid/framework/lod_tensor" || true` -if [ "${HAS_MODIFIED_TENSOR}" != "" ] && [ "${GIT_PR_ID}" != "" ]; then +if [ "${HAS_MODIFIED_LOD_TENSOR}" != "" ] && [ "${GIT_PR_ID}" != "" ]; then echo_line="You must be approved by jim19930609 or chenwhql for paddle/fluid/framework/lod_tensor. It is being modularized and refactored. Thanks!\n" check_approval 1 22561442 22334008 fi @@ -262,6 +262,19 @@ if [ "${EMPTY_GRAD_OP_REGISTERED}" != "" ] && [ "${GIT_PT_ID}" != "" ]; then check_approval 1 43953930 46782768 22165420 22361972 fi +HAS_MODIFIED_PTEN_FILES=`git diff --name-only upstream/$BRANCH | grep "paddle/pten/" || true` +PTEN_INCLUDE_FLUID_FILES="" +for CHANGE_FILE in ${HAS_MODIFIED_PTEN_FILES}; do + PTEN_DIR_ADDED_LINES=`git diff -U0 upstream/$BRANCH -- ${PADDLE_ROOT}/${CHANGE_FILE} | grep "^+" | grep "#include \"paddle/fluid/" || true` + if [ "${PTEN_DIR_ADDED_LINES}" != "" ] && [ "${GIT_PR_ID}" != "" ]; then + PTEN_INCLUDE_FLUID_FILES="${PTEN_INCLUDE_FLUID_FILES} ${CHANGE_FILE}" + fi +done +if [ "${PTEN_INCLUDE_FLUID_FILES}" != "" ] && [ "${GIT_PR_ID}" != "" ]; then + echo_line="You must have one RD (chenwhql, MingMingShangTian, YuanRisheng or zyfncg) approval for the including paddle/fluid header in paddle/pten files(${PTEN_INCLUDE_FLUID_FILES}).\n" + check_approval 1 chenwhql MingMingShangTian YuanRisheng zyfncg +fi + ALL_CHANGE_FILES=`git diff --numstat upstream/$BRANCH | awk '{print $3}' | grep ".py"` ALL_OPTEST_BAN_DYGRAPH_MESSAGE="" for CHANGE_FILE in ${ALL_CHANGE_FILES}; do