From f9948ffd0ec22db592d6091f45ef6c2618c11770 Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Mon, 7 Nov 2022 18:50:16 +0000 Subject: [PATCH] Improve experience when init fails before generating a config file Suppose a customer has a run where the init Action failed before saving a config file. When the customer opens their Actions logs, the UI currently focuses on the post init step, since this is the last step that failed. Demoting the error in the post init Action to a warning means that the UI will instead focus on the `init` step, which is more useful for debugging what went wrong. --- lib/init-action-post-helper.js | 2 +- lib/init-action-post-helper.js.map | 2 +- src/init-action-post-helper.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/init-action-post-helper.js b/lib/init-action-post-helper.js index 06dca08e1a..237759a138 100644 --- a/lib/init-action-post-helper.js +++ b/lib/init-action-post-helper.js @@ -28,7 +28,7 @@ async function run(uploadDatabaseBundleDebugArtifact, uploadLogsDebugArtifact, p const logger = (0, logging_1.getActionsLogger)(); const config = await (0, config_utils_1.getConfig)(actionsUtil.getTemporaryDirectory(), logger); if (config === undefined) { - throw new Error("Config file could not be found at expected location. Did the 'init' action fail to start?"); + logger.warning("Debugging artifacts are unavailable since the 'init' Action failed before it could produce any."); } // Upload appropriate Actions artifacts for debugging if (config === null || config === void 0 ? void 0 : config.debugMode) { diff --git a/lib/init-action-post-helper.js.map b/lib/init-action-post-helper.js.map index aa88fec89f..ccb480636c 100644 --- a/lib/init-action-post-helper.js.map +++ b/lib/init-action-post-helper.js.map @@ -1 +1 @@ -{"version":3,"file":"init-action-post-helper.js","sourceRoot":"","sources":["../src/init-action-post-helper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAsC;AAEtC,4DAA8C;AAC9C,iDAA2C;AAC3C,uCAA6C;AAEtC,KAAK,UAAU,GAAG,CACvB,iCAA2C,EAC3C,uBAAiC,EACjC,cAAwB;IAExB,MAAM,MAAM,GAAG,IAAA,0BAAgB,GAAE,CAAC;IAElC,MAAM,MAAM,GAAG,MAAM,IAAA,wBAAS,EAAC,WAAW,CAAC,qBAAqB,EAAE,EAAE,MAAM,CAAC,CAAC;IAC5E,IAAI,MAAM,KAAK,SAAS,EAAE;QACxB,MAAM,IAAI,KAAK,CACb,2FAA2F,CAC5F,CAAC;KACH;IAED,qDAAqD;IACrD,IAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,SAAS,EAAE;QACrB,IAAI,CAAC,IAAI,CACP,mGAAmG,CACpG,CAAC;QACF,MAAM,iCAAiC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACxD,MAAM,uBAAuB,CAAC,MAAM,CAAC,CAAC;QAEtC,MAAM,cAAc,CAAC,MAAM,CAAC,CAAC;KAC9B;AACH,CAAC;AAxBD,kBAwBC"} \ No newline at end of file +{"version":3,"file":"init-action-post-helper.js","sourceRoot":"","sources":["../src/init-action-post-helper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAsC;AAEtC,4DAA8C;AAC9C,iDAA2C;AAC3C,uCAA6C;AAEtC,KAAK,UAAU,GAAG,CACvB,iCAA2C,EAC3C,uBAAiC,EACjC,cAAwB;IAExB,MAAM,MAAM,GAAG,IAAA,0BAAgB,GAAE,CAAC;IAElC,MAAM,MAAM,GAAG,MAAM,IAAA,wBAAS,EAAC,WAAW,CAAC,qBAAqB,EAAE,EAAE,MAAM,CAAC,CAAC;IAC5E,IAAI,MAAM,KAAK,SAAS,EAAE;QACxB,MAAM,CAAC,OAAO,CACZ,iGAAiG,CAClG,CAAC;KACH;IAED,qDAAqD;IACrD,IAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,SAAS,EAAE;QACrB,IAAI,CAAC,IAAI,CACP,mGAAmG,CACpG,CAAC;QACF,MAAM,iCAAiC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACxD,MAAM,uBAAuB,CAAC,MAAM,CAAC,CAAC;QAEtC,MAAM,cAAc,CAAC,MAAM,CAAC,CAAC;KAC9B;AACH,CAAC;AAxBD,kBAwBC"} \ No newline at end of file diff --git a/src/init-action-post-helper.ts b/src/init-action-post-helper.ts index bb5123e8d2..90b89c0c14 100644 --- a/src/init-action-post-helper.ts +++ b/src/init-action-post-helper.ts @@ -13,8 +13,8 @@ export async function run( const config = await getConfig(actionsUtil.getTemporaryDirectory(), logger); if (config === undefined) { - throw new Error( - "Config file could not be found at expected location. Did the 'init' action fail to start?" + logger.warning( + "Debugging artifacts are unavailable since the 'init' Action failed before it could produce any." ); }