提交 3e665862 编写于 作者: X Xin Pan

Protect important header files.

test=develop
上级 6224e61f
...@@ -71,7 +71,7 @@ class OperatorBase; ...@@ -71,7 +71,7 @@ class OperatorBase;
class ExecutionContext; class ExecutionContext;
/** /**
* OperatorBase has the basic element that Net will call to do computation. * OperatorBase has the basic elements that Net will call to do computation.
* Only CreateOperator from OpRegistry will new Operator directly. User * Only CreateOperator from OpRegistry will new Operator directly. User
* should always construct a proto message OpDesc and call * should always construct a proto message OpDesc and call
* OpRegistry::CreateOp(op_desc) to get an Operator instance. * OpRegistry::CreateOp(op_desc) to get an Operator instance.
......
...@@ -469,18 +469,21 @@ function assert_api_spec_approvals() { ...@@ -469,18 +469,21 @@ function assert_api_spec_approvals() {
BRANCH="develop" BRANCH="develop"
fi fi
API_CHANGE=`git diff --name-only upstream/$BRANCH | grep "paddle/fluid/API.spec" || true` API_FILES=('paddle/fluid/API.spec' 'paddle/fluid/framework/operator.h')
echo "checking API.spec change, PR: ${GIT_PR_ID}, changes: ${API_CHANGE}" for API_FILE in ${API_FILES}; do
if [ ${API_CHANGE} ] && [ "${GIT_PR_ID}" != "" ]; then API_CHANGE=`git diff --name-only upstream/$BRANCH | grep "${API_FILE}" || true`
# NOTE: per_page=10000 should be ok for all cases, a PR review > 10000 is not human readable. echo "checking ${API_FILE} change, PR: ${GIT_PR_ID}, changes: ${API_CHANGE}"
APPROVALS=`curl -H "Authorization: token ${GITHUB_API_TOKEN}" https://api.github.com/repos/PaddlePaddle/Paddle/pulls/${GIT_PR_ID}/reviews?per_page=10000 | \ if [ ${API_CHANGE} ] && [ "${GIT_PR_ID}" != "" ]; then
python ${PADDLE_ROOT}/tools/check_pr_approval.py 2 7845005 2887803 728699 13348433` # NOTE: per_page=10000 should be ok for all cases, a PR review > 10000 is not human readable.
echo "current pr ${GIT_PR_ID} got approvals: ${APPROVALS}" APPROVALS=`curl -H "Authorization: token ${GITHUB_API_TOKEN}" https://api.github.com/repos/PaddlePaddle/Paddle/pulls/${GIT_PR_ID}/reviews?per_page=10000 | \
if [ "${APPROVALS}" == "FALSE" ]; then python ${PADDLE_ROOT}/tools/check_pr_approval.py 2 7845005 2887803 728699 13348433`
echo "You must have at least 2 approvals for the api change!" echo "current pr ${GIT_PR_ID} got approvals: ${APPROVALS}"
exit 1 if [ "${APPROVALS}" == "FALSE" ]; then
fi echo "You must have at least 2 approvals for the api change! ${API_FILE}"
fi exit 1
fi
fi
done
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册