debug: sync js files and eliminate issues with lint

This commit is contained in:
Fotis Koutoulakis (@NlightNFotis)
2024-10-24 14:49:43 +01:00
parent 420fe33409
commit a6a1c8e2ba
3 changed files with 15 additions and 5 deletions
+4 -1
View File
@@ -352,7 +352,8 @@ class GitHubFeatureFlags {
}
async loadApiResponse() {
// Do nothing when not running against github.com
if (this.gitHubVersion.type !== util.GitHubVariant.DOTCOM) {
if (this.gitHubVersion.type !== util.GitHubVariant.DOTCOM &&
this.gitHubVersion.type !== util.GitHubVariant.GHE_DOTCOM) {
this.logger.debug("Not running against github.com. Disabling all toggleable features.");
this.hasAccessedRemoteFeatureFlags = false;
return {};
@@ -373,6 +374,7 @@ class GitHubFeatureFlags {
this.logger.debug(` ${feature}: ${value}`);
}
this.hasAccessedRemoteFeatureFlags = true;
this.logger.info(`[DEBUG] Got remote flags: ${JSON.stringify(remoteFlags)}`);
return remoteFlags;
}
catch (e) {
@@ -381,6 +383,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.message}`);
this.logger.info(`[DEBUG] Got HTTP error while retrieving remote flags`);
this.hasAccessedRemoteFeatureFlags = false;
return {};
}
File diff suppressed because one or more lines are too long
+10 -3
View File
@@ -491,7 +491,10 @@ class GitHubFeatureFlags {
private async loadApiResponse(): Promise<GitHubFeatureFlagsApiResponse> {
// Do nothing when not running against github.com
if (this.gitHubVersion.type !== util.GitHubVariant.DOTCOM && this.gitHubVersion.type !== util.GitHubVariant.GHE_DOTCOM) {
if (
this.gitHubVersion.type !== util.GitHubVariant.DOTCOM &&
this.gitHubVersion.type !== util.GitHubVariant.GHE_DOTCOM
) {
this.logger.debug(
"Not running against github.com. Disabling all toggleable features.",
);
@@ -522,7 +525,9 @@ class GitHubFeatureFlags {
this.logger.debug(` ${feature}: ${value}`);
}
this.hasAccessedRemoteFeatureFlags = true;
this.logger.info(`[DEBUG] Got remote flags: ${JSON.stringify(remoteFlags)}`);
this.logger.info(
`[DEBUG] Got remote flags: ${JSON.stringify(remoteFlags)}`,
);
return remoteFlags;
} catch (e) {
if (util.isHTTPError(e) && e.status === 403) {
@@ -532,7 +537,9 @@ class GitHubFeatureFlags {
"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.message}`,
);
this.logger.info(`[DEBUG] Got HTTP error while retrieving remote flags`);
this.logger.info(
`[DEBUG] Got HTTP error while retrieving remote flags`,
);
this.hasAccessedRemoteFeatureFlags = false;
return {};
} else {