diff options
| author | bors <bors@rust-lang.org> | 2019-06-13 15:44:58 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-06-13 15:44:58 +0000 |
| commit | 0e4a56b4b04ea98bb16caada30cb2418dd06e250 (patch) | |
| tree | e61f83ef4ef8738a82ce896da8d2423edcc8a0e5 /src | |
| parent | 57a3300c2538fd1044ce45d9ef3b82182acb57ae (diff) | |
| parent | 521edee2e586bc405953f0e84f50c49b85bf8510 (diff) | |
| download | rust-0e4a56b4b04ea98bb16caada30cb2418dd06e250.tar.gz rust-0e4a56b4b04ea98bb16caada30cb2418dd06e250.zip | |
Auto merge of #61772 - alexcrichton:pr-and-master-builds, r=pietroalbini
ci: Enable toolstate tracking on Azure Currently just run it through its paces but don't actually push to official locations. Instead let's just push to a separate fork (mine) as well as open issues in a separate fork (mine). Make sure that people aren't pinged for these issues as well! This should hopefully ensure that everything is working on Azure and give us a chance to work through any issues that come up. Fixes https://github.com/rust-lang/rust/issues/61790 Fixes https://github.com/rust-lang/rust/issues/61371
Diffstat (limited to 'src')
| -rwxr-xr-x | src/ci/docker/run.sh | 1 | ||||
| -rw-r--r-- | src/ci/docker/x86_64-gnu-tools/repo.sh | 2 | ||||
| -rwxr-xr-x | src/tools/publish_toolstate.py | 23 |
3 files changed, 17 insertions, 9 deletions
diff --git a/src/ci/docker/run.sh b/src/ci/docker/run.sh index c9642dbf60c..e6cd794887c 100755 --- a/src/ci/docker/run.sh +++ b/src/ci/docker/run.sh @@ -149,6 +149,7 @@ exec docker \ --env TF_BUILD \ --env BUILD_SOURCEBRANCHNAME \ --env TOOLSTATE_REPO_ACCESS_TOKEN \ + --env TOOLSTATE_REPO \ --env CI_JOB_NAME="${CI_JOB_NAME-$IMAGE}" \ --volume "$HOME/.cargo:/cargo" \ --volume "$HOME/rustsrc:$HOME/rustsrc" \ diff --git a/src/ci/docker/x86_64-gnu-tools/repo.sh b/src/ci/docker/x86_64-gnu-tools/repo.sh index 6364bc2aabf..741d4dcbd9a 100644 --- a/src/ci/docker/x86_64-gnu-tools/repo.sh +++ b/src/ci/docker/x86_64-gnu-tools/repo.sh @@ -55,7 +55,7 @@ commit_toolstate_change() { git config --global credential.helper store printf 'https://%s:x-oauth-basic@github.com\n' "$TOOLSTATE_REPO_ACCESS_TOKEN" \ > "$HOME/.git-credentials" - git clone --depth=1 https://github.com/rust-lang-nursery/rust-toolstate.git + git clone --depth=1 $TOOLSTATE_REPO cd rust-toolstate FAILURE=1 diff --git a/src/tools/publish_toolstate.py b/src/tools/publish_toolstate.py index 7d359fdcaca..a777279bd16 100755 --- a/src/tools/publish_toolstate.py +++ b/src/tools/publish_toolstate.py @@ -3,6 +3,7 @@ import sys import re +import os import json import datetime import collections @@ -53,6 +54,14 @@ def read_current_status(current_commit, path): return json.loads(status) return {} +def gh_url(): + return os.environ['TOOLSTATE_ISSUES_API_URL'] + +def maybe_delink(message): + if os.environ.get('TOOLSTATE_SKIP_MENTIONS') is not None: + return message.replace("@", "") + return message + def issue( tool, maintainers, @@ -61,13 +70,12 @@ def issue( pr_reviewer, ): # Open an issue about the toolstate failure. - gh_url = 'https://api.github.com/repos/rust-lang/rust/issues' assignees = [x.strip() for x in maintainers.split('@') if x != ''] assignees.append(relevant_pr_user) response = urllib2.urlopen(urllib2.Request( - gh_url, + gh_url(), json.dumps({ - 'body': textwrap.dedent('''\ + 'body': maybe_delink(textwrap.dedent('''\ Hello, this is your friendly neighborhood mergebot. After merging PR {}, I observed that the tool {} no longer builds. A follow-up PR to the repository {} is needed to fix the fallout. @@ -77,7 +85,7 @@ def issue( cc @{}, the PR reviewer, and @rust-lang/compiler -- nominating for prioritization. - ''').format(relevant_pr_number, tool, REPOS.get(tool), relevant_pr_user, pr_reviewer), + ''').format(relevant_pr_number, tool, REPOS.get(tool), relevant_pr_user, pr_reviewer)), 'title': '`{}` no longer builds after {}'.format(tool, relevant_pr_number), 'assignees': assignees, 'labels': ['T-compiler', 'I-nominated'], @@ -216,11 +224,10 @@ if __name__ == '__main__': f.write(message) # Write the toolstate comment on the PR as well. - gh_url = 'https://api.github.com/repos/rust-lang/rust/issues/{}/comments' \ - .format(number) + issue_url = gh_url() + '/{}/comments'.format(number) response = urllib2.urlopen(urllib2.Request( - gh_url, - json.dumps({'body': message}), + issue_url, + json.dumps({'body': maybe_delink(message)}), { 'Authorization': 'token ' + github_token, 'Content-Type': 'application/json', |
