Skip to content

Commit ea6acbf

Browse files
authoredJan 10, 2025··
Merge pull request #2677 from github/angelapwen/deprecate-action-v2
Deprecate CodeQL Action v2
2 parents e83e0a4 + 4df151e commit ea6acbf

12 files changed

+61
-57
lines changed
 

‎CHANGELOG.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22

33
See the [releases page](https://github.com/github/codeql-action/releases) for the relevant changes to the CodeQL CLI and language packs.
44

5-
Note that the only difference between `v2` and `v3` of the CodeQL Action is the node version they support, with `v3` running on node 20 while we continue to release `v2` to support running on node 16. For example `3.22.11` was the first `v3` release and is functionally identical to `2.22.11`. This approach ensures an easy way to track exactly which features are included in different versions, indicated by the minor and patch version numbers.
6-
75
## [UNRELEASED]
86

7+
- CodeQL Action v2 is now deprecated, and is no longer updated or supported. For better performance, improved security, and new features, upgrade to v3. For more information, see [this changelog post](https://github.blog/changelog/2025-01-10-code-scanning-codeql-action-v2-is-now-deprecated/). [#2677](https://github.com/github/codeql-action/pull/2677)
98
- Update default CodeQL bundle version to 2.20.1. [#2678](https://github.com/github/codeql-action/pull/2678)
109

1110
## 3.28.0 - 20 Dec 2024

‎CONTRIBUTING.md

+14-5
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,9 @@ Here are a few things you can do that will increase the likelihood of your pull
6262

6363
You can start a release by triggering this workflow via [workflow dispatch](https://github.com/github/codeql-action/actions/workflows/update-release-branch.yml).
6464
1. The workflow run will open a pull request titled "Merge main into releases/v3". Follow the steps on the checklist in the pull request. Once you've checked off all but the last two of these, approve the PR and automerge it.
65-
1. When the "Merge main into releases/v3" pull request is merged into the `releases/v3` branch, a mergeback pull request to `main` and a backport pull request to `releases/v2` will both be automatically created. This mergeback pull request incorporates the changelog updates into `main`, tags the release using the merge commit of the "Merge main into releases/v3" pull request, and bumps the patch version of the CodeQL Action. The backport pull request will incorporate the updates into `releases/v2`.
66-
1. Approve the mergeback and backport pull requests and automerge them.
65+
1. When the "Merge main into releases/v3" pull request is merged into the `releases/v3` branch, a mergeback pull request to `main` will be automatically created. This mergeback pull request incorporates the changelog updates into `main`, tags the release using the merge commit of the "Merge main into releases/v3" pull request, and bumps the patch version of the CodeQL Action.
66+
1. If a backport to an older major version is required, a pull request targeting that version's branch will also be automatically created
67+
1. Approve the mergeback and backport pull request (if applicable) and automerge them.
6768

6869
Once the mergeback and backport pull request have been merged, the release is complete.
6970

@@ -73,9 +74,9 @@ Since the `codeql-action` runs most of its testing through individual Actions wo
7374

7475
1. By default, this script retrieves the checks from the latest SHA on `main`, so make sure that your `main` branch is up to date.
7576
2. Run the script. If there's a reason to, you can pass in a different SHA as a CLI argument.
76-
3. After running, go to the [branch protection rules settings page](https://github.com/github/codeql-action/settings/branches) and validate that the rules for `main`, `v2`, and `v3` have been updated.
77+
3. After running, go to the [branch protection rules settings page](https://github.com/github/codeql-action/settings/branches) and validate that the rules for `main`, `v3`, and any other currently supported major versions have been updated.
7778

78-
Note that any updates to checks need to be backported to the `releases/v2` branch, in order to maintain the same set of names for required checks.
79+
Note that any updates to checks on `main` need to be backported to all currently supported major version branches, in order to maintain the same set of names for required checks.
7980

8081
## Deprecating a CodeQL version (write access required)
8182

@@ -99,10 +100,18 @@ We typically deprecate a version of CodeQL when the GitHub Enterprise Server (GH
99100
- Add a changelog note announcing the new minimum version of CodeQL that is now required.
100101
- Example PR: https://github.com/github/codeql-action/pull/1907
101102

102-
## Deprecating a CodeQL Action version (write access required)
103+
## Adding a new CodeQL Action major version
103104

104105
We sometimes maintain multiple versions of the CodeQL Action to enable customers on older but still supported versions of GitHub Enterprise Server (GHES) to continue to benefit from the latest CodeQL improvements. To accomplish this, the release process automation listens to updates to the release branch for the newest supported version. When this branch is updated, the release process automatically opens backport PRs to update the release branches for older versions.
105106

107+
To add a new major version of the Action:
108+
109+
1. Change the `version` field of `package.json` by running `npm version x.y.z` where `x` is the new major version, and `y` and `z` match the latest minor and patch versions of the last release.
110+
1. Update appropriate documentation to explain the reasoning behind the releases: see [the diff](https://github.com/github/codeql-action/pull/2677/commits/913d60579d4b560addf53ec3c493d491dd3c1378) in our last major version deprecation for examples on which parts of the documentation should be updated.
111+
1. Consider the timeline behind deprecating the prior Action version: see [CodeQL Action deprecation documentation](#deprecating-a-codeql-action-major-version-write-access-required)
112+
113+
## Deprecating a CodeQL Action major version (write access required)
114+
106115
We typically deprecate older versions of the Action once all supported GHES versions are compatible with the version of Node.js we are using on `main`.
107116

108117
To deprecate an older version of the Action:

‎README.md

+1-10
Original file line numberDiff line numberDiff line change
@@ -63,27 +63,18 @@ For compiled languages:
6363
The following versions of the CodeQL Action are currently supported:
6464

6565
- v3 (latest)
66-
- v2 (deprecated, support will end on December 5th, 2024)
67-
68-
The only difference between CodeQL Action v2 and v3 is the version of Node.js on which they run. CodeQL Action v3 runs on Node 20, while CodeQL Action v2 runs on Node 16.
69-
70-
To provide the best experience to customers using older versions of GitHub Enterprise Server, we will continue to release CodeQL Action v2 so that these customers can continue to run the latest version of CodeQL as long as their version of GitHub Enterprise Server is supported. For example CodeQL Action v3.22.11 was the first release of CodeQL Action v3 and is functionally identical to v2.22.11. This approach provides an easy way to track exactly which features are included in different versions by looking at the minor and patch version numbers.
71-
72-
For more information, see "[Code scanning: deprecation of CodeQL Action v2](https://github.blog/changelog/2024-01-12-code-scanning-deprecation-of-codeql-action-v2/)."
7366

7467
## Supported versions of the CodeQL Bundle on GitHub Enterprise Server
7568

7669
We typically release new minor versions of the CodeQL Action and Bundle when a new minor version of GitHub Enterprise Server (GHES) is released. When a version of GHES is deprecated, the CodeQL Action and Bundle releases that shipped with it are deprecated as well.
7770

7871
| Minimum CodeQL Action | Minimum CodeQL Bundle Version | GitHub Environment | Notes |
7972
|-----------------------|-------------------------------|--------------------|-------|
80-
| `v3.26.6` | `2.18.4` | Enterprise Server 3.15 | |
73+
| `v3.26.6` | `2.18.4` | Enterprise Server 3.15 | |
8174
| `v3.25.11` | `2.17.6` | Enterprise Server 3.14 | |
8275
| `v3.24.11` | `2.16.6` | Enterprise Server 3.13 | |
8376
| `v3.22.12` | `2.15.5` | Enterprise Server 3.12 | |
8477

85-
CodeQL Action v2 has stopped receiving updates now that GHES 3.11 is deprecated.
86-
8778
See the full list of GHES release and deprecation dates at [GitHub Enterprise Server releases](https://docs.github.com/en/enterprise-server/admin/all-releases#releases-of-github-enterprise-server).
8879

8980
## Troubleshooting

‎lib/environment.js

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

‎lib/environment.js.map

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

‎lib/util.js

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

‎lib/util.js.map

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

‎lib/util.test.js

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

‎lib/util.test.js.map

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

‎src/environment.ts

+3
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ export enum EnvVar {
5050
/** Whether the init action has been run. */
5151
INIT_ACTION_HAS_RUN = "CODEQL_ACTION_INIT_HAS_RUN",
5252

53+
/** Whether the error for a deprecated version of the CodeQL Action was logged. */
54+
LOG_VERSION_DEPRECATION = "CODEQL_ACTION_DID_LOG_VERSION_DEPRECATION",
55+
5356
/**
5457
* For macOS. Result of `csrutil status` to determine whether System Integrity
5558
* Protection is enabled.

‎src/util.test.ts

+10-8
Original file line numberDiff line numberDiff line change
@@ -431,16 +431,16 @@ const CHECK_ACTION_VERSION_TESTS: Array<[string, util.GitHubVersion, boolean]> =
431431
for (const [
432432
version,
433433
githubVersion,
434-
shouldReportWarning,
434+
shouldReportError,
435435
] of CHECK_ACTION_VERSION_TESTS) {
436-
const reportWarningDescription = shouldReportWarning
437-
? "reports warning"
438-
: "doesn't report warning";
436+
const reportErrorDescription = shouldReportError
437+
? "reports error"
438+
: "doesn't report error";
439439
const versionsDescription = `CodeQL Action version ${version} and GitHub version ${formatGitHubVersion(
440440
githubVersion,
441441
)}`;
442-
test(`checkActionVersion ${reportWarningDescription} for ${versionsDescription}`, async (t) => {
443-
const warningSpy = sinon.spy(core, "warning");
442+
test(`checkActionVersion ${reportErrorDescription} for ${versionsDescription}`, async (t) => {
443+
const warningSpy = sinon.spy(core, "error");
444444
const versionStub = sinon
445445
.stub(api, "getGitHubVersion")
446446
.resolves(githubVersion);
@@ -449,10 +449,12 @@ for (const [
449449
util.checkActionVersion(version, await api.getGitHubVersion());
450450
util.checkActionVersion(version, await api.getGitHubVersion());
451451

452-
if (shouldReportWarning) {
452+
if (shouldReportError) {
453453
t.true(
454454
warningSpy.calledOnceWithExactly(
455-
sinon.match("CodeQL Action v2 will be deprecated"),
455+
sinon.match(
456+
"CodeQL Action major versions v1 and v2 have been deprecated.",
457+
),
456458
),
457459
);
458460
} else {

‎src/util.ts

+10-11
Original file line numberDiff line numberDiff line change
@@ -1071,19 +1071,18 @@ export async function checkDiskUsage(
10711071
/**
10721072
* Prompt the customer to upgrade to CodeQL Action v3, if appropriate.
10731073
*
1074-
* Check whether a customer is running v2. If they are, and we can determine that the GitHub
1075-
* instance supports v3, then log a warning about v2's upcoming deprecation prompting the customer
1076-
* to upgrade to v3.
1074+
* Check whether a customer is running v1 or v2. If they are, and we can determine that the GitHub
1075+
* instance supports v3, then log an error prompting the customer to upgrade to v3.
10771076
*/
10781077
export function checkActionVersion(
10791078
version: string,
10801079
githubVersion: GitHubVersion,
10811080
) {
10821081
if (
1083-
!semver.satisfies(version, ">=3") && // do not warn if the customer is already running v3
1084-
!process.env.CODEQL_V2_DEPRECATION_WARNING // do not warn if we have already warned
1082+
!semver.satisfies(version, ">=3") && // do not log error if the customer is already running v3
1083+
!process.env[EnvVar.LOG_VERSION_DEPRECATION] // do not log error if we have already
10851084
) {
1086-
// Only log a warning for versions of GHES that are compatible with CodeQL Action version 3.
1085+
// Only error for versions of GHES that are compatible with CodeQL Action version 3.
10871086
//
10881087
// GHES 3.11 shipped without the v3 tag, but it also shipped without this warning message code.
10891088
// Therefore users who are seeing this warning message code have pulled in a new version of the
@@ -1097,14 +1096,14 @@ export function checkActionVersion(
10971096
">=3.11",
10981097
))
10991098
) {
1100-
core.warning(
1101-
"CodeQL Action v2 will be deprecated on December 5th, 2024. " +
1099+
core.error(
1100+
"CodeQL Action major versions v1 and v2 have been deprecated. " +
11021101
"Please update all occurrences of the CodeQL Action in your workflow files to v3. " +
11031102
"For more information, see " +
1104-
"https://github.blog/changelog/2024-01-12-code-scanning-deprecation-of-codeql-action-v2/",
1103+
"https://github.blog/changelog/2025-01-10-code-scanning-codeql-action-v2-is-now-deprecated/",
11051104
);
1106-
// set CODEQL_V2_DEPRECATION_WARNING env var to prevent the warning from being logged multiple times
1107-
core.exportVariable("CODEQL_V2_DEPRECATION_WARNING", "true");
1105+
// set LOG_VERSION_DEPRECATION env var to prevent the warning from being logged multiple times
1106+
core.exportVariable(EnvVar.LOG_VERSION_DEPRECATION, "true");
11081107
}
11091108
}
11101109
}

0 commit comments

Comments
 (0)
Please sign in to comment.