Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge main into releases/v2 #1323

Merged
merged 10 commits into from Oct 26, 2022
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,9 @@
# CodeQL Action Changelog

## 2.1.29 - 26 Oct 2022

- Update default CodeQL bundle version to 2.11.2. [#1320](https://github.com/github/codeql-action/pull/1320)

## 2.1.28 - 18 Oct 2022

- Update default CodeQL bundle version to 2.11.1. [#1294](https://github.com/github/codeql-action/pull/1294)
Expand Down
7 changes: 0 additions & 7 deletions lib/actions-util.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/actions-util.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/defaults.json
@@ -1,3 +1,3 @@
{
"bundleVersion": "codeql-bundle-20221010"
"bundleVersion": "codeql-bundle-20221024"
}
2 changes: 1 addition & 1 deletion lib/feature-flags.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 1 addition & 7 deletions lib/util.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/util.js.map

Large diffs are not rendered by default.

7 changes: 0 additions & 7 deletions lib/util.test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/util.test.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion node_modules/.package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "codeql",
"version": "2.1.28",
"version": "2.1.29",
"private": true,
"description": "CodeQL action",
"scripts": {
Expand Down
9 changes: 0 additions & 9 deletions src/actions-util.ts
Expand Up @@ -16,7 +16,6 @@ import {
getCodeQLDatabasePath,
getRequiredEnvParam,
GITHUB_DOTCOM_URL,
isGitHubGhesVersionBelow,
isHTTPError,
isInTestMode,
UserError,
Expand Down Expand Up @@ -749,14 +748,6 @@ const INCOMPATIBLE_MSG =
export async function sendStatusReport<S extends StatusReportBase>(
statusReport: S
): Promise<boolean> {
const gitHubVersion = await api.getGitHubVersionActionsOnly();
if (isGitHubGhesVersionBelow(gitHubVersion, "3.2.0")) {
// GHES 3.1 and earlier versions reject unexpected properties, which means
// that they will reject status reports with newly added properties.
// Inhibiting status reporting for GHES < 3.2 avoids such failures.
return true;
}

const statusReportJSON = JSON.stringify(statusReport);
core.debug(`Sending status report: ${statusReportJSON}`);
// If in test mode we don't want to upload the results
Expand Down
2 changes: 1 addition & 1 deletion src/defaults.json
@@ -1,3 +1,3 @@
{
"bundleVersion": "codeql-bundle-20221010"
"bundleVersion": "codeql-bundle-20221024"
}
2 changes: 1 addition & 1 deletion src/feature-flags.ts
Expand Up @@ -26,7 +26,7 @@ export const featureConfig: Record<
},
[Feature.CliConfigFileEnabled]: {
envVar: "CODEQL_PASS_CONFIG_TO_CLI",
minimumVersion: "2.10.1",
minimumVersion: "2.11.1",
},
[Feature.GolangExtractionReconciliationEnabled]: {
envVar: "CODEQL_GOLANG_EXTRACTION_RECONCILIATION",
Expand Down
27 changes: 0 additions & 27 deletions src/util.test.ts
Expand Up @@ -365,33 +365,6 @@ for (const [packs, expectedStatus] of ML_POWERED_JS_STATUS_TESTS) {
});
}

test("isGitHubGhesVersionBelow", async (t) => {
t.falsy(
util.isGitHubGhesVersionBelow({ type: util.GitHubVariant.DOTCOM }, "3.2.0")
);
t.falsy(
util.isGitHubGhesVersionBelow({ type: util.GitHubVariant.GHAE }, "3.2.0")
);
t.falsy(
util.isGitHubGhesVersionBelow(
{ type: util.GitHubVariant.GHES, version: "3.3.0" },
"3.2.0"
)
);
t.falsy(
util.isGitHubGhesVersionBelow(
{ type: util.GitHubVariant.GHES, version: "3.2.0" },
"3.2.0"
)
);
t.true(
util.isGitHubGhesVersionBelow(
{ type: util.GitHubVariant.GHES, version: "3.1.2" },
"3.2.0"
)
);
});

function formatGitHubVersion(version: util.GitHubVersion): string {
switch (version.type) {
case util.GitHubVariant.DOTCOM:
Expand Down
10 changes: 0 additions & 10 deletions src/util.ts
Expand Up @@ -605,16 +605,6 @@ export function isHTTPError(arg: any): arg is HTTPError {
return arg?.status !== undefined && Number.isInteger(arg.status);
}

export function isGitHubGhesVersionBelow(
gitHubVersion: GitHubVersion,
expectedVersion: string
): boolean {
return (
gitHubVersion.type === GitHubVariant.GHES &&
semver.lt(gitHubVersion.version, expectedVersion)
);
}

let cachedCodeQlVersion: undefined | string = undefined;

export function cacheCodeQlVersion(version: string): void {
Expand Down