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.
This commit is contained in:
parent
96636f3eb8
commit
521edee2e5
|
@ -140,7 +140,6 @@ jobs:
|
||||||
IMAGE: x86_64-gnu-aux
|
IMAGE: x86_64-gnu-aux
|
||||||
x86_64-gnu-tools:
|
x86_64-gnu-tools:
|
||||||
IMAGE: x86_64-gnu-tools
|
IMAGE: x86_64-gnu-tools
|
||||||
# FIXME if: branch = auto OR (type = pull_request AND commit_message =~ /(?i:^update.*\b(rls|rustfmt|clippy|miri|cargo)\b)/)
|
|
||||||
x86_64-gnu-debug:
|
x86_64-gnu-debug:
|
||||||
IMAGE: x86_64-gnu-debug
|
IMAGE: x86_64-gnu-debug
|
||||||
x86_64-gnu-nopt:
|
x86_64-gnu-nopt:
|
||||||
|
|
|
@ -6,6 +6,9 @@ pr: none
|
||||||
trigger:
|
trigger:
|
||||||
- master
|
- master
|
||||||
|
|
||||||
|
variables:
|
||||||
|
- group: prod-credentials
|
||||||
|
|
||||||
pool:
|
pool:
|
||||||
vmImage: ubuntu-16.04
|
vmImage: ubuntu-16.04
|
||||||
|
|
||||||
|
@ -16,9 +19,7 @@ steps:
|
||||||
- script: |
|
- script: |
|
||||||
export MESSAGE_FILE=$(mktemp -t msg.XXXXXX)
|
export MESSAGE_FILE=$(mktemp -t msg.XXXXXX)
|
||||||
. src/ci/docker/x86_64-gnu-tools/repo.sh
|
. src/ci/docker/x86_64-gnu-tools/repo.sh
|
||||||
# FIXME(pietro): committing is disabled until we switch to Azure Pipelines
|
commit_toolstate_change "$MESSAGE_FILE" "$BUILD_SOURCESDIRECTORY/src/tools/publish_toolstate.py" "$(git rev-parse HEAD)" "$(git log --format=%s -n1 HEAD)" "$MESSAGE_FILE" "$TOOLSTATE_REPO_ACCESS_TOKEN"
|
||||||
# as the source of truth, or until we setup a separate test repo.
|
|
||||||
#commit_toolstate_change "$MESSAGE_FILE" "$BUILD_SOURCESDIRECTORY/src/tools/publish_toolstate.py" "$(git rev-parse HEAD)" "$(git log --format=%s -n1 HEAD)" "$MESSAGE_FILE" "$TOOLSTATE_REPO_ACCESS_TOKEN"
|
|
||||||
displayName: Publish toolstate
|
displayName: Publish toolstate
|
||||||
env:
|
env:
|
||||||
TOOLSTATE_REPO_ACCESS_TOKEN: $(TOOLSTATE_REPO_ACCESS_TOKEN_SECRET)
|
TOOLSTATE_REPO_ACCESS_TOKEN: $(TOOLSTATE_REPO_ACCESS_TOKEN)
|
||||||
|
|
|
@ -4,10 +4,11 @@
|
||||||
|
|
||||||
trigger: none
|
trigger: none
|
||||||
pr:
|
pr:
|
||||||
- master # FIXME: really just want any branch, but want an explicit "pr" property set so it's clear
|
- master
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
- job: Linux
|
- job: Linux
|
||||||
|
timeoutInMinutes: 600
|
||||||
pool:
|
pool:
|
||||||
vmImage: ubuntu-16.04
|
vmImage: ubuntu-16.04
|
||||||
steps:
|
steps:
|
||||||
|
@ -15,8 +16,18 @@ jobs:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
x86_64-gnu-llvm-6.0:
|
x86_64-gnu-llvm-6.0:
|
||||||
RUST_BACKTRACE: 1
|
IMAGE: x86_64-gnu-llvm-6.0
|
||||||
|
mingw-check:
|
||||||
|
IMAGE: mingw-check
|
||||||
|
|
||||||
# x86_64-gnu-tools: {}
|
# TODO: enable this job if the commit message matches this regex, need tools
|
||||||
# # if: branch = auto OR (type = pull_request AND commit_message =~ /(?i:^update.*\b(rls|rustfmt|clippy|miri|cargo)\b)/)
|
# figure out how to get the current commit message on azure and stick it in a
|
||||||
# mingw-check: {}
|
# condition somewhere
|
||||||
|
# if: commit_message =~ /(?i:^update.*\b(rls|rustfmt|clippy|miri|cargo)\b)/
|
||||||
|
# - job: Linux-x86_64-gnu-tools
|
||||||
|
# pool:
|
||||||
|
# vmImage: ubuntu-16.04
|
||||||
|
# steps:
|
||||||
|
# - template: steps/run.yml
|
||||||
|
# variables:
|
||||||
|
# IMAGE: x86_64-gnu-tools
|
||||||
|
|
|
@ -124,6 +124,7 @@ steps:
|
||||||
CI: true
|
CI: true
|
||||||
SRC: .
|
SRC: .
|
||||||
AWS_SECRET_ACCESS_KEY: $(AWS_SECRET_ACCESS_KEY)
|
AWS_SECRET_ACCESS_KEY: $(AWS_SECRET_ACCESS_KEY)
|
||||||
|
TOOLSTATE_REPO_ACCESS_TOKEN: $(TOOLSTATE_REPO_ACCESS_TOKEN)
|
||||||
displayName: Run build
|
displayName: Run build
|
||||||
|
|
||||||
# If we're a deploy builder, use the `aws` command to publish everything to our
|
# If we're a deploy builder, use the `aws` command to publish everything to our
|
||||||
|
|
|
@ -149,6 +149,7 @@ exec docker \
|
||||||
--env TF_BUILD \
|
--env TF_BUILD \
|
||||||
--env BUILD_SOURCEBRANCHNAME \
|
--env BUILD_SOURCEBRANCHNAME \
|
||||||
--env TOOLSTATE_REPO_ACCESS_TOKEN \
|
--env TOOLSTATE_REPO_ACCESS_TOKEN \
|
||||||
|
--env TOOLSTATE_REPO \
|
||||||
--env CI_JOB_NAME="${CI_JOB_NAME-$IMAGE}" \
|
--env CI_JOB_NAME="${CI_JOB_NAME-$IMAGE}" \
|
||||||
--volume "$HOME/.cargo:/cargo" \
|
--volume "$HOME/.cargo:/cargo" \
|
||||||
--volume "$HOME/rustsrc:$HOME/rustsrc" \
|
--volume "$HOME/rustsrc:$HOME/rustsrc" \
|
||||||
|
|
|
@ -55,7 +55,7 @@ commit_toolstate_change() {
|
||||||
git config --global credential.helper store
|
git config --global credential.helper store
|
||||||
printf 'https://%s:x-oauth-basic@github.com\n' "$TOOLSTATE_REPO_ACCESS_TOKEN" \
|
printf 'https://%s:x-oauth-basic@github.com\n' "$TOOLSTATE_REPO_ACCESS_TOKEN" \
|
||||||
> "$HOME/.git-credentials"
|
> "$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
|
cd rust-toolstate
|
||||||
FAILURE=1
|
FAILURE=1
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import re
|
import re
|
||||||
|
import os
|
||||||
import json
|
import json
|
||||||
import datetime
|
import datetime
|
||||||
import collections
|
import collections
|
||||||
|
@ -53,6 +54,14 @@ def read_current_status(current_commit, path):
|
||||||
return json.loads(status)
|
return json.loads(status)
|
||||||
return {}
|
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(
|
def issue(
|
||||||
tool,
|
tool,
|
||||||
maintainers,
|
maintainers,
|
||||||
|
@ -61,13 +70,12 @@ def issue(
|
||||||
pr_reviewer,
|
pr_reviewer,
|
||||||
):
|
):
|
||||||
# Open an issue about the toolstate failure.
|
# 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 = [x.strip() for x in maintainers.split('@') if x != '']
|
||||||
assignees.append(relevant_pr_user)
|
assignees.append(relevant_pr_user)
|
||||||
response = urllib2.urlopen(urllib2.Request(
|
response = urllib2.urlopen(urllib2.Request(
|
||||||
gh_url,
|
gh_url(),
|
||||||
json.dumps({
|
json.dumps({
|
||||||
'body': textwrap.dedent('''\
|
'body': maybe_delink(textwrap.dedent('''\
|
||||||
Hello, this is your friendly neighborhood mergebot.
|
Hello, this is your friendly neighborhood mergebot.
|
||||||
After merging PR {}, I observed that the tool {} no longer builds.
|
After merging PR {}, I observed that the tool {} no longer builds.
|
||||||
A follow-up PR to the repository {} is needed to fix the fallout.
|
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.
|
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),
|
'title': '`{}` no longer builds after {}'.format(tool, relevant_pr_number),
|
||||||
'assignees': assignees,
|
'assignees': assignees,
|
||||||
'labels': ['T-compiler', 'I-nominated'],
|
'labels': ['T-compiler', 'I-nominated'],
|
||||||
|
@ -216,11 +224,10 @@ if __name__ == '__main__':
|
||||||
f.write(message)
|
f.write(message)
|
||||||
|
|
||||||
# Write the toolstate comment on the PR as well.
|
# Write the toolstate comment on the PR as well.
|
||||||
gh_url = 'https://api.github.com/repos/rust-lang/rust/issues/{}/comments' \
|
issue_url = gh_url() + '/{}/comments'.format(number)
|
||||||
.format(number)
|
|
||||||
response = urllib2.urlopen(urllib2.Request(
|
response = urllib2.urlopen(urllib2.Request(
|
||||||
gh_url,
|
issue_url,
|
||||||
json.dumps({'body': message}),
|
json.dumps({'body': maybe_delink(message)}),
|
||||||
{
|
{
|
||||||
'Authorization': 'token ' + github_token,
|
'Authorization': 'token ' + github_token,
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
|
|
Loading…
Reference in New Issue