Skip to content

Commit e8c12e1

Browse files
committed
Add a debug log for the feature flag API response
1 parent 2f7b9a1 commit e8c12e1

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

Diff for: lib/feature-flags.js

+5-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: lib/feature-flags.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: src/feature-flags.ts

+8-2
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ class GitHubFeatureFlags implements FeatureEnablement {
326326
}
327327
}
328328

329-
private async loadApiResponse() {
329+
private async loadApiResponse(): Promise<GitHubFeatureFlagsApiResponse> {
330330
// Do nothing when not running against github.com
331331
if (this.gitHubVersion.type !== util.GitHubVariant.DOTCOM) {
332332
this.logger.debug(
@@ -342,7 +342,12 @@ class GitHubFeatureFlags implements FeatureEnablement {
342342
repo: this.repositoryNwo.repo,
343343
}
344344
);
345-
return response.data;
345+
const remoteFlags = response.data;
346+
this.logger.debug(
347+
"Loaded the following default values for the feature flags from the Code Scanning API: " +
348+
`${JSON.stringify(remoteFlags)}`
349+
);
350+
return remoteFlags;
346351
} catch (e) {
347352
if (util.isHTTPError(e) && e.status === 403) {
348353
this.logger.warning(
@@ -351,6 +356,7 @@ class GitHubFeatureFlags implements FeatureEnablement {
351356
"This could be because the Action is running on a pull request from a fork. If not, " +
352357
`please ensure the Action has the 'security-events: write' permission. Details: ${e}`
353358
);
359+
return {};
354360
} else {
355361
// Some features, such as `ml_powered_queries_enabled` affect the produced alerts.
356362
// Considering these features disabled in the event of a transient error could

0 commit comments

Comments
 (0)