Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async run() {
// @ts-ignore we're going to populate `taskOutput` later
const taskOutput: TasksOutput = {};
// Define this constant so we can throw it and compare against the same value.
const breakingChangesErrorMessage = "breaking changes found";
const federatedServiceCompositionUnsuccessfulErrorMessage =
"Federated service composition was unsuccessful. Please see the reasons below.";
const { isCi } = envCi();
let schema: GraphQLSchema | undefined;
let graphID: string | undefined;
let graphVariant: string | undefined;
try {
await this.runTasks(
({ config, flags, project }) => {
/**
* Name of the graph being checked. `engine` is an example of a graph.
*
* A graph can be either a monolithic schema or the result of composition a federated schema.
*/
graphID = config.name;
graphVariant = flags.tag || config.tag || "current";
/**
import Release, {
getVersionMap,
IAutoConfig,
ILabelDefinition
} from './release';
import SEMVER, { calculateSemVerBump, IVersionLabels } from './semver';
import execPromise from './utils/exec-promise';
import loadPlugin, { IPlugin } from './utils/load-plugins';
import createLog, { ILogger } from './utils/logger';
import { makeHooks } from './utils/make-hooks';
import { IAuthorOptions, IRepoOptions } from './auto-args';
import { execSync } from 'child_process';
import { buildSearchQuery, ISearchResult } from './match-sha-to-pr';
const proxyUrl = process.env.https_proxy || process.env.http_proxy;
const env = envCi();
interface ChangelogLifecycle {
/** The bump being applied to the version */
bump: SEMVER;
/** The commits included in the changelog */
commits: IExtendedCommit[];
/** The generated release notes for the commits */
releaseNotes: string;
/** The current version of the project */
currentVersion: string;
/** The last version of the project */
lastRelease: string;
}
interface TestingToken {
/** A token used for testing */
isCI(): boolean {
return envCI().isCi;
}
async run() {
const { isCi } = envCi();
const { validationResults, operations } = await this.runTasks<{
operations: Operation[];
validationResults: ValidationResult[];
}>(
({ project, config }) => [
{
title: "Checking client compatibility with service",
task: async ctx => {
if (!config.name) {
throw new Error(
"No service found to link to Apollo Graph Manager. Graph Manager is required for this command."
);
}
ctx.gitContext = await gitInfo(this.log);