Skip to content

Commit

Permalink
[tools] add PADDLE_API check file diff approvals (#53956)
Browse files Browse the repository at this point in the history
* [tools] add PADDLE_API check file diff approvals

* [tools] fix determine

* [tools] fix determine

* [tools] Change to full character matching

Co-authored-by: 张春乔 <83450930+Liyulingyue@users.noreply.github.com>

* [tools] Update echo_line

Co-authored-by: 张春乔 <83450930+Liyulingyue@users.noreply.github.com>

* [tools] Update check_approval

Co-authored-by: 张春乔 <83450930+Liyulingyue@users.noreply.github.com>

---------

Co-authored-by: 张春乔 <83450930+Liyulingyue@users.noreply.github.com>
  • Loading branch information
gouzil and Liyulingyue authored May 19, 2023
1 parent 0ae552f commit 53d4e9e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tools/check_file_diff_approvals.sh
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,19 @@ if [ "${PHI_INCLUDE_THIRD_PARTY_FILES}" != "" ] && [ "${GIT_PR_ID}" != "" ]; the
check_approval 1 jiahy0825 zyfncg chenwhql YuanRisheng heavyrain-lzy
fi

HAS_MODIFIED_PADDLE_API_FILES=`git diff --name-only upstream/$BRANCH | grep "paddle/.*\.h" || true`
INCLUDE_PADDLE_API_FILES=""
for CHANGE_FILE in ${HAS_MODIFIED_PHI_HEADER_FILES}; do
PADDLE_API_ADDED_LINES=`git diff -U0 upstream/$BRANCH -- ${PADDLE_ROOT}/${CHANGE_FILE} | grep -w "PADDLE_API" || true`
if [ "${PADDLE_API_ADDED_LINES}" != "" ] && [ "${GIT_PR_ID}" != "" ]; then
INCLUDE_PADDLE_API_FILES="${INCLUDE_PADDLE_API_FILES} ${CHANGE_FILE}"
fi
done
if [ "${INCLUDE_PADDLE_API_FILES}" != "" ] && [ "${GIT_PR_ID}" != "" ]; then
echo_line="You must have one RD (jiahy0825, zyfncg, chenwhql) or PM (sunzhongkai588, Ligoml) approval for code changes about PADDLE_API. If you add a new PADDLE_API, please make sure you have written detailed comments about the parameter and usage of this PADDLE_API .\n"
check_approval 1 jiahy0825 zyfncg chenwhql sunzhongkai588 Ligoml
fi

HAS_MODIFIED_PHI_OR_FLUID_FILES=`git diff --name-only upstream/$BRANCH | grep -E "paddle/phi|paddle/fluid" || true`
USE_MUTABLE_DATA_FILES=""
for CHANGE_FILE in ${HAS_MODIFIED_PHI_OR_FLUID_FILES}; do
Expand Down

0 comments on commit 53d4e9e

Please sign in to comment.