2020-08-26 16:49:43 -04:00
|
|
|
/**
|
|
|
|
* @license
|
|
|
|
* Copyright Google LLC All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
|
|
* found in the LICENSE file at https://angular.io/license
|
|
|
|
*/
|
|
|
|
|
2020-10-01 19:06:56 -04:00
|
|
|
import {GitClient} from '../../utils/git/index';
|
2020-08-26 16:49:43 -04:00
|
|
|
import {getCaretakerConfig} from '../config';
|
|
|
|
|
2020-09-01 14:29:32 -04:00
|
|
|
import {printCiStatus} from './ci';
|
2020-08-26 16:49:43 -04:00
|
|
|
import {printG3Comparison} from './g3';
|
|
|
|
import {printGithubTasks} from './github';
|
|
|
|
import {printServiceStatuses} from './services';
|
|
|
|
|
|
|
|
|
|
|
|
/** Check the status of services which Angular caretakers need to monitor. */
|
|
|
|
export async function checkServiceStatuses(githubToken: string) {
|
|
|
|
/** The configuration for the caretaker commands. */
|
|
|
|
const config = getCaretakerConfig();
|
|
|
|
/** The GitClient for interacting with git and Github. */
|
|
|
|
const git = new GitClient(githubToken, config);
|
2020-10-28 13:22:15 -04:00
|
|
|
// Prevent logging of the git commands being executed during the check.
|
|
|
|
GitClient.LOG_COMMANDS = false;
|
2020-08-26 16:49:43 -04:00
|
|
|
|
2020-09-01 14:29:32 -04:00
|
|
|
// TODO(josephperrott): Allow these checks to be loaded in parallel.
|
2020-08-26 16:49:43 -04:00
|
|
|
await printServiceStatuses();
|
|
|
|
await printGithubTasks(git, config.caretaker);
|
|
|
|
await printG3Comparison(git);
|
2020-09-01 14:29:32 -04:00
|
|
|
await printCiStatus(git);
|
2020-08-26 16:49:43 -04:00
|
|
|
}
|