Skip to content

Commit 3c77ce3

Browse files
authored
Merge pull request #14593 from panyx0718/fix5
Protect important header files.
2 parents e8ef14d + e32f4c5 commit 3c77ce3

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed

paddle/fluid/framework/operator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class OperatorBase;
7171
class ExecutionContext;
7272

7373
/**
74-
* OperatorBase has the basic element that Net will call to do computation.
74+
* OperatorBase has the basic elements that Net will call to do computation.
7575
* Only CreateOperator from OpRegistry will new Operator directly. User
7676
* should always construct a proto message OpDesc and call
7777
* OpRegistry::CreateOp(op_desc) to get an Operator instance.

paddle/scripts/paddle_build.sh

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -469,18 +469,21 @@ function assert_api_spec_approvals() {
469469
BRANCH="develop"
470470
fi
471471

472-
API_CHANGE=`git diff --name-only upstream/$BRANCH | grep "paddle/fluid/API.spec" || true`
473-
echo "checking API.spec change, PR: ${GIT_PR_ID}, changes: ${API_CHANGE}"
474-
if [ ${API_CHANGE} ] && [ "${GIT_PR_ID}" != "" ]; then
475-
# NOTE: per_page=10000 should be ok for all cases, a PR review > 10000 is not human readable.
476-
APPROVALS=`curl -H "Authorization: token ${GITHUB_API_TOKEN}" https://api.github.com/repos/PaddlePaddle/Paddle/pulls/${GIT_PR_ID}/reviews?per_page=10000 | \
477-
python ${PADDLE_ROOT}/tools/check_pr_approval.py 2 7845005 2887803 728699 13348433`
478-
echo "current pr ${GIT_PR_ID} got approvals: ${APPROVALS}"
479-
if [ "${APPROVALS}" == "FALSE" ]; then
480-
echo "You must have at least 2 approvals for the api change!"
481-
exit 1
482-
fi
483-
fi
472+
API_FILES=("paddle/fluid/API.spec" "paddle/fluid/framework/operator.h")
473+
for API_FILE in ${API_FILES[*]}; do
474+
API_CHANGE=`git diff --name-only upstream/$BRANCH | grep "${API_FILE}" || true`
475+
echo "checking ${API_FILE} change, PR: ${GIT_PR_ID}, changes: ${API_CHANGE}"
476+
if [ ${API_CHANGE} ] && [ "${GIT_PR_ID}" != "" ]; then
477+
# NOTE: per_page=10000 should be ok for all cases, a PR review > 10000 is not human readable.
478+
APPROVALS=`curl -H "Authorization: token ${GITHUB_API_TOKEN}" https://api.github.com/repos/PaddlePaddle/Paddle/pulls/${GIT_PR_ID}/reviews?per_page=10000 | \
479+
python ${PADDLE_ROOT}/tools/check_pr_approval.py 2 7845005 2887803 728699 13348433`
480+
echo "current pr ${GIT_PR_ID} got approvals: ${APPROVALS}"
481+
if [ "${APPROVALS}" == "FALSE" ]; then
482+
echo "You must have at least 2 approvals for the api change! ${API_FILE}"
483+
exit 1
484+
fi
485+
fi
486+
done
484487
}
485488

486489

0 commit comments

Comments
 (0)