diff --git a/lib/feature-flags.js b/lib/feature-flags.js index acb933ae1a..8f09253b4f 100644 --- a/lib/feature-flags.js +++ b/lib/feature-flags.js @@ -244,7 +244,10 @@ class GitHubFeatureFlags { owner: this.repositoryNwo.owner, repo: this.repositoryNwo.repo, }); - return response.data; + const remoteFlags = response.data; + this.logger.debug("Loaded the following default values for the feature flags from the Code Scanning API: " + + `${JSON.stringify(remoteFlags)}`); + return remoteFlags; } catch (e) { if (util.isHTTPError(e) && e.status === 403) { @@ -252,6 +255,7 @@ class GitHubFeatureFlags { "As a result, it will not be opted into any experimental features. " + "This could be because the Action is running on a pull request from a fork. If not, " + `please ensure the Action has the 'security-events: write' permission. Details: ${e}`); + return {}; } else { // Some features, such as `ml_powered_queries_enabled` affect the produced alerts. diff --git a/lib/feature-flags.js.map b/lib/feature-flags.js.map index 721fd67f99..687c305dbf 100644 --- a/lib/feature-flags.js.map +++ b/lib/feature-flags.js.map @@ -1 +1 @@ -{"version":3,"file":"feature-flags.js","sourceRoot":"","sources":["../src/feature-flags.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAE7B,+CAAiC;AAEjC,6CAA4C;AAE5C,0DAA4C,CAAC,2CAA2C;AAGxF,6CAA+B;AAE/B,MAAM,mCAAmC,GAAG,yBAAyB,CAAC;AACtE,MAAM,mCAAmC,GAAG,UAAU,CAAC;AACvD,MAAM,8BAA8B,GAAG,QAAQ,CAAC;AAqBhD,IAAY,OAQX;AARD,WAAY,OAAO;IACjB,8DAAmD,CAAA;IACnD,sFAA2E,CAAA;IAC3E,2DAAgD,CAAA;IAChD,2EAAgE,CAAA;IAChE,iEAAsD,CAAA;IACtD,sDAA2C,CAAA;IAC3C,mEAAwD,CAAA;AAC1D,CAAC,EARW,OAAO,GAAP,eAAO,KAAP,eAAO,QAQlB;AAEY,QAAA,aAAa,GAGtB;IACF,CAAC,OAAO,CAAC,sBAAsB,CAAC,EAAE;QAChC,MAAM,EAA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C,GAAG,CAC1E,CAAC;SACH;IACH,CAAC;IAEO,KAAK,CAAC,eAAe;QAC3B,iDAAiD;QACjD,IAAI,IAAI,CAAC,aAAa,CAAC,IAAI,KAAK,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE;YACzD,IAAI,CAAC,MAAM,CAAC,KAAK,CACf,oEAAoE,CACrE,CAAC;YACF,OAAO,EAAE,CAAC;SACX;QACD,IAAI;YACF,MAAM,QAAQ,GAAG,MAAM,IAAA,yBAAY,GAAE,CAAC,OAAO,CAC3C,8DAA8D,EAC9D;gBACE,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,KAAK;gBAC/B,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI;aAC9B,CACF,CAAC;YACF,OAAO,QAAQ,CAAC,IAAI,CAAC;SACtB;QAAC,OAAO,CAAC,EAAE;YACV,IAAI,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,KAAK,GAAG,EAAE;gBAC3C,IAAI,CAAC,MAAM,CAAC,OAAO,CACjB,gGAAgG;oBAC9F,oEAAoE;oBACpE,qFAAqF;oBACrF,kFAAkF,CAAC,EAAE,CACxF,CAAC;aACH;iBAAM;gBACL,kFAAkF;gBAClF,8EAA8E;gBAC9E,2FAA2F;gBAC3F,eAAe;gBACf,MAAM,IAAI,KAAK,CACb,sEAAsE,CAAC,EAAE,CAC1E,CAAC;aACH;SACF;IACH,CAAC;CACF"} \ No newline at end of file +{"version":3,"file":"feature-flags.js","sourceRoot":"","sources":["../src/feature-flags.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAE7B,+CAAiC;AAEjC,6CAA4C;AAE5C,0DAA4C,CAAC,2CAA2C;AAGxF,6CAA+B;AAE/B,MAAM,mCAAmC,GAAG,yBAAyB,CAAC;AACtE,MAAM,mCAAmC,GAAG,UAAU,CAAC;AACvD,MAAM,8BAA8B,GAAG,QAAQ,CAA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AAE,CAAC;aACX;iBAAM;gBACL,kFAAkF;gBAClF,8EAA8E;gBAC9E,2FAA2F;gBAC3F,eAAe;gBACf,MAAM,IAAI,KAAK,CACb,sEAAsE,CAAC,EAAE,CAC1E,CAAC;aACH;SACF;IACH,CAAC;CACF"} \ No newline at end of file diff --git a/src/feature-flags.ts b/src/feature-flags.ts index 03136420f4..bba973cacb 100644 --- a/src/feature-flags.ts +++ b/src/feature-flags.ts @@ -326,7 +326,7 @@ class GitHubFeatureFlags implements FeatureEnablement { } } - private async loadApiResponse() { + private async loadApiResponse(): Promise { // Do nothing when not running against github.com if (this.gitHubVersion.type !== util.GitHubVariant.DOTCOM) { this.logger.debug( @@ -342,7 +342,12 @@ class GitHubFeatureFlags implements FeatureEnablement { repo: this.repositoryNwo.repo, } ); - return response.data; + const remoteFlags = response.data; + this.logger.debug( + "Loaded the following default values for the feature flags from the Code Scanning API: " + + `${JSON.stringify(remoteFlags)}` + ); + return remoteFlags; } catch (e) { if (util.isHTTPError(e) && e.status === 403) { this.logger.warning( @@ -351,6 +356,7 @@ class GitHubFeatureFlags implements FeatureEnablement { "This could be because the Action is running on a pull request from a fork. If not, " + `please ensure the Action has the 'security-events: write' permission. Details: ${e}` ); + return {}; } else { // Some features, such as `ml_powered_queries_enabled` affect the produced alerts. // Considering these features disabled in the event of a transient error could