Add a deprecation warning for CodeQL 2.10.*

This commit is contained in:
Henry Mercer 2023-09-14 16:34:07 +01:00
parent e982de4fb4
commit ac4145f467
4 changed files with 45 additions and 20 deletions

View file

@ -5,6 +5,7 @@ See the [releases page](https://github.com/github/codeql-action/releases) for th
## [UNRELEASED] ## [UNRELEASED]
- Update default CodeQL bundle version to 2.14.5. [#1882](https://github.com/github/codeql-action/pull/1882) - Update default CodeQL bundle version to 2.14.5. [#1882](https://github.com/github/codeql-action/pull/1882)
- Add a deprecation warning for customers using CodeQL version 2.10.5 and earlier. This version of CodeQL was discontinued on 12 September 2023 alongside GitHub Enterprise Server 3.6, and will be unsupported by the next minor release of the CodeQL Action. [#1884](https://github.com/github/codeql-action/pull/1884)
## 2.21.6 - 13 Sep 2023 ## 2.21.6 - 13 Sep 2023

27
lib/codeql.js generated
View file

@ -66,7 +66,15 @@ const CODEQL_MINIMUM_VERSION = "2.9.4";
/** /**
* This version will shortly become the oldest version of CodeQL that the Action will run with. * This version will shortly become the oldest version of CodeQL that the Action will run with.
*/ */
const CODEQL_NEXT_MINIMUM_VERSION = "2.9.4"; const CODEQL_NEXT_MINIMUM_VERSION = "2.10.5";
/**
* This is the version of GHES that was most recently deprecated.
*/
const GHES_VERSION_MOST_RECENTLY_DEPRECATED = "3.6";
/**
* This is the deprecation date for the version of GHES that was most recently deprecated.
*/
const GHES_MOST_RECENT_DEPRECATION_DATE = "2023-09-12";
/** /**
* Versions of CodeQL that version-flag certain functionality in the Action. * Versions of CodeQL that version-flag certain functionality in the Action.
* For convenience, please keep these in descending order. Once a version * For convenience, please keep these in descending order. Once a version
@ -664,16 +672,17 @@ async function getCodeQLForCmd(cmd, checkVersion) {
else if (checkVersion && else if (checkVersion &&
process.env[environment_1.EnvVar.SUPPRESS_DEPRECATED_SOON_WARNING] !== "true" && process.env[environment_1.EnvVar.SUPPRESS_DEPRECATED_SOON_WARNING] !== "true" &&
!(await util.codeQlVersionAbove(codeql, CODEQL_NEXT_MINIMUM_VERSION))) { !(await util.codeQlVersionAbove(codeql, CODEQL_NEXT_MINIMUM_VERSION))) {
core.warning(`CodeQL CLI version ${await codeql.getVersion()} was deprecated on 2023-06-20 alongside ` + core.warning(`CodeQL CLI version ${await codeql.getVersion()} was discontinued on ` +
"GitHub Enterprise Server 3.5 and will not be supported by the next release of the " + `${GHES_MOST_RECENT_DEPRECATION_DATE} alongside GitHub Enterprise Server ` +
`CodeQL Action. Please update to CodeQL CLI version ${CODEQL_NEXT_MINIMUM_VERSION} or ` + `${GHES_VERSION_MOST_RECENTLY_DEPRECATED} and will not be supported by the next minor ` +
"later. For instance, if you have specified a custom version of the CLI using the " + `release of the CodeQL Action. Please update to CodeQL CLI version ` +
"'tools' input to the 'init' Action, you can remove this input to use the default " + `${CODEQL_NEXT_MINIMUM_VERSION} or later. For instance, if you have specified a custom ` +
"version.\n\n" + "version of the CLI using the 'tools' input to the 'init' Action, you can remove this " +
"input to use the default version.\n\n" +
"Alternatively, if you want to continue using CodeQL CLI version " + "Alternatively, if you want to continue using CodeQL CLI version " +
`${await codeql.getVersion()}, you can replace 'github/codeql-action/*@v2' by ` + `${await codeql.getVersion()}, you can replace 'github/codeql-action/*@v2' by ` +
"'github/codeql-action/*@v2.20.4' in your code scanning workflow to ensure you continue " + `'github/codeql-action/*@v${(0, actions_util_1.getActionVersion)()}' in your code scanning workflow to ` +
"using this version of the CodeQL Action."); "continue using this version of the CodeQL Action.");
core.exportVariable(environment_1.EnvVar.SUPPRESS_DEPRECATED_SOON_WARNING, "true"); core.exportVariable(environment_1.EnvVar.SUPPRESS_DEPRECATED_SOON_WARNING, "true");
} }
return codeql; return codeql;

File diff suppressed because one or more lines are too long

View file

@ -5,7 +5,11 @@ import * as core from "@actions/core";
import * as toolrunner from "@actions/exec/lib/toolrunner"; import * as toolrunner from "@actions/exec/lib/toolrunner";
import * as yaml from "js-yaml"; import * as yaml from "js-yaml";
import { getOptionalInput, isAnalyzingDefaultBranch } from "./actions-util"; import {
getActionVersion,
getOptionalInput,
isAnalyzingDefaultBranch,
} from "./actions-util";
import * as api from "./api-client"; import * as api from "./api-client";
import type { Config } from "./config-utils"; import type { Config } from "./config-utils";
import { EnvVar } from "./environment"; import { EnvVar } from "./environment";
@ -274,7 +278,17 @@ const CODEQL_MINIMUM_VERSION = "2.9.4";
/** /**
* This version will shortly become the oldest version of CodeQL that the Action will run with. * This version will shortly become the oldest version of CodeQL that the Action will run with.
*/ */
const CODEQL_NEXT_MINIMUM_VERSION = "2.9.4"; const CODEQL_NEXT_MINIMUM_VERSION = "2.10.5";
/**
* This is the version of GHES that was most recently deprecated.
*/
const GHES_VERSION_MOST_RECENTLY_DEPRECATED = "3.6";
/**
* This is the deprecation date for the version of GHES that was most recently deprecated.
*/
const GHES_MOST_RECENT_DEPRECATION_DATE = "2023-09-12";
/** /**
* Versions of CodeQL that version-flag certain functionality in the Action. * Versions of CodeQL that version-flag certain functionality in the Action.
@ -1084,16 +1098,17 @@ export async function getCodeQLForCmd(
!(await util.codeQlVersionAbove(codeql, CODEQL_NEXT_MINIMUM_VERSION)) !(await util.codeQlVersionAbove(codeql, CODEQL_NEXT_MINIMUM_VERSION))
) { ) {
core.warning( core.warning(
`CodeQL CLI version ${await codeql.getVersion()} was deprecated on 2023-06-20 alongside ` + `CodeQL CLI version ${await codeql.getVersion()} was discontinued on ` +
"GitHub Enterprise Server 3.5 and will not be supported by the next release of the " + `${GHES_MOST_RECENT_DEPRECATION_DATE} alongside GitHub Enterprise Server ` +
`CodeQL Action. Please update to CodeQL CLI version ${CODEQL_NEXT_MINIMUM_VERSION} or ` + `${GHES_VERSION_MOST_RECENTLY_DEPRECATED} and will not be supported by the next minor ` +
"later. For instance, if you have specified a custom version of the CLI using the " + `release of the CodeQL Action. Please update to CodeQL CLI version ` +
"'tools' input to the 'init' Action, you can remove this input to use the default " + `${CODEQL_NEXT_MINIMUM_VERSION} or later. For instance, if you have specified a custom ` +
"version.\n\n" + "version of the CLI using the 'tools' input to the 'init' Action, you can remove this " +
"input to use the default version.\n\n" +
"Alternatively, if you want to continue using CodeQL CLI version " + "Alternatively, if you want to continue using CodeQL CLI version " +
`${await codeql.getVersion()}, you can replace 'github/codeql-action/*@v2' by ` + `${await codeql.getVersion()}, you can replace 'github/codeql-action/*@v2' by ` +
"'github/codeql-action/*@v2.20.4' in your code scanning workflow to ensure you continue " + `'github/codeql-action/*@v${getActionVersion()}' in your code scanning workflow to ` +
"using this version of the CodeQL Action.", "continue using this version of the CodeQL Action.",
); );
core.exportVariable(EnvVar.SUPPRESS_DEPRECATED_SOON_WARNING, "true"); core.exportVariable(EnvVar.SUPPRESS_DEPRECATED_SOON_WARNING, "true");
} }