From c3a88118ec6f7a3b118527824792a003cb761bbc Mon Sep 17 00:00:00 2001 From: zhongpu <2013000149@qq.com> Date: Mon, 13 Jan 2020 19:04:54 +0800 Subject: [PATCH] add ci approvals for dygraph optest, test=develop (#21312) * add ci approvals for dygraph optest, test=develop * Add error message, test=develop, test=document_fix * Increase the number of approves of CI check for dygraph optest, test=develop, test=document_fix * add ci approvals for dygraph optest, test=develop * polish code style, test=develop, test=document_fix * remove ci-check trigger example, test=develop, test=document_fix --- tools/check_api_approvals.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tools/check_api_approvals.sh b/tools/check_api_approvals.sh index d98b4fc6f13..a58aa6b9e1b 100644 --- a/tools/check_api_approvals.sh +++ b/tools/check_api_approvals.sh @@ -165,6 +165,19 @@ if [ "${INVALID_PADDLE_CHECK}" != "" ] && [ "${GIT_PR_ID}" != "" ]; then check_approval 1 6836917 47554610 22561442 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 + ALL_OPTEST_BAN_DYGRAPH=`git diff -U0 upstream/$BRANCH ${PADDLE_ROOT}/${CHANGE_FILE} | grep "+" | grep "check_dygraph=" || true` + if [ "${ALL_OPTEST_BAN_DYGRAPH}" != "" ]; then + ALL_OPTEST_BAN_DYGRAPH_MESSAGE="${ALL_OPTEST_BAN_DYGRAPH_MESSAGE} ${CHANGE_FILE} : \n${ALL_OPTEST_BAN_DYGRAPH} \n" + fi +done +if [ "${ALL_OPTEST_BAN_DYGRAPH_MESSAGE}" != "" ] && [ "${GIT_PR_ID}" != "" ]; then + echo_line="Developers are not allowed to set the check_dygraph field directly, which is set to True by default. If you need to change the check_dygraph field, you must have one RD (phlrain (Recommend) or lanxianghit) review and approve. \nThe code that do not meet the specification are as follows:\n${ALL_OPTEST_BAN_DYGRAPH_MESSAGE}\n" + check_approval 1 43953930 47554610 +fi + NEW_OP_ADDED=`git diff --name-only --diff-filter=A upstream/$BRANCH |grep -oE ".+_op..*" || true` if [ "${NEW_OP_ADDED}" != "" ] && [ "${GIT_PR_ID}" != "" ]; then GET_KERNEL_TYPE_FUNC_CNT=`git diff -U0 --diff-filter=A upstream/$BRANCH |grep "+" |grep -czoE "GetExpectedKernelType[(][^(){}]+[)][^{]+[{][^}]+[}]" || true` -- GitLab