From ae8729dd85546ff554c86bf090231c8020e2daea Mon Sep 17 00:00:00 2001 From: Edaena Salinas Date: Tue, 31 Mar 2020 14:11:06 -0700 Subject: [PATCH 1/8] Better error message in spk project --- src/commands/project/pipeline.ts | 32 +++++++++++++++++++++++++------- src/lib/gitutils.ts | 13 +++++++++++-- src/lib/i18n.json | 7 +++++++ 3 files changed, 43 insertions(+), 9 deletions(-) diff --git a/src/commands/project/pipeline.ts b/src/commands/project/pipeline.ts index 9f4cf19e4..b862fbfdc 100644 --- a/src/commands/project/pipeline.ts +++ b/src/commands/project/pipeline.ts @@ -39,6 +39,8 @@ import { import { logger } from "../../logger"; import { BedrockFileInfo, ConfigYaml } from "../../types"; import decorator from "./pipeline.decorator.json"; +import { build as buildError, log as logError } from "../../lib/errorBuilder"; +import { errorStatusCode } from "../../lib/errorStatusCode"; export interface CommandOptions { orgName: string | undefined; @@ -214,20 +216,33 @@ export const execute = async ( exitFn: (status: number) => Promise ): Promise => { if (!opts.repoUrl || !opts.pipelineName) { - logger.error(`Values for repo url and/or pipeline name are missing`); + logError( + buildError(errorStatusCode.VALIDATION_ERR, { + errorKey: "project-err-missing-values", + values: ["repo url and/or pipeline name"], + }) + ); await exitFn(1); return; } const gitUrlType = await isGitHubUrl(opts.repoUrl); if (gitUrlType) { - logger.error( - `GitHub repos are not supported. Repo url: ${opts.repoUrl} is invalid` + logError( + buildError(errorStatusCode.VALIDATION_ERR, { + errorKey: "project-err-github-repo", + values: [opts.repoUrl], + }) ); await exitFn(1); return; } if (!projectPath) { - logger.error("Project Path is missing"); + logError( + buildError(errorStatusCode.VALIDATION_ERR, { + errorKey: "project-err-missing-values", + values: ["project path"], + }) + ); await exitFn(1); return; } @@ -254,10 +269,13 @@ export const execute = async ( await installLifecyclePipeline(values); await exitFn(0); } catch (err) { - logger.error( - `Error occurred installing pipeline for project hld lifecycle.` + logError( + buildError( + errorStatusCode.CMD_EXE_ERR, + "project-install-lifecycle-pipeline-cmd-failed", + err + ) ); - logger.error(err); await exitFn(1); } }; diff --git a/src/lib/gitutils.ts b/src/lib/gitutils.ts index e1a84def8..7f99af824 100644 --- a/src/lib/gitutils.ts +++ b/src/lib/gitutils.ts @@ -1,7 +1,9 @@ /* eslint-disable @typescript-eslint/no-use-before-define */ +import { build as buildError, log as logError } from "./errorBuilder"; import GitUrlParse from "git-url-parse"; import path from "path"; import url from "url"; +import { errorStatusCode } from "./errorStatusCode"; import { logger } from "../logger"; import { exec } from "./shell"; @@ -181,8 +183,15 @@ export const getRepositoryName = (originUrl: string): string => { logger.debug("github repo found."); return name; } else { - throw Error( - "Could not determine origin repository, or it is not a supported type." + if (!resource.startsWith("http")) { + throw buildError( + errorStatusCode.VALIDATION_ERR, + "git-err-invalid-repository-url" + ); + } + throw buildError( + errorStatusCode.VALIDATION_ERR, + "git-err-validating-remote-git" ); } }; diff --git a/src/lib/i18n.json b/src/lib/i18n.json index 71bfc0ad7..ebe1301bf 100644 --- a/src/lib/i18n.json +++ b/src/lib/i18n.json @@ -37,6 +37,13 @@ "hld-append-var-group-cmd-failed": "HLD Append Variable Group Command was not successfully executed.", "hld-append-var-group-name-missing": "Variable group name was not provided. Provide variable group.", + "project-install-lifecycle-pipeline-cmd-failed": "Project install lifecycle pipeline was not successfully executed.", + "project-err-github-repo": "GitHub repos are not supported. Repo url: {0} is invalid", + "project-err-missing-values": "Value for {0} is missing.", + + "git-err-validating-remote-git": "Could not determine origin repository, or it is not a supported type.", + "git-err-invalid-repository-url": "Repositiry URL does not begin with http(s).", + "fileutils-append-variable-group-to-pipeline-yaml": "Could not append variable group name to manifest-generation.yaml file in HLD repo. Check this is file exist and if it is YAML format." } } From d51bdc5a57430011d5fa693fff462c891a1839b7 Mon Sep 17 00:00:00 2001 From: Edaena Salinas Date: Tue, 31 Mar 2020 14:12:51 -0700 Subject: [PATCH 2/8] Update imports --- src/lib/gitutils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/gitutils.ts b/src/lib/gitutils.ts index 7f99af824..50c52c078 100644 --- a/src/lib/gitutils.ts +++ b/src/lib/gitutils.ts @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/no-use-before-define */ -import { build as buildError, log as logError } from "./errorBuilder"; +import { build as buildError } from "./errorBuilder"; import GitUrlParse from "git-url-parse"; import path from "path"; import url from "url"; From 840e2bd5504823d59935fb1d8008d040a45f3783 Mon Sep 17 00:00:00 2001 From: Dennis Seah Date: Tue, 31 Mar 2020 15:16:03 -0700 Subject: [PATCH 3/8] Update pipeline.ts --- src/commands/project/pipeline.ts | 42 ++++++++++++-------------------- 1 file changed, 15 insertions(+), 27 deletions(-) diff --git a/src/commands/project/pipeline.ts b/src/commands/project/pipeline.ts index b862fbfdc..c00d94f75 100644 --- a/src/commands/project/pipeline.ts +++ b/src/commands/project/pipeline.ts @@ -215,41 +215,29 @@ export const execute = async ( projectPath: string, exitFn: (status: number) => Promise ): Promise => { - if (!opts.repoUrl || !opts.pipelineName) { - logError( - buildError(errorStatusCode.VALIDATION_ERR, { + try { + if (!opts.repoUrl || !opts.pipelineName) { + throw buildError(errorStatusCode.VALIDATION_ERR, { errorKey: "project-err-missing-values", values: ["repo url and/or pipeline name"], - }) - ); - await exitFn(1); - return; - } - const gitUrlType = await isGitHubUrl(opts.repoUrl); - if (gitUrlType) { - logError( - buildError(errorStatusCode.VALIDATION_ERR, { + }); + } + const gitUrlType = await isGitHubUrl(opts.repoUrl); + if (gitUrlType) { + throw buildError(errorStatusCode.VALIDATION_ERR, { errorKey: "project-err-github-repo", values: [opts.repoUrl], - }) - ); - await exitFn(1); - return; - } - if (!projectPath) { - logError( - buildError(errorStatusCode.VALIDATION_ERR, { + }); + } + if (!projectPath) { + throw buildError(errorStatusCode.VALIDATION_ERR, { errorKey: "project-err-missing-values", values: ["project path"], - }) - ); - await exitFn(1); - return; - } + }); + } - logger.verbose(`project path: ${projectPath}`); + logger.verbose(`project path: ${projectPath}`); - try { checkDependencies(projectPath); const gitOriginUrl = await getOriginUrl(); const values = fetchValidateValues(opts, gitOriginUrl, Config()); From 93bd187253a1238bf59d7f0ed769d9eb4ae7d729 Mon Sep 17 00:00:00 2001 From: Edaena Salinas Date: Tue, 31 Mar 2020 15:46:49 -0700 Subject: [PATCH 4/8] Update additional errors --- src/commands/project/pipeline.ts | 41 +++++++++++++++++++++++--------- src/lib/i18n.json | 7 ++++++ 2 files changed, 37 insertions(+), 11 deletions(-) diff --git a/src/commands/project/pipeline.ts b/src/commands/project/pipeline.ts index b862fbfdc..78ff1fa17 100644 --- a/src/commands/project/pipeline.ts +++ b/src/commands/project/pipeline.ts @@ -56,9 +56,12 @@ export interface CommandOptions { export const checkDependencies = (projectPath: string): void => { const file: BedrockFileInfo = bedrockFileInfo(projectPath); if (file.exist === false) { - throw new Error(PROJECT_INIT_CVG_DEPENDENCY_ERROR_MESSAGE); + throw buildError( + errorStatusCode.VALIDATION_ERR, + "project-err-init-dependency" + ); } else if (file.hasVariableGroups === false) { - throw new Error(PROJECT_CVG_DEPENDENCY_ERROR_MESSAGE); + throw buildError(errorStatusCode.VALIDATION_ERR, "project-err-cvg"); } }; @@ -77,11 +80,17 @@ export const fetchValidateValues = ( spkConfig: ConfigYaml | undefined ): CommandOptions => { if (!spkConfig) { - throw new Error("SPK Config is missing"); + throw buildError( + errorStatusCode.VALIDATION_ERR, + "project-err-spk-config-missing" + ); } const azureDevops = spkConfig?.azure_devops; if (!opts.repoUrl) { - throw Error(`Repo url not defined`); + throw buildError( + errorStatusCode.VALIDATION_ERR, + "project-err-repo-url-undefined" + ); } const values: CommandOptions = { @@ -111,7 +120,10 @@ export const fetchValidateValues = ( const error = validateForRequiredValues(decorator, map); if (error.length > 0) { - throw Error("invalid option values"); + throw buildError( + errorStatusCode.VALIDATION_ERR, + "project-err-invalid-options" + ); } validateProjectNameThrowable(values.devopsProject!); @@ -164,10 +176,16 @@ const createPipeline = async ( definition ); } catch (err) { - logger.error( - `Error occurred during pipeline creation for ${values.pipelineName}` + const errorInfo = buildError( + errorStatusCode.EXE_FLOW_ERR, + { + errorKey: "project-err-pipeline-create", + values: [values.pipelineName], + }, + err ); - throw err; // catch by other catch block + logError(errorInfo); + throw errorInfo; } }; @@ -193,9 +211,10 @@ export const installLifecyclePipeline = async ( ); if (typeof pipeline.id === "undefined") { const builtDefnString = JSON.stringify(pipeline); - throw Error( - `Invalid BuildDefinition created, parameter 'id' is missing from ${builtDefnString}` - ); + throw buildError(errorStatusCode.VALIDATION_ERR, { + errorKey: "project-err-invalid-build-definition", + values: [builtDefnString], + }); } logger.info(`Created pipeline for ${values.pipelineName}`); logger.info(`Pipeline ID: ${pipeline.id}`); diff --git a/src/lib/i18n.json b/src/lib/i18n.json index ebe1301bf..0a173e296 100644 --- a/src/lib/i18n.json +++ b/src/lib/i18n.json @@ -40,6 +40,13 @@ "project-install-lifecycle-pipeline-cmd-failed": "Project install lifecycle pipeline was not successfully executed.", "project-err-github-repo": "GitHub repos are not supported. Repo url: {0} is invalid", "project-err-missing-values": "Value for {0} is missing.", + "project-err-init-dependency": "Please run `spk project init` and `spk project cvg` commands before running this command to initialize the project.", + "project-err-cvg": "Please run `spk project cvg` command before running this command to create a variable group.", + "project-err-repo-url-undefined": "Repo url not defined", + "project-err-spk-config-missing": "SPK Config is missing", + "project-err-invalid-options": "Invalid option values", + "project-err-pipeline-create": "Error occurred during pipeline creation for {0}", + "project-err-invalid-build-definition": "Invalid BuildDefinition created, parameter 'id' is missing from {0}", "git-err-validating-remote-git": "Could not determine origin repository, or it is not a supported type.", "git-err-invalid-repository-url": "Repositiry URL does not begin with http(s).", From f56c47e3d76cbe28807d73abefe00a299a28fb06 Mon Sep 17 00:00:00 2001 From: Edaena Salinas Date: Tue, 31 Mar 2020 16:03:21 -0700 Subject: [PATCH 5/8] Rename error --- src/commands/project/pipeline.ts | 24 ++++++++++++++---------- src/lib/i18n.json | 18 +++++++++--------- 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/src/commands/project/pipeline.ts b/src/commands/project/pipeline.ts index 8fdcf6a68..cbebc98f2 100644 --- a/src/commands/project/pipeline.ts +++ b/src/commands/project/pipeline.ts @@ -58,10 +58,13 @@ export const checkDependencies = (projectPath: string): void => { if (file.exist === false) { throw buildError( errorStatusCode.VALIDATION_ERR, - "project-err-init-dependency" + "project-install-life-cycle-pipeline-err-init-dependency" ); } else if (file.hasVariableGroups === false) { - throw buildError(errorStatusCode.VALIDATION_ERR, "project-err-cvg"); + throw buildError( + errorStatusCode.VALIDATION_ERR, + "project-install-life-cycle-pipeline-err-cvg" + ); } }; @@ -82,14 +85,14 @@ export const fetchValidateValues = ( if (!spkConfig) { throw buildError( errorStatusCode.VALIDATION_ERR, - "project-err-spk-config-missing" + "project-install-life-cycle-pipeline-err-spk-config-missing" ); } const azureDevops = spkConfig?.azure_devops; if (!opts.repoUrl) { throw buildError( errorStatusCode.VALIDATION_ERR, - "project-err-repo-url-undefined" + "project-install-life-cycle-pipeline-err-repo-url-undefined" ); } @@ -122,7 +125,7 @@ export const fetchValidateValues = ( if (error.length > 0) { throw buildError( errorStatusCode.VALIDATION_ERR, - "project-err-invalid-options" + "project-install-life-cycle-pipeline-err-invalid-options" ); } @@ -179,7 +182,7 @@ const createPipeline = async ( const errorInfo = buildError( errorStatusCode.EXE_FLOW_ERR, { - errorKey: "project-err-pipeline-create", + errorKey: "project-install-life-cycle-pipeline-err-pipeline-create", values: [values.pipelineName], }, err @@ -212,7 +215,8 @@ export const installLifecyclePipeline = async ( if (typeof pipeline.id === "undefined") { const builtDefnString = JSON.stringify(pipeline); throw buildError(errorStatusCode.VALIDATION_ERR, { - errorKey: "project-err-invalid-build-definition", + errorKey: + "project-install-life-cycle-pipeline-err-invalid-build-definition", values: [builtDefnString], }); } @@ -237,20 +241,20 @@ export const execute = async ( try { if (!opts.repoUrl || !opts.pipelineName) { throw buildError(errorStatusCode.VALIDATION_ERR, { - errorKey: "project-err-missing-values", + errorKey: "project-install-life-cycle-pipeline-err-missing-values", values: ["repo url and/or pipeline name"], }); } const gitUrlType = await isGitHubUrl(opts.repoUrl); if (gitUrlType) { throw buildError(errorStatusCode.VALIDATION_ERR, { - errorKey: "project-err-github-repo", + errorKey: "project-install-life-cycle-pipeline-err-github-repo", values: [opts.repoUrl], }); } if (!projectPath) { throw buildError(errorStatusCode.VALIDATION_ERR, { - errorKey: "project-err-missing-values", + errorKey: "project-install-life-cycle-pipeline-err-missing-values", values: ["project path"], }); } diff --git a/src/lib/i18n.json b/src/lib/i18n.json index 389f34d31..92e251bfc 100644 --- a/src/lib/i18n.json +++ b/src/lib/i18n.json @@ -38,15 +38,15 @@ "hld-append-var-group-name-missing": "Variable group name was not provided. Provide variable group.", "project-install-lifecycle-pipeline-cmd-failed": "Project install lifecycle pipeline was not successfully executed.", - "project-err-github-repo": "GitHub repos are not supported. Repo url: {0} is invalid", - "project-err-missing-values": "Value for {0} is missing.", - "project-err-init-dependency": "Please run `spk project init` and `spk project cvg` commands before running this command to initialize the project.", - "project-err-cvg": "Please run `spk project cvg` command before running this command to create a variable group.", - "project-err-repo-url-undefined": "Repo url not defined", - "project-err-spk-config-missing": "SPK Config is missing", - "project-err-invalid-options": "Invalid option values", - "project-err-pipeline-create": "Error occurred during pipeline creation for {0}", - "project-err-invalid-build-definition": "Invalid BuildDefinition created, parameter 'id' is missing from {0}", + "project-install-life-cycle-pipeline-err-github-repo": "GitHub repos are not supported. Repo url: {0} is invalid", + "project-install-life-cycle-pipeline-err-missing-values": "Value for {0} is missing.", + "project-install-life-cycle-pipeline-err-init-dependency": "Please run `spk project init` and `spk project cvg` commands before running this command to initialize the project.", + "project-install-life-cycle-pipeline-err-cvg": "Please run `spk project cvg` command before running this command to create a variable group.", + "project-install-life-cycle-pipeline-err-repo-url-undefined": "Repo url not defined", + "project-install-life-cycle-pipeline-err-spk-config-missing": "SPK Config is missing", + "project-install-life-cycle-pipeline-err-invalid-options": "Invalid option values", + "project-install-life-cycle-pipeline-err-pipeline-create": "Error occurred during pipeline creation for {0}", + "project-install-life-cycle-pipeline-err-invalid-build-definition": "Invalid BuildDefinition created, parameter 'id' is missing from {0}", "git-err-validating-remote-git": "Could not determine origin repository, or it is not a supported type.", "git-err-invalid-repository-url": "Repositiry URL does not begin with http(s).", From 750e1424ef4dcaa0894c8635ebb92042a278aefe Mon Sep 17 00:00:00 2001 From: Edaena Salinas Date: Tue, 31 Mar 2020 16:09:27 -0700 Subject: [PATCH 6/8] Rename error --- src/commands/project/pipeline.ts | 23 +++++++++++------------ src/lib/i18n.json | 20 ++++++++++---------- 2 files changed, 21 insertions(+), 22 deletions(-) diff --git a/src/commands/project/pipeline.ts b/src/commands/project/pipeline.ts index cbebc98f2..7026a5fb4 100644 --- a/src/commands/project/pipeline.ts +++ b/src/commands/project/pipeline.ts @@ -58,12 +58,12 @@ export const checkDependencies = (projectPath: string): void => { if (file.exist === false) { throw buildError( errorStatusCode.VALIDATION_ERR, - "project-install-life-cycle-pipeline-err-init-dependency" + "project-pipeline-err-init-dependency" ); } else if (file.hasVariableGroups === false) { throw buildError( errorStatusCode.VALIDATION_ERR, - "project-install-life-cycle-pipeline-err-cvg" + "project-pipeline-err-cvg" ); } }; @@ -85,14 +85,14 @@ export const fetchValidateValues = ( if (!spkConfig) { throw buildError( errorStatusCode.VALIDATION_ERR, - "project-install-life-cycle-pipeline-err-spk-config-missing" + "project-pipeline-err-spk-config-missing" ); } const azureDevops = spkConfig?.azure_devops; if (!opts.repoUrl) { throw buildError( errorStatusCode.VALIDATION_ERR, - "project-install-life-cycle-pipeline-err-repo-url-undefined" + "project-pipeline-err-repo-url-undefined" ); } @@ -125,7 +125,7 @@ export const fetchValidateValues = ( if (error.length > 0) { throw buildError( errorStatusCode.VALIDATION_ERR, - "project-install-life-cycle-pipeline-err-invalid-options" + "project-pipeline-err-invalid-options" ); } @@ -182,7 +182,7 @@ const createPipeline = async ( const errorInfo = buildError( errorStatusCode.EXE_FLOW_ERR, { - errorKey: "project-install-life-cycle-pipeline-err-pipeline-create", + errorKey: "project-pipeline-err-pipeline-create", values: [values.pipelineName], }, err @@ -215,8 +215,7 @@ export const installLifecyclePipeline = async ( if (typeof pipeline.id === "undefined") { const builtDefnString = JSON.stringify(pipeline); throw buildError(errorStatusCode.VALIDATION_ERR, { - errorKey: - "project-install-life-cycle-pipeline-err-invalid-build-definition", + errorKey: "project-pipeline-err-invalid-build-definition", values: [builtDefnString], }); } @@ -241,20 +240,20 @@ export const execute = async ( try { if (!opts.repoUrl || !opts.pipelineName) { throw buildError(errorStatusCode.VALIDATION_ERR, { - errorKey: "project-install-life-cycle-pipeline-err-missing-values", + errorKey: "project-pipeline-err-missing-values", values: ["repo url and/or pipeline name"], }); } const gitUrlType = await isGitHubUrl(opts.repoUrl); if (gitUrlType) { throw buildError(errorStatusCode.VALIDATION_ERR, { - errorKey: "project-install-life-cycle-pipeline-err-github-repo", + errorKey: "project-pipeline-err-github-repo", values: [opts.repoUrl], }); } if (!projectPath) { throw buildError(errorStatusCode.VALIDATION_ERR, { - errorKey: "project-install-life-cycle-pipeline-err-missing-values", + errorKey: "project-pipeline-err-missing-values", values: ["project path"], }); } @@ -283,7 +282,7 @@ export const execute = async ( logError( buildError( errorStatusCode.CMD_EXE_ERR, - "project-install-lifecycle-pipeline-cmd-failed", + "project-pipeline-cmd-failed", err ) ); diff --git a/src/lib/i18n.json b/src/lib/i18n.json index 92e251bfc..cae32cd24 100644 --- a/src/lib/i18n.json +++ b/src/lib/i18n.json @@ -37,16 +37,16 @@ "hld-append-var-group-cmd-failed": "HLD Append Variable Group command was not successfully executed.", "hld-append-var-group-name-missing": "Variable group name was not provided. Provide variable group.", - "project-install-lifecycle-pipeline-cmd-failed": "Project install lifecycle pipeline was not successfully executed.", - "project-install-life-cycle-pipeline-err-github-repo": "GitHub repos are not supported. Repo url: {0} is invalid", - "project-install-life-cycle-pipeline-err-missing-values": "Value for {0} is missing.", - "project-install-life-cycle-pipeline-err-init-dependency": "Please run `spk project init` and `spk project cvg` commands before running this command to initialize the project.", - "project-install-life-cycle-pipeline-err-cvg": "Please run `spk project cvg` command before running this command to create a variable group.", - "project-install-life-cycle-pipeline-err-repo-url-undefined": "Repo url not defined", - "project-install-life-cycle-pipeline-err-spk-config-missing": "SPK Config is missing", - "project-install-life-cycle-pipeline-err-invalid-options": "Invalid option values", - "project-install-life-cycle-pipeline-err-pipeline-create": "Error occurred during pipeline creation for {0}", - "project-install-life-cycle-pipeline-err-invalid-build-definition": "Invalid BuildDefinition created, parameter 'id' is missing from {0}", + "project-pipeline-cmd-failed": "Project install lifecycle pipeline was not successfully executed.", + "project-pipeline-err-github-repo": "GitHub repos are not supported. Repo url: {0} is invalid", + "project-pipeline-err-missing-values": "Value for {0} is missing.", + "project-pipeline-err-init-dependency": "Please run `spk project init` and `spk project cvg` commands before running this command to initialize the project.", + "project-pipeline-err-cvg": "Please run `spk project cvg` command before running this command to create a variable group.", + "project-pipeline-err-repo-url-undefined": "Repo url not defined", + "project-pipeline-err-spk-config-missing": "SPK Config is missing", + "project-pipeline-err-invalid-options": "Invalid option values", + "project-pipeline-err-pipeline-create": "Error occurred during pipeline creation for {0}", + "project-pipeline-err-invalid-build-definition": "Invalid BuildDefinition created, parameter 'id' is missing from {0}", "git-err-validating-remote-git": "Could not determine origin repository, or it is not a supported type.", "git-err-invalid-repository-url": "Repositiry URL does not begin with http(s).", From cd24088a99a1fed5896f44c80aca0a9007a3a9fc Mon Sep 17 00:00:00 2001 From: Edaena Salinas Date: Tue, 31 Mar 2020 16:57:24 -0700 Subject: [PATCH 7/8] Update imports --- src/commands/project/pipeline.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/commands/project/pipeline.ts b/src/commands/project/pipeline.ts index 7026a5fb4..086c398d3 100644 --- a/src/commands/project/pipeline.ts +++ b/src/commands/project/pipeline.ts @@ -15,8 +15,6 @@ import { } from "../../lib/commandBuilder"; import { BUILD_SCRIPT_URL, - PROJECT_CVG_DEPENDENCY_ERROR_MESSAGE, - PROJECT_INIT_CVG_DEPENDENCY_ERROR_MESSAGE, PROJECT_PIPELINE_FILENAME, } from "../../lib/constants"; import { AzureDevOpsOpts } from "../../lib/git"; From 55199120f6d70c5163fcc12655f0f932727df6f3 Mon Sep 17 00:00:00 2001 From: Edaena Salinas Date: Wed, 1 Apr 2020 10:27:06 -0700 Subject: [PATCH 8/8] Fix unit tests --- src/commands/project/pipeline.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/project/pipeline.test.ts b/src/commands/project/pipeline.test.ts index bc8590d99..7c1ce039e 100644 --- a/src/commands/project/pipeline.test.ts +++ b/src/commands/project/pipeline.test.ts @@ -227,7 +227,7 @@ describe("installLifecyclePipeline and execute tests", () => { expect(e).toBeDefined(); const builtDefnString = JSON.stringify({ fakeProperty: "temp" }); expect(e.message).toBe( - `Invalid BuildDefinition created, parameter 'id' is missing from ${builtDefnString}` + `project-pipeline-err-invalid-build-definition: Invalid BuildDefinition created, parameter 'id' is missing from ${builtDefnString}` ); } });