Compare commits

...

4 Commits

Author SHA1 Message Date
Fotis Koutoulakis (@NlightNFotis)
a6a1c8e2ba debug: sync js files and eliminate issues with lint 2024-10-24 14:49:43 +01:00
Fotis Koutoulakis (@NlightNFotis)
420fe33409 debug: add more logging to see what feature flags were retrievable 2024-10-24 14:40:12 +01:00
Fotis Koutoulakis (@NlightNFotis)
e93bd1c127 debug: what happens if we just bypass return 2024-10-24 14:29:42 +01:00
Fotis Koutoulakis (@NlightNFotis)
2d27f9b8e3 debug: add debug logging to see what API endpoint proxima stamp uses 2024-10-24 12:03:07 +01:00
6 changed files with 24 additions and 4 deletions

4
lib/api-client.js generated
View File

@@ -44,6 +44,7 @@ const githubUtils = __importStar(require("@actions/github/lib/utils"));
const retry = __importStar(require("@octokit/plugin-retry"));
const console_log_level_1 = __importDefault(require("console-log-level"));
const actions_util_1 = require("./actions-util");
const logging_1 = require("./logging");
const repository_1 = require("./repository");
const util_1 = require("./util");
const GITHUB_ENTERPRISE_VERSION_HEADER = "x-github-enterprise-version";
@@ -106,6 +107,9 @@ async function getGitHubVersion() {
if (cachedGitHubVersion === undefined) {
cachedGitHubVersion = await getGitHubVersionFromApi(getApiClient(), getApiDetails());
}
(0, logging_1.getRunnerLogger)(true).info(JSON.stringify(cachedGitHubVersion));
(0, logging_1.getRunnerLogger)(true).info(getApiDetails().url);
(0, logging_1.getRunnerLogger)(true).info(getApiDetails().apiURL);
return cachedGitHubVersion;
}
/**

File diff suppressed because one or more lines are too long

5
lib/feature-flags.js generated
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

View File

@@ -4,6 +4,7 @@ import * as retry from "@octokit/plugin-retry";
import consoleLogLevel from "console-log-level";
import { getActionVersion, getRequiredInput } from "./actions-util";
import { getRunnerLogger } from "./logging";
import { parseRepositoryNwo } from "./repository";
import {
ConfigurationError,
@@ -116,6 +117,9 @@ export async function getGitHubVersion(): Promise<GitHubVersion> {
getApiDetails(),
);
}
getRunnerLogger(true).info(JSON.stringify(cachedGitHubVersion));
getRunnerLogger(true).info(getApiDetails().url);
getRunnerLogger(true).info(getApiDetails().apiURL);
return cachedGitHubVersion;
}

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) {
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,6 +525,9 @@ class GitHubFeatureFlags {
this.logger.debug(` ${feature}: ${value}`);
}
this.hasAccessedRemoteFeatureFlags = true;
this.logger.info(
`[DEBUG] Got remote flags: ${JSON.stringify(remoteFlags)}`,
);
return remoteFlags;
} catch (e) {
if (util.isHTTPError(e) && e.status === 403) {
@@ -531,6 +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.hasAccessedRemoteFeatureFlags = false;
return {};
} else {