commenting on PRs is no longer used
This commit is contained in:
parent
8133526fcf
commit
d67009124f
|
|
@ -21,15 +21,8 @@ ulimit -c unlimited
|
|||
|
||||
# Performance PR testing needs GH API key and PR metadata to comment results
|
||||
if [ -n "$KOKORO_GITHUB_PULL_REQUEST_NUMBER" ]; then
|
||||
set +x
|
||||
sudo apt-get install -y jq
|
||||
export ghprbTargetBranch=$(curl -s https://api.github.com/repos/grpc/grpc/pulls/$KOKORO_GITHUB_PULL_REQUEST_NUMBER | jq -r .base.ref)
|
||||
|
||||
gsutil cp gs://grpc-testing-secrets/github_credentials/oauth_token.txt ~/
|
||||
# TODO(matt-kwong): rename this to GITHUB_OAUTH_TOKEN after Jenkins deprecation
|
||||
export JENKINS_OAUTH_TOKEN=$(cat ~/oauth_token.txt)
|
||||
export ghprbPullId=$KOKORO_GITHUB_PULL_REQUEST_NUMBER
|
||||
set -x
|
||||
fi
|
||||
|
||||
sudo pip install tabulate
|
||||
|
|
|
|||
|
|
@ -25,16 +25,10 @@ export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/GrpcTesting-d0eeee2db3
|
|||
|
||||
# If this is a PR using RUN_TESTS_FLAGS var, then add flags to filter tests
|
||||
if [ -n "$KOKORO_GITHUB_PULL_REQUEST_NUMBER" ]; then
|
||||
set +x
|
||||
brew update
|
||||
brew install jq || brew upgrade jq
|
||||
ghprbTargetBranch=$(curl -s https://api.github.com/repos/grpc/grpc/pulls/$KOKORO_GITHUB_PULL_REQUEST_NUMBER | jq -r .base.ref)
|
||||
export RUN_TESTS_FLAGS="$RUN_TESTS_FLAGS --filter_pr_tests --base_branch origin/$ghprbTargetBranch"
|
||||
|
||||
# TODO(matt-kwong): rename this to GITHUB_OAUTH_TOKEN after Jenkins deprecation
|
||||
export JENKINS_OAUTH_TOKEN=$(cat ${KOKORO_GFILE_DIR}/oauth_token.txt)
|
||||
export ghprbPullId=$KOKORO_GITHUB_PULL_REQUEST_NUMBER
|
||||
set -x
|
||||
fi
|
||||
|
||||
set +ex # rvm script is very verbose and exits with errorcode
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@
|
|||
# Location of the continuous shell script in repository.
|
||||
build_file: "grpc/tools/internal_ci/macos/grpc_ios_binary_size.sh"
|
||||
timeout_mins: 60
|
||||
gfile_resources: "/bigstore/grpc-testing-secrets/github_credentials/oauth_token.txt"
|
||||
before_action {
|
||||
fetch_keystore {
|
||||
keystore_resource {
|
||||
|
|
|
|||
|
|
@ -1,37 +0,0 @@
|
|||
# Copyright 2017 gRPC authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import os
|
||||
import json
|
||||
import urllib2
|
||||
|
||||
|
||||
def comment_on_pr(text):
|
||||
if 'JENKINS_OAUTH_TOKEN' not in os.environ:
|
||||
print 'Missing JENKINS_OAUTH_TOKEN env var: not commenting'
|
||||
return
|
||||
if 'ghprbPullId' not in os.environ:
|
||||
print 'Missing ghprbPullId env var: not commenting'
|
||||
return
|
||||
req = urllib2.Request(
|
||||
url='https://api.github.com/repos/grpc/grpc/issues/%s/comments' %
|
||||
os.environ['ghprbPullId'],
|
||||
data=json.dumps({
|
||||
'body': text
|
||||
}),
|
||||
headers={
|
||||
'Authorization': 'token %s' % os.environ['JENKINS_OAUTH_TOKEN'],
|
||||
'Content-Type': 'application/json',
|
||||
})
|
||||
print urllib2.urlopen(req).read()
|
||||
Loading…
Reference in New Issue