-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable Azure Pipelines #13818
Comments
I've enabled it now, and as part of that there was a first run, which did almost nothing: |
It's run on a number of PRs now, some including the infrastructure/ tests. If it starts misbehaving, here's how to disable it:
If someone could verify that the steps can be followed before it's urgent and I'm not around, that'd be great. |
Node script to list Azure Pipelines status of all PRs opened since it was enabled'use strict';
const octokit = require('@octokit/rest')();
const GH_TOKEN = process.env.GH_TOKEN;
if (!GH_TOKEN) {
console.error('Please set the GH_TOKEN environment variable.');
console.error('https://github.com/settings/tokens');
process.exit(1);
}
octokit.authenticate({
type: 'token',
token: GH_TOKEN
});
// merge time of https://github.com/web-platform-tests/wpt/pull/13769
const SINCE = '2018-10-31T11:06:44Z';
async function paginate(method, parameters) {
parameters = Object.assign({ per_page: 100 }, parameters);
let response = await method(parameters);
const { data } = response;
while (octokit.hasNextPage(response)) {
response = await octokit.getNextPage(response);
data.push(...response.data);
}
return data;
}
async function paginateSearch(method, parameters) {
parameters = Object.assign({ per_page: 100 }, parameters);
let response = await method(parameters);
const items = response.data.items;
while (octokit.hasNextPage(response)) {
response = await octokit.getNextPage(response);
items.push(...response.data.items);
}
return items;
}
(async () => {
const prs = await paginateSearch(octokit.search.issues, {
q: `repo:web-platform-tests/wpt is:pr is:open updated:>${SINCE}`,
});
for (const pr of prs) {
const commits = await paginate(octokit.pullRequests.getCommits, {
owner: 'web-platform-tests',
repo: 'wpt',
number: pr.number,
});
// only look at the final commit
const ref = commits[commits.length - 1].sha;
const statuses = await paginate(octokit.repos.getStatuses, {
owner: 'web-platform-tests',
repo: 'wpt',
ref,
});
// note: statuses are in reverse chronological order
const lastAzureStatus = statuses.find(status => status.context == 'Azure Pipelines');
if (!lastAzureStatus) {
console.log(`#${pr.number}: no status`);
continue;
}
console.log(`#${pr.number}: ${lastAzureStatus.state}`);
}
})(); It currently only lists success and "no status", for PRs that have had comments but no new commits. Nothing has failed or gotten stuck yet. https://dev.azure.com/web-platform-tests/wpt/_build?definitionId=1 lists the builds in the Azure Pipelines UI, but I didn't want to just trust that :) |
Hey @foolip! I'm a Program Manager for Azure Pipelines. It looks like you've been able to get up and running in other PRs. If you have any questions or suggestions, please don't hesitate to reach out! |
Thanks @kaylangan! I have an email thread with @thejohnjansen about some issues I've seen, but I'll paste it here verbatim for all to see:
|
Good news! With the help of @davidstaheli I was able to change the authentication method of the Azure Pipelines project so that the Checks API integration is used instead. That means we get the "Checks" tab nicely populated: https://github.com/web-platform-tests/wpt/pull/13856/checks (And it'll get even nicer: https://github.com/foolip/wpt/pull/11/checks?check_run_id=28196826) |
Very cool 👍 |
So, given that output, I'm wondering if I should try moving these tests from Travis to Azure Pipelines for Linux. @jgraham our plan was to move stuff to Taskcluster, but maybe we can leverage Azure Pipelines for the bits it seems especially good for? |
Oh no, first sign of infra trouble! In https://github.com/web-platform-tests/wpt/pull/13875/checks?check_run_id=28469086 there was this failure:
I presume it will go away if I retry. This was my own PR so no big problem. @kaylangan @thejohnjansen could you look into why this might be happening? Is there an automatic retry mechanism we can use? Taskcluster retries each task (=job in Azure Pipelines ) 5 times, I think mostly to deal with the possibility of the AWS spot instances used being killed. |
@foolip also happened in #13877 . I think it's perhaps caused by GitHub outage: https://status.github.com/messages |
Oh, that's two. If it was just the GitHub outage, wouldn't Travis and Taskcluster also fail? If it keeps happening, then everyone feel free to disable per the steps above. |
After switching from statuses to checks (#13818 (comment)) the script in #13818 (comment) no longer works. Updated script that checks (ha) for checks instead'use strict';
const octokit = require('@octokit/rest')();
const GH_TOKEN = process.env.GH_TOKEN;
if (!GH_TOKEN) {
console.error('Please set the GH_TOKEN environment variable.');
console.error('https://github.com/settings/tokens');
process.exit(1);
}
octokit.authenticate({
type: 'token',
token: GH_TOKEN
});
// merge time of https://github.com/web-platform-tests/wpt/pull/13769
const SINCE = '2018-10-31T11:06:44Z';
async function paginate(method, parameters) {
parameters = Object.assign({ per_page: 100 }, parameters);
let response = await method(parameters);
const { data } = response;
while (octokit.hasNextPage(response)) {
response = await octokit.getNextPage(response);
data.push(...response.data);
}
return data;
}
async function paginateSearch(method, parameters) {
parameters = Object.assign({ per_page: 100 }, parameters);
let response = await method(parameters);
const items = response.data.items;
while (octokit.hasNextPage(response)) {
response = await octokit.getNextPage(response);
items.push(...response.data.items);
}
return items;
}
(async () => {
const prs = await paginateSearch(octokit.search.issues, {
q: `repo:web-platform-tests/wpt is:pr is:open updated:>${SINCE}`,
});
for (const pr of prs) {
const commits = await paginate(octokit.pullRequests.getCommits, {
owner: 'web-platform-tests',
repo: 'wpt',
number: pr.number,
});
// only look at the final commit
const ref = commits[commits.length - 1].sha;
const checks = await paginate(octokit.checks.listForRef, {
owner: 'web-platform-tests',
repo: 'wpt',
ref,
});
const azureRun = checks.check_runs.find(run => run.name == 'Azure Pipelines');
if (!azureRun) {
console.log(`#${pr.number}: no check`);
continue;
}
if (azureRun.status !== 'completed') {
console.log(`#${pr.number}: ${azureRun.status}`);
} else {
console.log(`#${pr.number}: ${azureRun.conclusion}`);
}
}
})(); Right now it lists only #13875 as failing, which seems right. |
Given the lack of a check run on #13900, I now suspect builds aren't triggered for PRs from forks by default, which is also the default for Taskcluster. |
I've fixed the "PRs from forks" problem and documented how in #13952. |
Running the script in #13818 (comment) again now, the only failure listed is #13640, where the failures seems legitimate and the infrastructure/ tests are failing also on Travis. A lot of PRs don't have a check because they were created before Azure Pipelines was added and just had comments to bump their updated date, and some (like #13926) are before builds for PRs from forks were enabled. |
Updated script that only includes problematic "no check" cases'use strict';
const octokit = require('@octokit/rest')();
const GH_TOKEN = process.env.GH_TOKEN;
if (!GH_TOKEN) {
console.error('Please set the GH_TOKEN environment variable.');
console.error('https://github.com/settings/tokens');
process.exit(1);
}
octokit.authenticate({
type: 'token',
token: GH_TOKEN
});
// Time of https://github.com/web-platform-tests/wpt/issues/13818#issuecomment-436330922
const SINCE = '2018-11-06T17:07:56Z';
async function paginate(method, parameters) {
parameters = Object.assign({ per_page: 100 }, parameters);
let response = await method(parameters);
const { data } = response;
while (octokit.hasNextPage(response)) {
response = await octokit.getNextPage(response);
data.push(...response.data);
}
return data;
}
async function paginateSearch(method, parameters) {
parameters = Object.assign({ per_page: 100 }, parameters);
let response = await method(parameters);
const items = response.data.items;
while (octokit.hasNextPage(response)) {
response = await octokit.getNextPage(response);
items.push(...response.data.items);
}
return items;
}
(async () => {
const prs = await paginateSearch(octokit.search.issues, {
q: `repo:web-platform-tests/wpt is:pr is:open updated:>${SINCE}`,
});
for (const pr of prs) {
const commits = await paginate(octokit.pullRequests.getCommits, {
owner: 'web-platform-tests',
repo: 'wpt',
number: pr.number,
});
// only look at the final commit
const ref = commits[commits.length - 1].sha;
const checks = await paginate(octokit.checks.listForRef, {
owner: 'web-platform-tests',
repo: 'wpt',
ref,
});
const azureRun = checks.check_runs.find(run => run.name == 'Azure Pipelines');
if (!azureRun) {
// If created before the cutoff time and there are no checks, that's
// probably because the update was just a commment and no CI has run.
if (Date.parse(pr.created_at) < Date.parse(SINCE)) {
continue;
}
// Otherwise there might be something wrong.
console.log(`#${pr.number}: no check`);
continue;
}
if (azureRun.status !== 'completed') {
const msAgo = Date.now() - Date.parse(azureRun.started_at);
const minAgo = Math.floor(msAgo / 60000);
console.log(`#${pr.number}: ${azureRun.status} (started ${minAgo} min ago)`);
} else {
console.log(`#${pr.number}: ${azureRun.conclusion}`);
}
}
})(); Overall, things seem to be working just fine. |
In https://github.com/web-platform-tests/wpt/runs/29626821 the /infrastructure/assumptions/ahem.html failed on macOS Chrome Dev, but not Firefox Nightly or Safari Technology Preview. That suggests there might still be a problem with font installation on macOS :/ |
…=testonly Automatic update from web-platform-testsAdd configuration for Azure Pipelines (#13769) This just runs infrastructure/ tests on relevant PRs, something minimal and useful before trying to enable Azure Pipelines for the first time. Part of web-platform-tests/wpt#13299. Next step: web-platform-tests/wpt#13818 -- wpt-commits: 4098fe5f1f08442a8d63db9eb107b49a2f4fe752 wpt-pr: 13769
…=testonly Automatic update from web-platform-testsAdd configuration for Azure Pipelines (#13769) This just runs infrastructure/ tests on relevant PRs, something minimal and useful before trying to enable Azure Pipelines for the first time. Part of web-platform-tests/wpt#13299. Next step: web-platform-tests/wpt#13818 -- wpt-commits: 4098fe5f1f08442a8d63db9eb107b49a2f4fe752 wpt-pr: 13769
I've run the script in #13818 (comment) again, no new failures. |
From #14096 I learned that to be blocking, we also need to make the Azure Pipelines check required in the GitHub settings. I won't do that right away, but should be done before this issue is closed. |
I've run the script again. #14074 is the single new failure, but appears to be correct, the failures are in the modified code and unittests are also failing on Travis. Overall, things seems to be working pretty well. |
#14210 is an issue about monitoring Taskcluster on an ongoing basis. Possibly we can share some monitoring code/process across our CI systems. |
Checking again for failures:
That's all. Still working well :) |
Should this issue be closed? |
The monitoring part isn't done. I could rename #14210 to cover it too, but then that might also end up in a half-done state :) |
I think this should be closed and a bespoke issue opened for whatever monitioring you are planning. |
Filed #14763. |
…=testonly Automatic update from web-platform-testsAdd configuration for Azure Pipelines (#13769) This just runs infrastructure/ tests on relevant PRs, something minimal and useful before trying to enable Azure Pipelines for the first time. Part of web-platform-tests/wpt#13299. Next step: web-platform-tests/wpt#13818 -- wpt-commits: 4098fe5f1f08442a8d63db9eb107b49a2f4fe752 wpt-pr: 13769 UltraBlame original commit: afe5654fe9baae07072ff2384738e54bd29c1601
…=testonly Automatic update from web-platform-testsAdd configuration for Azure Pipelines (#13769) This just runs infrastructure/ tests on relevant PRs, something minimal and useful before trying to enable Azure Pipelines for the first time. Part of web-platform-tests/wpt#13299. Next step: web-platform-tests/wpt#13818 -- wpt-commits: 4098fe5f1f08442a8d63db9eb107b49a2f4fe752 wpt-pr: 13769 UltraBlame original commit: afe5654fe9baae07072ff2384738e54bd29c1601
…=testonly Automatic update from web-platform-testsAdd configuration for Azure Pipelines (#13769) This just runs infrastructure/ tests on relevant PRs, something minimal and useful before trying to enable Azure Pipelines for the first time. Part of web-platform-tests/wpt#13299. Next step: web-platform-tests/wpt#13818 -- wpt-commits: 4098fe5f1f08442a8d63db9eb107b49a2f4fe752 wpt-pr: 13769 UltraBlame original commit: afe5654fe9baae07072ff2384738e54bd29c1601
Once #13769 has landed, the next step will be to enable it in the Azure DevOps control panel: https://dev.azure.com/web-platform-tests/wpt
Once enabled, it has the potential to block PRs if anything breaks, and unlike with Travis it will not be possible for anyone with write access to this repo to restart builds. This means we need to monitor it carefully, document how to turn it off, and make sure enough people have access to turn it off.
@web-platform-tests/admins, if you don't have one, can you create a Microsoft account and send me the emails you used? Then I can add you to the Azure DevOps project.
For monitoring, I'll write a script that looks at all open PRs updated from now on, and checks for failing or ever-pending Azure Pipelines checks.
The text was updated successfully, but these errors were encountered: