Compare commits

...

157 Commits

Author SHA1 Message Date
Henry Mercer
dceb4dabff Bump version to 2.24.11 2024-05-15 14:38:52 +01:00
Henry Mercer
5f30722379 Update default bundle to codeql-bundle-v2.16.6 2024-05-15 14:38:22 +01:00
Chuan-kai Lin
ffd3158cb9 Merge pull request #2228 from github/backport-v2.24.10-4355270be
Merge releases/v3 into releases/v2
2024-04-05 10:06:57 -07:00
github-actions[bot]
82478fb458 Update checked-in dependencies 2024-04-05 16:45:18 +00:00
Chuan-kai Lin
2a96432c79 Resolve conflicts in codeql.ts 2024-04-05 09:11:43 -07:00
github-actions[bot]
93075ceec3 Update version and changelog for v2.24.10 2024-04-05 09:10:26 -07:00
github-actions[bot]
a023017ea9 Merge remote-tracking branch 'origin/releases/v3' into backport-v2.24.10-4355270be
# Conflicts:
#	lib/codeql.js
#	src/codeql.ts
2024-04-05 15:02:14 +00:00
github-actions[bot]
794eacf375 Revert "Update checked-in dependencies"
This reverts commit 61ddd48e03.
2024-04-05 15:02:13 +00:00
github-actions[bot]
a1559aa4a9 Revert "Update version and changelog for v2.24.9"
This reverts commit abca38cf8c.
2024-04-05 15:02:13 +00:00
Chuan-kai Lin
4355270be1 Merge pull request #2226 from github/update-v3.24.10-7df281f2f
Merge main into releases/v3
2024-04-05 07:59:34 -07:00
github-actions[bot]
3f041c51a5 Update changelog for v3.24.10 2024-04-05 14:03:20 +00:00
Angela P Wen
7df281f2fe Gracefully continue if createStatusReportBase throws (#2225)
Previously, we weren't catching any possible exceptions in `createStatusReportBase` and runs would fail if any of the telemetry sub-items threw exceptions. As telemetry should not block the analysis, we continue here even if the status report throws.
2024-04-04 15:26:14 -07:00
Angela P Wen
f421cda8e7 Run integration test PR checks nightly (#2222)
* Run integration test PR checks nightly

Scheduled for 5AM UTC. This will assist in catching bugs introduced with new runner images.

* Specify generated YAML indentations

For consistency with our non-autogenerated files and GitHub documentation, we should further indent items in lists (`sequence`).
2024-04-04 10:30:18 -07:00
Nick Fyson
5f535debfe Merge pull request #2221 from github/nickfyson/upload-logging
improve logging coverage during sarif upload
2024-04-04 17:30:55 +01:00
Chuan-kai Lin
278465cdfb Merge pull request #2219 from github/update-bundle/codeql-bundle-v2.17.0
Update default bundle to 2.17.0
2024-04-04 08:20:40 -07:00
Chuan-kai Lin
65e69c8a4b Merge branch 'main' into update-bundle/codeql-bundle-v2.17.0 2024-04-04 07:23:39 -07:00
nickfyson
c037115ddf clarify logging in response to pr review comments 2024-04-03 21:19:06 +01:00
nickfyson
d3c32a84cb fix test to respect updated logging behaviour 2024-04-03 21:04:50 +01:00
Nick Fyson
26540626a5 Merge branch 'main' into nickfyson/upload-logging 2024-04-03 20:54:58 +01:00
nickfyson
d3257627d7 fix linting error 2024-04-03 20:50:03 +01:00
nickfyson
978bdd643f fix test that runs flakily locally 2024-04-03 20:43:26 +01:00
Nick Fyson
2cc8bbd0e0 Apply suggestions from code review
Co-authored-by: Henry Mercer <henrymercer@github.com>
2024-04-03 20:42:48 +01:00
Henry Mercer
3bd9c3e65c Merge pull request #2220 from github/update-supported-enterprise-server-versions
Update supported GitHub Enterprise Server versions
2024-04-03 18:06:05 +01:00
Henry Mercer
dcf00b3fd4 Account for varying major version number in error message 2024-04-03 15:50:23 +01:00
Henry Mercer
f8dd543c81 Add changelog note 2024-04-03 15:48:31 +01:00
nickfyson
6514cbb626 improve logging coverage when uploaing sarif files 2024-04-03 15:45:28 +01:00
Henry Mercer
f06c933b16 Update soon to be deprecated CodeQL version 2024-04-03 15:44:00 +01:00
Henry Mercer
eda4878a3d Only pass --new-analysis-summary if it is not default behavior 2024-04-03 15:39:22 +01:00
github-actions[bot]
eeaea14a62 Update supported GitHub Enterprise Server versions 2024-04-03 00:11:45 +00:00
github-actions[bot]
ec214df87a Add changelog note 2024-04-02 19:07:27 +00:00
github-actions[bot]
f4936c4c20 Update default bundle to codeql-bundle-v2.17.0 2024-04-02 19:07:23 +00:00
Angela P Wen
99c9897648 Merge pull request #2217 from github/dependabot/npm_and_yarn/npm-eb3e2c410b
Bump the npm group with 2 updates
2024-04-01 11:55:51 -07:00
github-actions[bot]
d7c4cc360c Update checked-in dependencies 2024-04-01 17:45:06 +00:00
dependabot[bot]
048b508a9d Bump the npm group with 2 updates
Bumps the npm group with 2 updates: [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) and [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser).


Updates `@typescript-eslint/eslint-plugin` from 7.3.1 to 7.4.0
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.4.0/packages/eslint-plugin)

Updates `@typescript-eslint/parser` from 7.3.1 to 7.4.0
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.4.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-01 17:43:33 +00:00
Koen Vlaswinkel
84ba7fb56d Merge pull request #2199 from github/koesie10/cli-sarif-merge
Use `github merge-results` command for merging SARIF files
2024-03-27 14:39:20 +01:00
Koen Vlaswinkel
016720d81f Refactor areAllRunsProducedByCodeQL to use Array.every 2024-03-26 11:09:44 +01:00
Koen Vlaswinkel
f835435c19 Rename run to uploadArtifacts 2024-03-26 11:05:21 +01:00
Koen Vlaswinkel
58194bf81a Do not require debug mode for debugging uploads 2024-03-26 11:05:04 +01:00
Koen Vlaswinkel
82b82e58c0 Only upload combined SARIF files when env var is set 2024-03-25 10:15:42 +01:00
Koen Vlaswinkel
3c4b8bc120 Change log levels 2024-03-25 10:15:37 +01:00
Koen Vlaswinkel
a0a63a2dd4 Do not try merging a single SARIF file 2024-03-25 10:15:16 +01:00
Koen Vlaswinkel
3bd271cec3 Introduce areAllRunsProducedByCodeQL function 2024-03-25 10:14:59 +01:00
Koen Vlaswinkel
70aa50b057 Use runTool for mergeResults 2024-03-25 10:13:21 +01:00
Koen Vlaswinkel
6ac57535de Use options object instead of boolean for mergeResults 2024-03-25 10:13:15 +01:00
Koen Vlaswinkel
e20c273295 Use supportsFeature check for merging SARIF files 2024-03-22 14:15:42 +01:00
Koen Vlaswinkel
2bbafcdd7f Upload debug artifacts for upload-sarif 2024-03-22 14:15:17 +01:00
Koen Vlaswinkel
7e30c622b0 Use subdirectory for combined SARIF file 2024-03-22 14:15:16 +01:00
Koen Vlaswinkel
ccc609bf1a Use github merge-results command when feature flag is enabled 2024-03-22 14:15:00 +01:00
Koen Vlaswinkel
a12b868bbc Create feature flag for merging SARIF files using the CLI 2024-03-22 14:14:44 +01:00
Arthur Baars
a82bad7182 Merge pull request #2210 from github/backport-v2.24.9-1b1aada46
Merge releases/v3 into releases/v2
2024-03-22 12:05:51 +01:00
github-actions[bot]
61ddd48e03 Update checked-in dependencies 2024-03-22 10:40:56 +00:00
github-actions[bot]
abca38cf8c Update version and changelog for v2.24.9 2024-03-22 10:37:25 +00:00
github-actions[bot]
763babe7ac Merge remote-tracking branch 'origin/releases/v3' into backport-v2.24.9-1b1aada46 2024-03-22 10:37:20 +00:00
github-actions[bot]
72d46cb780 Revert "Update checked-in dependencies"
This reverts commit f018a9586e.
2024-03-22 10:37:20 +00:00
github-actions[bot]
0b21c947c0 Revert "Update version and changelog for v2.24.8"
This reverts commit 6007966519.
2024-03-22 10:37:20 +00:00
Henry Mercer
c2dc67199a Merge pull request #2202 from github/backport-v2.24.8-05963f47d
Merge releases/v3 into releases/v2
2024-03-18 15:29:52 +00:00
github-actions[bot]
f018a9586e Update checked-in dependencies 2024-03-18 15:12:05 +00:00
github-actions[bot]
6007966519 Update version and changelog for v2.24.8 2024-03-18 15:12:02 +00:00
Henry Mercer
efed72eb8f Remove duplicate header 2024-03-18 15:10:38 +00:00
github-actions[bot]
bcca54f232 Merge remote-tracking branch 'origin/releases/v3' into backport-v2.24.8-05963f47d 2024-03-18 13:57:49 +00:00
github-actions[bot]
76d48637f2 Revert "Update checked-in dependencies"
This reverts commit 6046c633c7.
2024-03-18 13:57:49 +00:00
github-actions[bot]
4821ae1424 Revert "Update version and changelog for v2.24.7"
This reverts commit 570dc010e8.
2024-03-18 13:57:49 +00:00
Angela P Wen
e56cfd0877 Merge pull request #2194 from github/backport-v2.24.7-3ab410190
Merge releases/v3 into releases/v2
2024-03-12 11:24:48 -07:00
github-actions[bot]
6046c633c7 Update checked-in dependencies 2024-03-12 17:53:59 +00:00
Angela P Wen
ed2b6b741f Manually fix changelog latest version 2024-03-12 13:52:46 -04:00
github-actions[bot]
570dc010e8 Update version and changelog for v2.24.7 2024-03-12 17:49:48 +00:00
github-actions[bot]
1a8046c7f3 Merge remote-tracking branch 'origin/releases/v3' into backport-v2.24.7-3ab410190 2024-03-12 17:49:46 +00:00
github-actions[bot]
8c395e0c45 Revert "Update checked-in dependencies"
This reverts commit 2f52385615.
2024-03-12 17:49:46 +00:00
github-actions[bot]
de22b302a6 Revert "Update version and changelog for v2.24.6"
This reverts commit 272cd56763.
2024-03-12 17:49:45 +00:00
Angela P Wen
928ff8c822 Merge pull request #2180 from github/backport-v2.24.6-8a470fdda
Merge releases/v3 into releases/v2
2024-03-01 02:19:43 -08:00
github-actions[bot]
2f52385615 Update checked-in dependencies 2024-02-29 19:02:49 +00:00
Angela P Wen
272cd56763 Update version and changelog for v2.24.6 2024-02-29 19:02:49 +00:00
Angela P Wen
3839e215cc Merge remote-tracking branch 'origin/releases/v3' into backport-v2.24.6-8a470fdda 2024-02-29 19:02:44 +00:00
Angela P Wen
61f4d893e6 Revert "Update checked-in dependencies"
This reverts commit 045d9f3939.
2024-02-29 17:28:33 +00:00
Angela P Wen
30ad6c3d9e Revert "Update version and changelog for v2.24.5 - fixed"
This reverts commit a3c8eb3ab0.
2024-02-29 17:28:33 +00:00
Nick Fyson
78df51c1cc Merge pull request #2167 from github/nickfyson/fix-v2-changelog-history 2024-02-23 18:07:21 +00:00
github-actions[bot]
045d9f3939 Update checked-in dependencies 2024-02-23 14:57:36 +00:00
nickfyson
a3c8eb3ab0 Update version and changelog for v2.24.5 - fixed 2024-02-23 14:54:56 +00:00
github-actions[bot]
6078595fdf Update checked-in dependencies 2024-02-23 14:48:52 +00:00
nickfyson
395cdfe20c restore conflict-free state with head v3 branch 2024-02-23 14:39:06 +00:00
Chris Smowton
a56a03b370 Merge pull request #2166 from github/backport-v2.24.5-633baf86c
Merge releases/v3 into releases/v2
2024-02-23 10:56:40 +00:00
github-actions[bot]
05053827ef Update checked-in dependencies 2024-02-23 10:38:04 +00:00
Nick Fyson
fa5685c7f0 fix the mergeback changelog 2024-02-23 10:36:52 +00:00
github-actions[bot]
8c3591c19a Update version and changelog for v2.24.5 2024-02-23 10:28:27 +00:00
github-actions[bot]
557a8d2306 Merge remote-tracking branch 'origin/releases/v3' into backport-v2.24.5-633baf86c 2024-02-23 10:28:27 +00:00
github-actions[bot]
7351df07bb Revert "Update checked-in dependencies"
This reverts commit b882b63a68.
2024-02-23 10:28:27 +00:00
github-actions[bot]
d15fdd879b Revert "Update version and changelog for v2.24.4"
This reverts commit 8b0f3e6135.
2024-02-23 10:28:26 +00:00
Nick Fyson
80eb8d5395 Merge pull request #2159 from github/backport-v2.24.4-e2e140ad1
Merge releases/v3 into releases/v2
2024-02-22 13:47:24 +00:00
Nick Fyson
0ddabac401 manually fix problem with changelog produced by automation 2024-02-22 12:45:43 +00:00
github-actions[bot]
b882b63a68 Update checked-in dependencies 2024-02-22 12:00:01 +00:00
github-actions[bot]
8b0f3e6135 Update version and changelog for v2.24.4 2024-02-22 10:38:34 +00:00
github-actions[bot]
8601b9e70a Merge remote-tracking branch 'origin/releases/v3' into backport-v2.24.4-e2e140ad1 2024-02-22 10:38:31 +00:00
github-actions[bot]
bd94b4c175 Revert "Update checked-in dependencies"
This reverts commit 460939e7d8.
2024-02-22 10:38:31 +00:00
github-actions[bot]
755340a6bd Revert "Update version and changelog for v2.24.3"
This reverts commit 47c8d615ed.
2024-02-22 10:38:31 +00:00
Angela P Wen
4a8f20f6b9 Merge pull request #2150 from github/backport-v2.24.3-379614612
Merge releases/v3 into releases/v2
2024-02-15 05:14:12 -08:00
github-actions[bot]
460939e7d8 Update checked-in dependencies 2024-02-15 12:55:25 +00:00
Angela P Wen
ceebdeb9fa Manually fix changelog notes 2024-02-15 12:53:40 +00:00
github-actions[bot]
47c8d615ed Update version and changelog for v2.24.3 2024-02-15 12:47:29 +00:00
github-actions[bot]
c232c5de9c Merge remote-tracking branch 'origin/releases/v3' into backport-v2.24.3-379614612 2024-02-15 12:47:28 +00:00
github-actions[bot]
2452b7d8af Revert "Update checked-in dependencies"
This reverts commit 4f50fb3be5.
2024-02-15 12:47:28 +00:00
github-actions[bot]
4ffed09d48 Revert "Update version and changelog for v2.24.2"
This reverts commit 02022337ac.
2024-02-15 12:47:27 +00:00
Angela P Wen
8b6a45a6ec Merge pull request #2144 from github/backport-v2.24.2-ece8414c7
Merge releases/v3 into releases/v2
2024-02-15 03:34:09 -08:00
Henry Mercer
2ccdcd5135 Remove duplicate changelog entry 2024-02-15 11:11:50 +00:00
github-actions[bot]
4f50fb3be5 Update checked-in dependencies 2024-02-15 11:10:16 +00:00
Henry Mercer
02022337ac Update version and changelog for v2.24.2 2024-02-15 11:08:37 +00:00
Henry Mercer
3dafabe4d9 Merge remote-tracking branch 'origin/releases/v3' into backport-v2.24.2-ece8414c7 2024-02-15 11:08:04 +00:00
Henry Mercer
40cd785140 Revert "Update checked-in dependencies"
This reverts commit 05d809f630.
2024-02-15 11:07:08 +00:00
Henry Mercer
10746dd61e Revert "Update version and changelog for v2.24.1"
This reverts commit d8c4c3a4eb.
2024-02-15 11:07:08 +00:00
Dave Bartolomeo
1a077f8f6c Merge pull request #2133 from github/backport-v2.24.1-e675ced7a
Merge releases/v3 into releases/v2
2024-02-13 07:50:23 -08:00
github-actions[bot]
05d809f630 Update checked-in dependencies 2024-02-13 15:32:00 +00:00
Henry Mercer
d8c4c3a4eb Update version and changelog for v2.24.1 2024-02-13 15:28:16 +00:00
Henry Mercer
b301568384 Merge remote-tracking branch 'origin/releases/v3' into backport-v2.24.1-e675ced7a 2024-02-13 15:28:12 +00:00
Henry Mercer
f5c8be0ac1 Revert "Update checked-in dependencies"
This reverts commit f822fa3067.
2024-02-13 15:23:47 +00:00
Henry Mercer
4504810aa1 Revert "Update version and changelog for v2.24.0"
This reverts commit 3ed798ed18.
2024-02-13 15:23:47 +00:00
Henry Mercer
dc021d495c Merge pull request #2115 from github/backport-v2.24.0-e8893c57a
Merge releases/v3 into releases/v2
2024-02-02 19:23:13 +00:00
github-actions[bot]
f822fa3067 Update checked-in dependencies 2024-02-02 18:37:21 +00:00
github-actions[bot]
3ed798ed18 Update version and changelog for v2.24.0 2024-02-02 18:32:37 +00:00
github-actions[bot]
5b498ba405 Merge remote-tracking branch 'origin/releases/v3' into backport-v2.24.0-e8893c57a 2024-02-02 18:32:36 +00:00
github-actions[bot]
7dde705407 Revert "Update checked-in dependencies"
This reverts commit c98f2c953c.
2024-02-02 18:32:36 +00:00
github-actions[bot]
c004a3e831 Revert "Update version and changelog for v2.23.2"
This reverts commit 554c990fe8.
2024-02-02 18:32:36 +00:00
Henry Mercer
2f93e4319b Merge pull request #2102 from github/backport-v2.23.2-b7bf0a3ed
Merge releases/v3 into releases/v2
2024-01-26 15:16:55 +00:00
github-actions[bot]
c98f2c953c Update checked-in dependencies 2024-01-26 14:39:53 +00:00
github-actions[bot]
554c990fe8 Update version and changelog for v2.23.2 2024-01-26 14:35:10 +00:00
github-actions[bot]
abe5934e80 Merge remote-tracking branch 'origin/releases/v3' into backport-v2.23.2-b7bf0a3ed 2024-01-26 14:35:04 +00:00
github-actions[bot]
8879ae88d9 Revert "Update checked-in dependencies"
This reverts commit 554005d264.
2024-01-26 14:35:04 +00:00
github-actions[bot]
01e8d7f881 Revert "Update version and changelog for v2.23.1"
This reverts commit fb29452d38.
2024-01-26 14:35:04 +00:00
Henry Mercer
4759df8df7 Merge pull request #2091 from github/backport-v2.23.1-0b21cf249
Merge releases/v3 into releases/v2
2024-01-17 17:39:22 +00:00
github-actions[bot]
554005d264 Update checked-in dependencies 2024-01-17 16:52:17 +00:00
github-actions[bot]
fb29452d38 Update version and changelog for v2.23.1 2024-01-17 16:25:35 +00:00
github-actions[bot]
13884cb7d7 Merge remote-tracking branch 'origin/releases/v3' into backport-v2.23.1-0b21cf249 2024-01-17 16:25:34 +00:00
github-actions[bot]
ac64986f93 Revert "Update checked-in dependencies"
This reverts commit e24bd8fed4.
2024-01-17 16:25:34 +00:00
github-actions[bot]
cdcacf8b4f Revert "Update version and changelog for v2.23.0"
This reverts commit 8f2682add5.
2024-01-17 16:25:34 +00:00
Henry Mercer
8b7fcbfac2 Merge pull request #2069 from github/backport-v2.23.0-e5f05b81d
Merge releases/v3 into releases/v2
2024-01-08 13:43:00 +00:00
github-actions[bot]
e24bd8fed4 Update checked-in dependencies 2024-01-08 13:12:16 +00:00
Henry Mercer
8f2682add5 Update version and changelog for v2.23.0 2024-01-08 13:05:17 +00:00
Henry Mercer
8f5ae1a11a Merge remote-tracking branch 'origin/releases/v3' into backport-v2.23.0-e5f05b81d 2024-01-08 13:04:05 +00:00
Henry Mercer
99d337aef5 Revert "Update checked-in dependencies"
This reverts commit d6286c6fdb.
2024-01-08 13:04:04 +00:00
Henry Mercer
997d889b5d Revert "Update version and changelog for v2.22.12"
This reverts commit 9c74de20cb.
2024-01-08 13:04:04 +00:00
Angela P Wen
1500a13138 Merge pull request #2054 from github/backport-v2.22.12-012739e50
* Bump the npm group with 4 updates

Bumps the npm group with 4 updates: [@octokit/types](https://github.com/octokit/types.ts), [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin), [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) and [typescript](https://github.com/Microsoft/TypeScript).


Updates `@octokit/types` from 12.3.0 to 12.4.0
- [Release notes](https://github.com/octokit/types.ts/releases)
- [Commits](https://github.com/octokit/types.ts/compare/v12.3.0...v12.4.0)

Updates `@typescript-eslint/eslint-plugin` from 6.13.2 to 6.14.0
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.14.0/packages/eslint-plugin)

Updates `@typescript-eslint/parser` from 6.13.2 to 6.14.0
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.14.0/packages/parser)

Updates `typescript` from 5.3.2 to 5.3.3
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v5.3.2...v5.3.3)

---
updated-dependencies:
- dependency-name: "@octokit/types"
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: npm
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update checked-in dependencies

* Update changelog and version after v3.22.11

* Update checked-in dependencies

* improve handling of changelog processing for backports

* change version numbers inside processing function as well

* Apply suggestions from code review

Co-authored-by: Henry Mercer <henry.mercer@me.com>

* rename regex for clarity

* preserve trailing whitespace when transforming CHANGELOG

* raise explicit exception if EOF found when looking for changelog sections

* add note on versioning approach to changelog

* Bump the npm group with 2 updates (#2045)

* Bump the npm group with 2 updates

Bumps the npm group with 2 updates: [eslint](https://github.com/eslint/eslint) and [eslint-plugin-import](https://github.com/import-js/eslint-plugin-import).


Updates `eslint` from 8.55.0 to 8.56.0
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.55.0...v8.56.0)

Updates `eslint-plugin-import` from 2.29.0 to 2.29.1
- [Release notes](https://github.com/import-js/eslint-plugin-import/releases)
- [Changelog](https://github.com/import-js/eslint-plugin-import/blob/main/CHANGELOG.md)
- [Commits](https://github.com/import-js/eslint-plugin-import/compare/v2.29.0...v2.29.1)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
- dependency-name: eslint-plugin-import
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update checked-in dependencies

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* clarify comment on versions in the changelog

* clarify comment on versions in the changelog

* Update default bundle to codeql-bundle-v2.15.5

* Add changelog note

* update required checks script to handle release branches

* add note about backporting check changes to v2 branch

* Fix type error

* Typecast `OLDEST_SUPPORTED_MAJOR_VERSION` when defined

* Update changelog for v3.22.12

* Revert "Update version and changelog for v2.22.11"

This reverts commit e763762131.

* Revert "Update checked-in dependencies"

This reverts commit 20d1a9b175.

* Update version and changelog for v2.22.12

* Update checked-in dependencies

* Resolve conflicts in v3->v2.22.12 merge

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Henry Mercer <henry.mercer@me.com>
Co-authored-by: Nick Fyson <nickfyson@github.com>
Co-authored-by: Aditya Sharad <6874315+adityasharad@users.noreply.github.com>
Co-authored-by: Angela P Wen <angelapwen@github.com>
Co-authored-by: Aditya Sharad <adityasharad@github.com>
2023-12-22 08:39:43 -08:00
Aditya Sharad
0d318c9f1a Resolve conflicts in v3->v2.22.12 merge 2023-12-22 06:58:29 -08:00
github-actions[bot]
d6286c6fdb Update checked-in dependencies 2023-12-22 04:01:00 +00:00
github-actions[bot]
9c74de20cb Update version and changelog for v2.22.12 2023-12-22 00:47:08 +00:00
github-actions[bot]
49a6ae4966 Merge remote-tracking branch 'origin/releases/v3' into backport-v2.22.12-012739e50
# Conflicts:
#	CONTRIBUTING.md
2023-12-22 00:47:04 +00:00
github-actions[bot]
3366e3bbdd Revert "Update checked-in dependencies"
This reverts commit 20d1a9b175.
2023-12-22 00:47:03 +00:00
github-actions[bot]
844fc3cd56 Revert "Update version and changelog for v2.22.11"
This reverts commit e763762131.
2023-12-22 00:47:03 +00:00
Nick Fyson
5a201efe22 Merge pull request #2048 from github/nickfyson/backport-js-checks 2023-12-20 19:21:03 +00:00
nickfyson
c9f92aa25f backport checks changes to v2 branch 2023-12-20 14:23:29 +00:00
Nick Fyson
03e7845b7b Merge pull request #2036 from github/backport-v2.22.11-b374143c1
Merge releases/v3 into releases/v2
2023-12-13 20:40:33 +00:00
github-actions[bot]
54f10077ea Rebuild 2023-12-13 20:11:03 +00:00
github-actions[bot]
20d1a9b175 Update checked-in dependencies 2023-12-13 20:08:43 +00:00
Nick Fyson
c28d79bb2e Update src/codeql.ts
Co-authored-by: Henry Mercer <henry.mercer@me.com>
2023-12-13 20:05:23 +00:00
nickfyson
241e8b42b2 Revert "switch check sarif action to node20"
This reverts commit 0bc194ee69.
2023-12-13 20:05:23 +00:00
nickfyson
8bc67d15e2 Revert "update javascript files"
This reverts commit 3a9f6a89e0.
2023-12-13 20:05:23 +00:00
nickfyson
e106171cbb Revert "reintroduce PR check that confirm action can be still be compiled on node16"
This reverts commit 5b52b36d41.
2023-12-13 20:05:23 +00:00
nickfyson
231f9f1b59 Revert "upgrade node type definitions"
This reverts commit f2d0c2e7ae.
2023-12-13 20:05:23 +00:00
nickfyson
47334bf4e9 Revert "change to node20 for all actions"
This reverts commit d651fbc494.
2023-12-13 20:05:23 +00:00
github-actions[bot]
e763762131 Update version and changelog for v2.22.11 2023-12-13 20:05:18 +00:00
330 changed files with 10080 additions and 64050 deletions

View File

@@ -16,5 +16,5 @@ inputs:
Comma separated list of query ids that should NOT be included in this SARIF file. Comma separated list of query ids that should NOT be included in this SARIF file.
runs: runs:
using: node20 using: node16
main: index.js main: index.js

View File

@@ -19,6 +19,8 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {} workflow_dispatch: {}
jobs: jobs:
all-platform-bundle: all-platform-bundle:

View File

@@ -19,6 +19,8 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {} workflow_dispatch: {}
jobs: jobs:
analyze-ref-input: analyze-ref-input:

View File

@@ -19,6 +19,8 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {} workflow_dispatch: {}
jobs: jobs:
autobuild-action: autobuild-action:

View File

@@ -19,6 +19,8 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {} workflow_dispatch: {}
jobs: jobs:
build-mode-autobuild: build-mode-autobuild:

View File

@@ -19,6 +19,8 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {} workflow_dispatch: {}
jobs: jobs:
build-mode-manual: build-mode-manual:

View File

@@ -19,6 +19,8 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {} workflow_dispatch: {}
jobs: jobs:
build-mode-none: build-mode-none:

View File

@@ -19,6 +19,8 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {} workflow_dispatch: {}
jobs: jobs:
build-mode-rollback: build-mode-rollback:

View File

@@ -19,6 +19,8 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {} workflow_dispatch: {}
jobs: jobs:
config-export: config-export:

View File

@@ -19,6 +19,8 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {} workflow_dispatch: {}
jobs: jobs:
config-input: config-input:

View File

@@ -19,6 +19,8 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {} workflow_dispatch: {}
jobs: jobs:
cpp-deptrace-disabled: cpp-deptrace-disabled:

View File

@@ -19,6 +19,8 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {} workflow_dispatch: {}
jobs: jobs:
cpp-deptrace-enabled-on-macos: cpp-deptrace-enabled-on-macos:

View File

@@ -19,6 +19,8 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {} workflow_dispatch: {}
jobs: jobs:
cpp-deptrace-enabled: cpp-deptrace-enabled:

View File

@@ -19,6 +19,8 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {} workflow_dispatch: {}
jobs: jobs:
diagnostics-export: diagnostics-export:

View File

@@ -19,6 +19,8 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {} workflow_dispatch: {}
jobs: jobs:
export-file-baseline-information: export-file-baseline-information:

View File

@@ -19,6 +19,8 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {} workflow_dispatch: {}
jobs: jobs:
extractor-ram-threads: extractor-ram-threads:

View File

@@ -19,6 +19,8 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {} workflow_dispatch: {}
jobs: jobs:
go-custom-queries: go-custom-queries:

View File

@@ -19,6 +19,8 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {} workflow_dispatch: {}
jobs: jobs:
go-indirect-tracing-workaround-diagnostic: go-indirect-tracing-workaround-diagnostic:

View File

@@ -19,6 +19,8 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {} workflow_dispatch: {}
jobs: jobs:
go-indirect-tracing-workaround: go-indirect-tracing-workaround:

View File

@@ -19,6 +19,8 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {} workflow_dispatch: {}
jobs: jobs:
go-tracing-autobuilder: go-tracing-autobuilder:

View File

@@ -19,6 +19,8 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {} workflow_dispatch: {}
jobs: jobs:
go-tracing-custom-build-steps: go-tracing-custom-build-steps:

View File

@@ -19,6 +19,8 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {} workflow_dispatch: {}
jobs: jobs:
go-tracing-legacy-workflow: go-tracing-legacy-workflow:

View File

@@ -19,6 +19,8 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {} workflow_dispatch: {}
jobs: jobs:
init-with-registries: init-with-registries:

View File

@@ -19,6 +19,8 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {} workflow_dispatch: {}
jobs: jobs:
javascript-source-root: javascript-source-root:

View File

@@ -19,6 +19,8 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {} workflow_dispatch: {}
jobs: jobs:
language-aliases: language-aliases:

View File

@@ -19,6 +19,8 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {} workflow_dispatch: {}
jobs: jobs:
multi-language-autodetect: multi-language-autodetect:

View File

@@ -19,6 +19,8 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {} workflow_dispatch: {}
jobs: jobs:
packaging-codescanning-config-inputs-js: packaging-codescanning-config-inputs-js:

View File

@@ -19,6 +19,8 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {} workflow_dispatch: {}
jobs: jobs:
packaging-config-inputs-js: packaging-config-inputs-js:

View File

@@ -19,6 +19,8 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {} workflow_dispatch: {}
jobs: jobs:
packaging-config-js: packaging-config-js:

View File

@@ -19,6 +19,8 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {} workflow_dispatch: {}
jobs: jobs:
packaging-inputs-js: packaging-inputs-js:

View File

@@ -19,6 +19,8 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {} workflow_dispatch: {}
jobs: jobs:
remote-config: remote-config:

View File

@@ -19,6 +19,8 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {} workflow_dispatch: {}
jobs: jobs:
resolve-environment-action: resolve-environment-action:

View File

@@ -19,6 +19,8 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {} workflow_dispatch: {}
jobs: jobs:
rubocop-multi-language: rubocop-multi-language:

2
.github/workflows/__ruby.yml generated vendored
View File

@@ -19,6 +19,8 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {} workflow_dispatch: {}
jobs: jobs:
ruby: ruby:

View File

@@ -19,6 +19,8 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {} workflow_dispatch: {}
jobs: jobs:
scaling-reserved-ram: scaling-reserved-ram:

View File

@@ -19,6 +19,8 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {} workflow_dispatch: {}
jobs: jobs:
split-workflow: split-workflow:

View File

@@ -19,6 +19,8 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {} workflow_dispatch: {}
jobs: jobs:
submit-sarif-failure: submit-sarif-failure:

View File

@@ -19,6 +19,8 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {} workflow_dispatch: {}
jobs: jobs:
swift-custom-build: swift-custom-build:

View File

@@ -19,6 +19,8 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {} workflow_dispatch: {}
jobs: jobs:
test-autobuild-working-dir: test-autobuild-working-dir:

View File

@@ -19,6 +19,8 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {} workflow_dispatch: {}
jobs: jobs:
test-local-codeql: test-local-codeql:

2
.github/workflows/__test-proxy.yml generated vendored
View File

@@ -19,6 +19,8 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {} workflow_dispatch: {}
jobs: jobs:
test-proxy: test-proxy:

View File

@@ -19,6 +19,8 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {} workflow_dispatch: {}
jobs: jobs:
unset-environment: unset-environment:

View File

@@ -19,6 +19,8 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {} workflow_dispatch: {}
jobs: jobs:
upload-ref-sha-input: upload-ref-sha-input:

View File

@@ -19,6 +19,8 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {} workflow_dispatch: {}
jobs: jobs:
with-checkout-path: with-checkout-path:

View File

@@ -15,6 +15,8 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {} workflow_dispatch: {}
jobs: jobs:

View File

@@ -17,6 +17,8 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {} workflow_dispatch: {}
jobs: jobs:
upload-artifacts: upload-artifacts:

View File

@@ -16,6 +16,8 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {} workflow_dispatch: {}
jobs: jobs:
upload-artifacts: upload-artifacts:

View File

@@ -11,6 +11,8 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {} workflow_dispatch: {}
jobs: jobs:

View File

@@ -17,7 +17,7 @@ jobs:
strategy: strategy:
matrix: matrix:
node-types-version: [16.11, current] # run tests on 16.11 while CodeQL Action v2 is still supported node-types-version: [16.11, current] # we backport this matrix job in order to maintain the same check names
steps: steps:
- name: Checkout - name: Checkout
@@ -49,6 +49,7 @@ jobs:
fi fi
- name: Check generated JS - name: Check generated JS
if: matrix.node-types-version != 'current' # we do not need to test the newer node on the v2 branch
run: .github/workflows/script/check-js.sh run: .github/workflows/script/check-js.sh
check-node-modules: check-node-modules:

View File

@@ -11,6 +11,8 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {} workflow_dispatch: {}
jobs: jobs:

View File

@@ -16,6 +16,8 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {} workflow_dispatch: {}
jobs: jobs:
test-codeql-bundle-all: test-codeql-bundle-all:

View File

@@ -4,73 +4,76 @@ See the [releases page](https://github.com/github/codeql-action/releases) for th
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. 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.
## [UNRELEASED] ## 2.24.10 - 05 Apr 2024
No user facing changes. - Update default CodeQL bundle version to 2.17.0. [#2219](https://github.com/github/codeql-action/pull/2219)
- Add a deprecation warning for customers using CodeQL version 2.12.5 and earlier. These versions of CodeQL were discontinued on 26 March 2024 alongside GitHub Enterprise Server 3.8, and will be unsupported by CodeQL Action versions 3.25.0 and later and versions 2.25.0 and later. [#2220](https://github.com/github/codeql-action/pull/2220)
- If you are using one of these versions, please update to CodeQL CLI version 2.12.6 or later. For instance, if you have specified a custom version of the CLI using the 'tools' input to the 'init' Action, you can remove this input to use the default version.
- Alternatively, if you want to continue using a version of the CodeQL CLI between 2.11.6 and 2.12.5, you can replace `github/codeql-action/*@v3` by `github/codeql-action/*@v3.24.10` and `github/codeql-action/*@v2` by `github/codeql-action/*@v2.24.10` in your code scanning workflow to ensure you continue using this version of the CodeQL Action.
## 3.24.9 - 22 Mar 2024 ## 2.24.9 - 22 Mar 2024
- Update default CodeQL bundle version to 2.16.5. [#2203](https://github.com/github/codeql-action/pull/2203) - Update default CodeQL bundle version to 2.16.5. [#2203](https://github.com/github/codeql-action/pull/2203)
## 3.24.8 - 18 Mar 2024 ## 2.24.8 - 18 Mar 2024
- Improve the ease of debugging extraction issues by increasing the verbosity of the extractor logs when running in debug mode. [#2195](https://github.com/github/codeql-action/pull/2195) - Improve the ease of debugging extraction issues by increasing the verbosity of the extractor logs when running in debug mode. [#2195](https://github.com/github/codeql-action/pull/2195)
## 3.24.7 - 12 Mar 2024 ## 2.24.7 - 12 Mar 2024
- Update default CodeQL bundle version to 2.16.4. [#2185](https://github.com/github/codeql-action/pull/2185) - Update default CodeQL bundle version to 2.16.4. [#2185](https://github.com/github/codeql-action/pull/2185)
## 3.24.6 - 29 Feb 2024 ## 2.24.6 - 29 Feb 2024
No user facing changes. No user facing changes.
## 3.24.5 - 23 Feb 2024 ## 2.24.5 - 23 Feb 2024
- Update default CodeQL bundle version to 2.16.3. [#2156](https://github.com/github/codeql-action/pull/2156) - Update default CodeQL bundle version to 2.16.3. [#2156](https://github.com/github/codeql-action/pull/2156)
## 3.24.4 - 21 Feb 2024 ## 2.24.4 - 21 Feb 2024
- Fix an issue where an existing, but empty, `/sys/fs/cgroup/cpuset.cpus` file always resulted in a single-threaded run. [#2151](https://github.com/github/codeql-action/pull/2151) - Fix an issue where an existing, but empty, `/sys/fs/cgroup/cpuset.cpus` file always resulted in a single-threaded run. [#2151](https://github.com/github/codeql-action/pull/2151)
## 3.24.3 - 15 Feb 2024 ## 2.24.3 - 15 Feb 2024
- Fix an issue where the CodeQL Action would fail to load a configuration specified by the `config` input to the `init` Action. [#2147](https://github.com/github/codeql-action/pull/2147) - Fix an issue where the CodeQL Action would fail to load a configuration specified by the `config` input to the `init` Action. [#2147](https://github.com/github/codeql-action/pull/2147)
## 3.24.2 - 15 Feb 2024 ## 2.24.2 - 15 Feb 2024
- Enable improved multi-threaded performance on larger runners for GitHub Enterprise Server users. This feature is already available to GitHub.com users. [#2141](https://github.com/github/codeql-action/pull/2141) - Enable improved multi-threaded performance on larger runners for GitHub Enterprise Server users. This feature is already available to GitHub.com users. [#2141](https://github.com/github/codeql-action/pull/2141)
## 3.24.1 - 13 Feb 2024 ## 2.24.1 - 13 Feb 2024
- Update default CodeQL bundle version to 2.16.2. [#2124](https://github.com/github/codeql-action/pull/2124) - Update default CodeQL bundle version to 2.16.2. [#2124](https://github.com/github/codeql-action/pull/2124)
- The CodeQL action no longer fails if it can't write to the telemetry api endpoint. [#2121](https://github.com/github/codeql-action/pull/2121) - The CodeQL action no longer fails if it can't write to the telemetry api endpoint. [#2121](https://github.com/github/codeql-action/pull/2121)
## 3.24.0 - 02 Feb 2024 ## 2.24.0 - 02 Feb 2024
- CodeQL Python analysis will no longer install dependencies on GitHub Enterprise Server, as is already the case for GitHub.com. See [release notes for 3.23.0](#3230---08-jan-2024) for more details. [#2106](https://github.com/github/codeql-action/pull/2106) - CodeQL Python analysis will no longer install dependencies on GitHub Enterprise Server, as is already the case for GitHub.com. See [release notes for 3.23.0](#3230---08-jan-2024) for more details. [#2106](https://github.com/github/codeql-action/pull/2106)
## 3.23.2 - 26 Jan 2024 ## 2.23.2 - 26 Jan 2024
- On Linux, the maximum possible value for the `--threads` option now respects the CPU count as specified in `cgroup` files to more accurately reflect the number of available cores when running in containers. [#2083](https://github.com/github/codeql-action/pull/2083) - On Linux, the maximum possible value for the `--threads` option now respects the CPU count as specified in `cgroup` files to more accurately reflect the number of available cores when running in containers. [#2083](https://github.com/github/codeql-action/pull/2083)
- Update default CodeQL bundle version to 2.16.1. [#2096](https://github.com/github/codeql-action/pull/2096) - Update default CodeQL bundle version to 2.16.1. [#2096](https://github.com/github/codeql-action/pull/2096)
## 3.23.1 - 17 Jan 2024 ## 2.23.1 - 17 Jan 2024
- Update default CodeQL bundle version to 2.16.0. [#2073](https://github.com/github/codeql-action/pull/2073) - Update default CodeQL bundle version to 2.16.0. [#2073](https://github.com/github/codeql-action/pull/2073)
- Change the retention period for uploaded debug artifacts to 7 days. Previously, this was whatever the repository default was. [#2079](https://github.com/github/codeql-action/pull/2079) - Change the retention period for uploaded debug artifacts to 7 days. Previously, this was whatever the repository default was. [#2079](https://github.com/github/codeql-action/pull/2079)
## 3.23.0 - 08 Jan 2024 ## 2.23.0 - 08 Jan 2024
- We are rolling out a feature in January 2024 that will disable Python dependency installation by default for all users. This improves the speed of analysis while having only a very minor impact on results. You can override this behavior by setting `CODEQL_ACTION_DISABLE_PYTHON_DEPENDENCY_INSTALLATION=false` in your workflow, however we plan to remove this ability in future versions of the CodeQL Action. [#2031](https://github.com/github/codeql-action/pull/2031) - We are rolling out a feature in January 2024 that will disable Python dependency installation by default for all users. This improves the speed of analysis while having only a very minor impact on results. You can override this behavior by setting `CODEQL_ACTION_DISABLE_PYTHON_DEPENDENCY_INSTALLATION=false` in your workflow, however we plan to remove this ability in future versions of the CodeQL Action. [#2031](https://github.com/github/codeql-action/pull/2031)
- The CodeQL Action now requires CodeQL version 2.11.6 or later. For more information, see [the corresponding changelog entry for CodeQL Action version 2.22.7](#2227---16-nov-2023). [#2009](https://github.com/github/codeql-action/pull/2009) - The CodeQL Action now requires CodeQL version 2.11.6 or later. For more information, see [the corresponding changelog entry for CodeQL Action version 2.22.7](#2227---16-nov-2023). [#2009](https://github.com/github/codeql-action/pull/2009)
## 3.22.12 - 22 Dec 2023 ## 2.22.12 - 22 Dec 2023
- Update default CodeQL bundle version to 2.15.5. [#2047](https://github.com/github/codeql-action/pull/2047) - Update default CodeQL bundle version to 2.15.5. [#2047](https://github.com/github/codeql-action/pull/2047)
## 3.22.11 - 13 Dec 2023 ## 2.22.11 - 13 Dec 2023
- [v3+ only] The CodeQL Action now runs on Node.js v20. [#2006](https://github.com/github/codeql-action/pull/2006) No user facing changes.
## 2.22.10 - 12 Dec 2023 ## 2.22.10 - 12 Dec 2023

View File

@@ -86,6 +86,6 @@ outputs:
sarif-id: sarif-id:
description: The ID of the uploaded SARIF file. description: The ID of the uploaded SARIF file.
runs: runs:
using: node20 using: node16
main: "../lib/analyze-action.js" main: "../lib/analyze-action.js"
post: "../lib/analyze-action-post.js" post: "../lib/analyze-action-post.js"

View File

@@ -15,5 +15,5 @@ inputs:
$GITHUB_WORKSPACE as its working directory. $GITHUB_WORKSPACE as its working directory.
required: false required: false
runs: runs:
using: node20 using: node16
main: '../lib/autobuild-action.js' main: '../lib/autobuild-action.js'

View File

@@ -134,6 +134,6 @@ outputs:
codeql-path: codeql-path:
description: The path of the CodeQL binary used for analysis description: The path of the CodeQL binary used for analysis
runs: runs:
using: node20 using: node16
main: '../lib/init-action.js' main: '../lib/init-action.js'
post: '../lib/init-action-post.js' post: '../lib/init-action-post.js'

View File

@@ -227,7 +227,9 @@ const util_1 = require("./util");
const infoStub = sinon.stub(core, "info"); const infoStub = sinon.stub(core, "info");
process.env["GITHUB_EVENT_NAME"] = "pull_request"; process.env["GITHUB_EVENT_NAME"] = "pull_request";
process.env["GITHUB_SHA"] = "100912429fab4cb230e66ffb11e738ac5194e73a"; process.env["GITHUB_SHA"] = "100912429fab4cb230e66ffb11e738ac5194e73a";
await actionsUtil.determineMergeBaseCommitOid(path.join(__dirname, "../..")); await (0, util_1.withTmpDir)(async (tmpDir) => {
await actionsUtil.determineMergeBaseCommitOid(tmpDir);
});
t.deepEqual(1, infoStub.callCount); t.deepEqual(1, infoStub.callCount);
t.assert(infoStub.firstCall.args[0].startsWith("The checkout path provided to the action does not appear to be a git repository.")); t.assert(infoStub.firstCall.args[0].startsWith("The checkout path provided to the action does not appear to be a git repository."));
infoStub.restore(); infoStub.restore();

File diff suppressed because one or more lines are too long

View File

@@ -31,10 +31,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
const core = __importStar(require("@actions/core")); const core = __importStar(require("@actions/core"));
const analyzeActionPostHelper = __importStar(require("./analyze-action-post-helper")); const analyzeActionPostHelper = __importStar(require("./analyze-action-post-helper"));
const debugArtifacts = __importStar(require("./debug-artifacts")); const debugArtifacts = __importStar(require("./debug-artifacts"));
const uploadSarifActionPostHelper = __importStar(require("./upload-sarif-action-post-helper"));
const util_1 = require("./util"); const util_1 = require("./util");
async function runWrapper() { async function runWrapper() {
try { try {
await analyzeActionPostHelper.run(debugArtifacts.uploadSarifDebugArtifact); await analyzeActionPostHelper.run(debugArtifacts.uploadSarifDebugArtifact);
// Also run the upload-sarif post action since we're potentially running
// the same steps in the analyze action.
await uploadSarifActionPostHelper.uploadArtifacts(debugArtifacts.uploadDebugArtifacts);
} }
catch (error) { catch (error) {
core.setFailed(`analyze post-action step failed: ${(0, util_1.wrapError)(error).message}`); core.setFailed(`analyze post-action step failed: ${(0, util_1.wrapError)(error).message}`);

View File

@@ -1 +1 @@
{"version":3,"file":"analyze-action-post.js","sourceRoot":"","sources":["../src/analyze-action-post.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;GAIG;AACH,oDAAsC;AAEtC,sFAAwE;AACxE,kEAAoD;AACpD,iCAAmC;AAEnC,KAAK,UAAU,UAAU;IACvB,IAAI,CAAC;QACH,MAAM,uBAAuB,CAAC,GAAG,CAAC,cAAc,CAAC,wBAAwB,CAAC,CAAC;IAC7E,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,SAAS,CACZ,oCAAoC,IAAA,gBAAS,EAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAC/D,CAAC;IACJ,CAAC;AACH,CAAC;AAED,KAAK,UAAU,EAAE,CAAC"} {"version":3,"file":"analyze-action-post.js","sourceRoot":"","sources":["../src/analyze-action-post.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;GAIG;AACH,oDAAsC;AAEtC,sFAAwE;AACxE,kEAAoD;AACpD,+FAAiF;AACjF,iCAAmC;AAEnC,KAAK,UAAU,UAAU;IACvB,IAAI,CAAC;QACH,MAAM,uBAAuB,CAAC,GAAG,CAAC,cAAc,CAAC,wBAAwB,CAAC,CAAC;QAE3E,wEAAwE;QACxE,wCAAwC;QACxC,MAAM,2BAA2B,CAAC,eAAe,CAC/C,cAAc,CAAC,oBAAoB,CACpC,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,SAAS,CACZ,oCAAoC,IAAA,gBAAS,EAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAC/D,CAAC;IACJ,CAAC;AACH,CAAC;AAED,KAAK,UAAU,EAAE,CAAC"}

7
lib/analyze-action.js generated
View File

@@ -51,6 +51,7 @@ const util = __importStar(require("./util"));
async function sendStatusReport(startedAt, config, stats, error, trapCacheUploadTime, dbCreationTimings, didUploadTrapCaches, logger) { async function sendStatusReport(startedAt, config, stats, error, trapCacheUploadTime, dbCreationTimings, didUploadTrapCaches, logger) {
const status = (0, status_report_1.getActionsStatus)(error, stats?.analyze_failure_language); const status = (0, status_report_1.getActionsStatus)(error, stats?.analyze_failure_language);
const statusReportBase = await (0, status_report_1.createStatusReportBase)(status_report_1.ActionName.Analyze, status, startedAt, config, await util.checkDiskUsage(), logger, error?.message, error?.stack); const statusReportBase = await (0, status_report_1.createStatusReportBase)(status_report_1.ActionName.Analyze, status, startedAt, config, await util.checkDiskUsage(), logger, error?.message, error?.stack);
if (statusReportBase !== undefined) {
const report = { const report = {
...statusReportBase, ...statusReportBase,
...(stats || {}), ...(stats || {}),
@@ -68,6 +69,7 @@ async function sendStatusReport(startedAt, config, stats, error, trapCacheUpload
await statusReport.sendStatusReport(report); await statusReport.sendStatusReport(report);
} }
} }
}
// `expect-error` should only be set to a non-false value by the CodeQL Action PR checks. // `expect-error` should only be set to a non-false value by the CodeQL Action PR checks.
function hasBadExpectErrorInput() { function hasBadExpectErrorInput() {
return (actionsUtil.getOptionalInput("expect-error") !== "false" && return (actionsUtil.getOptionalInput("expect-error") !== "false" &&
@@ -145,7 +147,10 @@ async function run() {
util.initializeEnvironment(actionsUtil.getActionVersion()); util.initializeEnvironment(actionsUtil.getActionVersion());
const logger = (0, logging_1.getActionsLogger)(); const logger = (0, logging_1.getActionsLogger)();
try { try {
await statusReport.sendStatusReport(await (0, status_report_1.createStatusReportBase)(status_report_1.ActionName.Analyze, "starting", startedAt, config, await util.checkDiskUsage(logger), logger)); const statusReportBase = await (0, status_report_1.createStatusReportBase)(status_report_1.ActionName.Analyze, "starting", startedAt, config, await util.checkDiskUsage(logger), logger);
if (statusReportBase !== undefined) {
await statusReport.sendStatusReport(statusReportBase);
}
config = await (0, config_utils_1.getConfig)(actionsUtil.getTemporaryDirectory(), logger); config = await (0, config_utils_1.getConfig)(actionsUtil.getTemporaryDirectory(), logger);
if (config === undefined) { if (config === undefined) {
throw new Error("Config file could not be found at expected location. Has the 'init' action been called?"); throw new Error("Config file could not be found at expected location. Has the 'init' action been called?");

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
{ "maximumVersion": "3.13", "minimumVersion": "3.8" } { "maximumVersion": "3.13", "minimumVersion": "3.9" }

View File

@@ -37,6 +37,7 @@ async function sendCompletedStatusReport(config, logger, startedAt, allLanguages
(0, util_1.initializeEnvironment)((0, actions_util_1.getActionVersion)()); (0, util_1.initializeEnvironment)((0, actions_util_1.getActionVersion)());
const status = (0, status_report_1.getActionsStatus)(cause, failingLanguage); const status = (0, status_report_1.getActionsStatus)(cause, failingLanguage);
const statusReportBase = await (0, status_report_1.createStatusReportBase)(status_report_1.ActionName.Autobuild, status, startedAt, config, await (0, util_1.checkDiskUsage)(logger), logger, cause?.message, cause?.stack); const statusReportBase = await (0, status_report_1.createStatusReportBase)(status_report_1.ActionName.Autobuild, status, startedAt, config, await (0, util_1.checkDiskUsage)(logger), logger, cause?.message, cause?.stack);
if (statusReportBase !== undefined) {
const statusReport = { const statusReport = {
...statusReportBase, ...statusReportBase,
autobuild_languages: allLanguages.join(","), autobuild_languages: allLanguages.join(","),
@@ -44,6 +45,7 @@ async function sendCompletedStatusReport(config, logger, startedAt, allLanguages
}; };
await (0, status_report_1.sendStatusReport)(statusReport); await (0, status_report_1.sendStatusReport)(statusReport);
} }
}
async function run() { async function run() {
const startedAt = new Date(); const startedAt = new Date();
const logger = (0, logging_1.getActionsLogger)(); const logger = (0, logging_1.getActionsLogger)();
@@ -51,7 +53,10 @@ async function run() {
let currentLanguage; let currentLanguage;
let languages; let languages;
try { try {
await (0, status_report_1.sendStatusReport)(await (0, status_report_1.createStatusReportBase)(status_report_1.ActionName.Autobuild, "starting", startedAt, config, await (0, util_1.checkDiskUsage)(logger), logger)); const statusReportBase = await (0, status_report_1.createStatusReportBase)(status_report_1.ActionName.Autobuild, "starting", startedAt, config, await (0, util_1.checkDiskUsage)(logger), logger);
if (statusReportBase !== undefined) {
await (0, status_report_1.sendStatusReport)(statusReportBase);
}
const gitHubVersion = await (0, api_client_1.getGitHubVersion)(); const gitHubVersion = await (0, api_client_1.getGitHubVersion)();
(0, util_1.checkGitHubVersionInRange)(gitHubVersion, logger); (0, util_1.checkGitHubVersionInRange)(gitHubVersion, logger);
(0, util_1.checkActionVersion)((0, actions_util_1.getActionVersion)(), gitHubVersion); (0, util_1.checkActionVersion)((0, actions_util_1.getActionVersion)(), gitHubVersion);

View File

@@ -1 +1 @@
{"version":3,"file":"autobuild-action.js","sourceRoot":"","sources":["../src/autobuild-action.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAsC;AAEtC,iDAIwB;AACxB,6CAAgD;AAChD,2CAAwE;AACxE,qCAAqC;AACrC,iDAAmD;AACnD,+CAAuC;AAEvC,uCAAqD;AACrD,mDAMyB;AACzB,iCAMgB;AAShB,KAAK,UAAU,yBAAyB,CACtC,MAA0B,EAC1B,MAAc,EACd,SAAe,EACf,YAAsB,EACtB,eAAwB,EACxB,KAAa;IAEb,IAAA,4BAAqB,EAAC,IAAA,+BAAgB,GAAE,CAAC,CAAC;IAE1C,MAAM,MAAM,GAAG,IAAA,gCAAgB,EAAC,KAAK,EAAE,eAAe,CAAC,CAAC;IACxD,MAAM,gBAAgB,GAAG,MAAM,IAAA,sCAAsB,EACnD,0BAAU,CAAC,SAAS,EACpB,MAAM,EACN,SAAS,EACT,MAAM,EACN,MAAM,IAAA,qBAAc,EAAC,MAAM,CAAC,EAC5B,MAAM,EACN,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,KAAK,CACb,CAAC;IACF,MAAM,YAAY,GAA0B;QAC1C,GAAG,gBAAgB;QACnB,mBAAmB,EAAE,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC;QAC3C,iBAAiB,EAAE,eAAe;KACnC,CAAC;IACF,MAAM,IAAA,gCAAgB,EAAC,YAAY,CAAC,CAAC;AACvC,CAAC;AAED,KAAK,UAAU,GAAG;IAChB,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC;IAC7B,MAAM,MAAM,GAAG,IAAA,0BAAgB,GAAE,CAAC;IAClC,IAAI,MAA0B,CA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;YAC/C,CAAC;QACH,CAAC;IACH,CAAC;IAAC,OAAO,cAAc,EAAE,CAAC;QACxB,MAAM,KAAK,GAAG,IAAA,gBAAS,EAAC,cAAc,CAAC,CAAC;QACxC,IAAI,CAAC,SAAS,CACZ,kIAAkI,KAAK,CAAC,OAAO,EAAE,CAClJ,CAAC;QACF,MAAM,yBAAyB,CAC7B,MAAM,EACN,MAAM,EACN,SAAS,EACT,SAAS,IAAI,EAAE,EACf,eAAe,EACf,KAAK,CACN,CAAC;QACF,OAAO;IACT,CAAC;IAED,IAAI,CAAC,cAAc,CAAC,oBAAM,CAAC,mCAAmC,EAAE,MAAM,CAAC,CAAC;IAExE,MAAM,yBAAyB,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,IAAI,EAAE,CAAC,CAAC;AAC9E,CAAC;AAED,KAAK,UAAU,UAAU;IACvB,IAAI,CAAC;QACH,MAAM,GAAG,EAAE,CAAC;IACd,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,SAAS,CAAC,4BAA4B,IAAA,gBAAS,EAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;IACzE,CAAC;AACH,CAAC;AAED,KAAK,UAAU,EAAE,CAAC"} {"version":3,"file":"autobuild-action.js","sourceRoot":"","sources":["../src/autobuild-action.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAsC;AAEtC,iDAIwB;AACxB,6CAAgD;AAChD,2CAAwE;AACxE,qCAAqC;AACrC,iDAAmD;AACnD,+CAAuC;AAEvC,uCAAqD;AACrD,mDAMyB;AACzB,iCAMgB;AAShB,KAAK,UAAU,yBAAyB,CACtC,MAA0B,EAC1B,MAAc,EACd,SAAe,EACf,YAAsB,EACtB,eAAwB,EACxB,KAAa;IAEb,IAAA,4BAAqB,EAAC,IAAA,+BAAgB,GAAE,CAAC,CAAC;IAE1C,MAAM,MAAM,GAAG,IAAA,gCAAgB,EAAC,KAAK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CAAC,CAAC;AAC9E,CAAC;AAED,KAAK,UAAU,UAAU;IACvB,IAAI,CAAC;QACH,MAAM,GAAG,EAAE,CAAC;IACd,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,SAAS,CAAC,4BAA4B,IAAA,gBAAS,EAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;IACzE,CAAC;AACH,CAAC;AAED,KAAK,UAAU,EAAE,CAAC"}

37
lib/codeql.js generated
View File

@@ -56,15 +56,15 @@ const CODEQL_MINIMUM_VERSION = "2.11.6";
/** /**
* 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.11.6"; const CODEQL_NEXT_MINIMUM_VERSION = "2.12.6";
/** /**
* This is the version of GHES that was most recently deprecated. * This is the version of GHES that was most recently deprecated.
*/ */
const GHES_VERSION_MOST_RECENTLY_DEPRECATED = "3.7"; const GHES_VERSION_MOST_RECENTLY_DEPRECATED = "3.8";
/** /**
* This is the deprecation date for the version of GHES that was most recently deprecated. * This is the deprecation date for the version of GHES that was most recently deprecated.
*/ */
const GHES_MOST_RECENT_DEPRECATION_DATE = "2023-11-08"; const GHES_MOST_RECENT_DEPRECATION_DATE = "2024-03-26";
/** The CLI verbosity level to use for extraction in debug mode. */ /** The CLI verbosity level to use for extraction in debug mode. */
const EXTRACTION_DEBUG_MODE_VERBOSITY = "progress++"; const EXTRACTION_DEBUG_MODE_VERBOSITY = "progress++";
/* /*
@@ -207,6 +207,7 @@ function setCodeQL(partialCodeql) {
databaseExportDiagnostics: resolveFunction(partialCodeql, "databaseExportDiagnostics"), databaseExportDiagnostics: resolveFunction(partialCodeql, "databaseExportDiagnostics"),
diagnosticsExport: resolveFunction(partialCodeql, "diagnosticsExport"), diagnosticsExport: resolveFunction(partialCodeql, "diagnosticsExport"),
resolveExtractor: resolveFunction(partialCodeql, "resolveExtractor"), resolveExtractor: resolveFunction(partialCodeql, "resolveExtractor"),
mergeResults: resolveFunction(partialCodeql, "mergeResults"),
}; };
return cachedCodeQL; return cachedCodeQL;
} }
@@ -502,17 +503,10 @@ async function getCodeQLForCmd(cmd, checkVersion) {
else if (await util.codeQlVersionAbove(this, "2.12.4")) { else if (await util.codeQlVersionAbove(this, "2.12.4")) {
codeqlArgs.push("--no-sarif-include-diagnostics"); codeqlArgs.push("--no-sarif-include-diagnostics");
} }
if ( if ((await util.codeQlVersionAbove(this, exports.CODEQL_VERSION_ANALYSIS_SUMMARY_V2)) &&
// Analysis summary v2 links to the status page, so check the GHES version we're running on !(0, tools_features_1.isSupportedToolsFeature)(await this.getVersion(), tools_features_1.ToolsFeature.AnalysisSummaryV2IsDefault)) {
// supports the status page.
(config.gitHubVersion.type !== util.GitHubVariant.GHES ||
semver.gte(config.gitHubVersion.version, "3.9.0")) &&
(await util.codeQlVersionAbove(this, exports.CODEQL_VERSION_ANALYSIS_SUMMARY_V2))) {
codeqlArgs.push("--new-analysis-summary"); codeqlArgs.push("--new-analysis-summary");
} }
else if (await util.codeQlVersionAbove(this, exports.CODEQL_VERSION_ANALYSIS_SUMMARY_V2)) {
codeqlArgs.push("--no-new-analysis-summary");
}
codeqlArgs.push(databasePath); codeqlArgs.push(databasePath);
if (querySuitePaths) { if (querySuitePaths) {
codeqlArgs.push(...querySuitePaths); codeqlArgs.push(...querySuitePaths);
@@ -664,6 +658,22 @@ async function getCodeQLForCmd(cmd, checkVersion) {
}).exec(); }).exec();
return JSON.parse(extractorPath); return JSON.parse(extractorPath);
}, },
async mergeResults(sarifFiles, outputFile, { mergeRunsFromEqualCategory = false, }) {
const args = [
"github",
"merge-results",
"--output",
outputFile,
...getExtraOptionsFromEnv(["github", "merge-results"]),
];
for (const sarifFile of sarifFiles) {
args.push("--sarif", sarifFile);
}
if (mergeRunsFromEqualCategory) {
args.push("--sarif-merge-runs-from-equal-category");
}
await runTool(cmd, args);
},
}; };
// To ensure that status reports include the CodeQL CLI version wherever // To ensure that status reports include the CodeQL CLI version wherever
// possible, we want to call getVersion(), which populates the version value // possible, we want to call getVersion(), which populates the version value
@@ -689,8 +699,7 @@ async function getCodeQLForCmd(cmd, checkVersion) {
"version of the CLI using the 'tools' input to the 'init' Action, you can remove this " + "version of the CLI using the 'tools' input to the 'init' Action, you can remove this " +
"input to use the default version.\n\n" + "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 " +
`${result.version}, you can replace 'github/codeql-action/*@v3' by ` + `${result.version}, you can replace 'github/codeql-action/*@v${(0, actions_util_1.getActionVersion)().split(".")[0]}' by 'github/codeql-action/*@v${(0, actions_util_1.getActionVersion)()}' in your code scanning workflow to ` +
`'github/codeql-action/*@v${(0, actions_util_1.getActionVersion)()}' in your code scanning workflow to ` +
"continue 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");
} }

File diff suppressed because one or more lines are too long

32
lib/codeql.test.js generated
View File

@@ -44,6 +44,7 @@ const languages_1 = require("./languages");
const logging_1 = require("./logging"); const logging_1 = require("./logging");
const setup_codeql_1 = require("./setup-codeql"); const setup_codeql_1 = require("./setup-codeql");
const testing_utils_1 = require("./testing-utils"); const testing_utils_1 = require("./testing-utils");
const tools_features_1 = require("./tools-features");
const util = __importStar(require("./util")); const util = __importStar(require("./util"));
const util_1 = require("./util"); const util_1 = require("./util");
(0, testing_utils_1.setupTests)(ava_1.default); (0, testing_utils_1.setupTests)(ava_1.default);
@@ -493,7 +494,17 @@ const injectedConfigMacro = ava_1.default.macro({
}); });
const NEW_ANALYSIS_SUMMARY_TEST_CASES = [ const NEW_ANALYSIS_SUMMARY_TEST_CASES = [
{ {
codeqlVersion: "2.15.0", codeqlVersion: (0, testing_utils_1.makeVersionInfo)("2.15.0", {
[tools_features_1.ToolsFeature.AnalysisSummaryV2IsDefault]: true,
}),
githubVersion: {
type: util.GitHubVariant.DOTCOM,
},
flagPassed: false,
negativeFlagPassed: false,
},
{
codeqlVersion: (0, testing_utils_1.makeVersionInfo)("2.15.0"),
githubVersion: { githubVersion: {
type: util.GitHubVariant.DOTCOM, type: util.GitHubVariant.DOTCOM,
}, },
@@ -501,7 +512,7 @@ const NEW_ANALYSIS_SUMMARY_TEST_CASES = [
negativeFlagPassed: false, negativeFlagPassed: false,
}, },
{ {
codeqlVersion: "2.15.0", codeqlVersion: (0, testing_utils_1.makeVersionInfo)("2.15.0"),
githubVersion: { githubVersion: {
type: util.GitHubVariant.GHES, type: util.GitHubVariant.GHES,
version: "3.9.0", version: "3.9.0",
@@ -510,16 +521,7 @@ const NEW_ANALYSIS_SUMMARY_TEST_CASES = [
negativeFlagPassed: false, negativeFlagPassed: false,
}, },
{ {
codeqlVersion: "2.15.0", codeqlVersion: (0, testing_utils_1.makeVersionInfo)("2.14.6"),
githubVersion: {
type: util.GitHubVariant.GHES,
version: "3.8.6",
},
flagPassed: false,
negativeFlagPassed: true,
},
{
codeqlVersion: "2.14.6",
githubVersion: { githubVersion: {
type: util.GitHubVariant.DOTCOM, type: util.GitHubVariant.DOTCOM,
}, },
@@ -532,12 +534,10 @@ for (const { codeqlVersion, flagPassed, githubVersion, negativeFlagPassed, } of
? "--new-analysis-summary" ? "--new-analysis-summary"
: negativeFlagPassed : negativeFlagPassed
? "--no-new-analysis-summary" ? "--no-new-analysis-summary"
: "nothing"} for CodeQL CLI v${codeqlVersion} and ${util.GitHubVariant[githubVersion.type]} ${githubVersion.version ? ` ${githubVersion.version}` : ""}`, async (t) => { : "nothing"} for CodeQL version ${JSON.stringify(codeqlVersion)} and ${util.GitHubVariant[githubVersion.type]} ${githubVersion.version ? ` ${githubVersion.version}` : ""}`, async (t) => {
const runnerConstructorStub = stubToolRunnerConstructor(); const runnerConstructorStub = stubToolRunnerConstructor();
const codeqlObject = await codeql.getCodeQLForTesting(); const codeqlObject = await codeql.getCodeQLForTesting();
sinon sinon.stub(codeqlObject, "getVersion").resolves(codeqlVersion);
.stub(codeqlObject, "getVersion")
.resolves((0, testing_utils_1.makeVersionInfo)(codeqlVersion));
// safeWhich throws because of the test CodeQL object. // safeWhich throws because of the test CodeQL object.
sinon.stub(safeWhich, "safeWhich").resolves(""); sinon.stub(safeWhich, "safeWhich").resolves("");
await codeqlObject.databaseInterpretResults("", [], "", "", "", "-v", "", Object.assign({}, stubConfig, { gitHubVersion: githubVersion }), (0, testing_utils_1.createFeatures)([]), (0, logging_1.getRunnerLogger)(true)); await codeqlObject.databaseInterpretResults("", [], "", "", "", "-v", "", Object.assign({}, stubConfig, { gitHubVersion: githubVersion }), (0, testing_utils_1.createFeatures)([]), (0, logging_1.getRunnerLogger)(true));

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,6 @@
{ {
"bundleVersion": "codeql-bundle-v2.16.5", "bundleVersion": "codeql-bundle-v2.16.6",
"cliVersion": "2.16.5", "cliVersion": "2.16.6",
"priorBundleVersion": "codeql-bundle-v2.16.4", "priorBundleVersion": "codeql-bundle-v2.16.5",
"priorCliVersion": "2.16.4" "priorCliVersion": "2.16.5"
} }

7
lib/feature-flags.js generated
View File

@@ -48,6 +48,7 @@ exports.CODEQL_VERSION_FINE_GRAINED_PARALLELISM = "2.15.1";
*/ */
var Feature; var Feature;
(function (Feature) { (function (Feature) {
Feature["CliSarifMerge"] = "cli_sarif_merge_enabled";
Feature["CppDependencyInstallation"] = "cpp_dependency_installation_enabled"; Feature["CppDependencyInstallation"] = "cpp_dependency_installation_enabled";
Feature["CppTrapCachingEnabled"] = "cpp_trap_caching_enabled"; Feature["CppTrapCachingEnabled"] = "cpp_trap_caching_enabled";
Feature["DisableJavaBuildlessEnabled"] = "disable_java_buildless_enabled"; Feature["DisableJavaBuildlessEnabled"] = "disable_java_buildless_enabled";
@@ -58,6 +59,12 @@ var Feature;
Feature["QaTelemetryEnabled"] = "qa_telemetry_enabled"; Feature["QaTelemetryEnabled"] = "qa_telemetry_enabled";
})(Feature || (exports.Feature = Feature = {})); })(Feature || (exports.Feature = Feature = {}));
exports.featureConfig = { exports.featureConfig = {
[Feature.CliSarifMerge]: {
envVar: "CODEQL_ACTION_CLI_SARIF_MERGE",
// This is guarded by a `supportsFeature` check rather than by a version check.
minimumVersion: undefined,
defaultValue: false,
},
[Feature.CppDependencyInstallation]: { [Feature.CppDependencyInstallation]: {
envVar: "CODEQL_EXTRACTOR_CPP_AUTOINSTALL_DEPENDENCIES", envVar: "CODEQL_EXTRACTOR_CPP_AUTOINSTALL_DEPENDENCIES",
minimumVersion: "2.15.0", minimumVersion: "2.15.0",

File diff suppressed because one or more lines are too long

1
lib/fingerprints.js generated
View File

@@ -238,6 +238,7 @@ exports.resolveUriToFile = resolveUriToFile;
// Compute fingerprints for results in the given sarif file // Compute fingerprints for results in the given sarif file
// and return an updated sarif file contents. // and return an updated sarif file contents.
async function addFingerprints(sarif, sourceRoot, logger) { async function addFingerprints(sarif, sourceRoot, logger) {
logger.info("Adding fingerprints to SARIF file. For more information, see https://docs.github.com/en/enterprise-cloud@latest/code-security/code-scanning/integrating-with-code-scanning/sarif-support-for-code-scanning#providing-data-to-track-code-scanning-alerts-across-runs");
// Gather together results for the same file and construct // Gather together results for the same file and construct
// callbacks to accept hashes for that file and update the location // callbacks to accept hashes for that file and update the location
const callbacksByFile = {}; const callbacksByFile = {};

File diff suppressed because one or more lines are too long

View File

@@ -59,12 +59,16 @@ async function runWrapper() {
catch (unwrappedError) { catch (unwrappedError) {
const error = (0, util_1.wrapError)(unwrappedError); const error = (0, util_1.wrapError)(unwrappedError);
core.setFailed(error.message); core.setFailed(error.message);
await (0, status_report_1.sendStatusReport)(await (0, status_report_1.createStatusReportBase)(status_report_1.ActionName.InitPost, (0, status_report_1.getActionsStatus)(error), startedAt, config, await (0, util_1.checkDiskUsage)(), logger, error.message, error.stack)); const statusReportBase = await (0, status_report_1.createStatusReportBase)(status_report_1.ActionName.InitPost, (0, status_report_1.getActionsStatus)(error), startedAt, config, await (0, util_1.checkDiskUsage)(), logger, error.message, error.stack);
if (statusReportBase !== undefined) {
await (0, status_report_1.sendStatusReport)(statusReportBase);
}
return; return;
} }
const jobStatus = initActionPostHelper.getFinalJobStatus(); const jobStatus = initActionPostHelper.getFinalJobStatus();
logger.info(`CodeQL job status was ${(0, status_report_1.getJobStatusDisplayName)(jobStatus)}.`); logger.info(`CodeQL job status was ${(0, status_report_1.getJobStatusDisplayName)(jobStatus)}.`);
const statusReportBase = await (0, status_report_1.createStatusReportBase)(status_report_1.ActionName.InitPost, "success", startedAt, config, await (0, util_1.checkDiskUsage)(), logger); const statusReportBase = await (0, status_report_1.createStatusReportBase)(status_report_1.ActionName.InitPost, "success", startedAt, config, await (0, util_1.checkDiskUsage)(), logger);
if (statusReportBase !== undefined) {
const statusReport = { const statusReport = {
...statusReportBase, ...statusReportBase,
...uploadFailedSarifResult, ...uploadFailedSarifResult,
@@ -72,5 +76,6 @@ async function runWrapper() {
}; };
await (0, status_report_1.sendStatusReport)(statusReport); await (0, status_report_1.sendStatusReport)(statusReport);
} }
}
void runWrapper(); void runWrapper();
//# sourceMappingURL=init-action-post.js.map //# sourceMappingURL=init-action-post.js.map

View File

@@ -1 +1 @@
{"version":3,"file":"init-action-post.js","sourceRoot":"","sources":["../src/init-action-post.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,oDAAsC;AAEtC,iDAAuE;AACvE,6CAAgD;AAChD,iDAAmD;AACnD,kEAAoD;AACpD,mDAA2C;AAC3C,gFAAkE;AAClE,uCAA6C;AAC7C,6CAAkD;AAClD,mDAOyB;AACzB,iCAKgB;AAOhB,KAAK,UAAU,UAAU;IACvB,MAAM,MAAM,GAAG,IAAA,0BAAgB,GAAE,CAAC;IAClC,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC;IAC7B,IAAI,MAA0B,CAAC;IAC/B,IAA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AAS,EAAE,CAAC;QACnC,MAAM,YAAY,GAAyB;YACzC,GAAG,gBAAgB;YACnB,GAAG,uBAAuB;YAC1B,UAAU,EAAE,oBAAoB,CAAC,iBAAiB,EAAE;SACrD,CAAC;QACF,MAAM,IAAA,gCAAgB,EAAC,YAAY,CAAC,CAAC;IACvC,CAAC;AACH,CAAC;AAED,KAAK,UAAU,EAAE,CAAC"}

13
lib/init-action.js generated
View File

@@ -44,6 +44,9 @@ const util_1 = require("./util");
const workflow_1 = require("./workflow"); const workflow_1 = require("./workflow");
async function sendCompletedStatusReport(startedAt, config, toolsDownloadDurationMs, toolsFeatureFlagsValid, toolsSource, toolsVersion, logger, error) { async function sendCompletedStatusReport(startedAt, config, toolsDownloadDurationMs, toolsFeatureFlagsValid, toolsSource, toolsVersion, logger, error) {
const statusReportBase = await (0, status_report_1.createStatusReportBase)(status_report_1.ActionName.Init, (0, status_report_1.getActionsStatus)(error), startedAt, config, await (0, util_1.checkDiskUsage)(logger), logger, error?.message, error?.stack); const statusReportBase = await (0, status_report_1.createStatusReportBase)(status_report_1.ActionName.Init, (0, status_report_1.getActionsStatus)(error), startedAt, config, await (0, util_1.checkDiskUsage)(logger), logger, error?.message, error?.stack);
if (statusReportBase === undefined) {
return;
}
const workflowLanguages = (0, actions_util_1.getOptionalInput)("languages"); const workflowLanguages = (0, actions_util_1.getOptionalInput)("languages");
const initStatusReport = { const initStatusReport = {
...statusReportBase, ...statusReportBase,
@@ -122,7 +125,10 @@ async function run() {
core.exportVariable(environment_1.EnvVar.JOB_RUN_UUID, (0, uuid_1.v4)()); core.exportVariable(environment_1.EnvVar.JOB_RUN_UUID, (0, uuid_1.v4)());
core.exportVariable(environment_1.EnvVar.INIT_ACTION_HAS_RUN, "true"); core.exportVariable(environment_1.EnvVar.INIT_ACTION_HAS_RUN, "true");
try { try {
await (0, status_report_1.sendStatusReport)(await (0, status_report_1.createStatusReportBase)(status_report_1.ActionName.Init, "starting", startedAt, config, await (0, util_1.checkDiskUsage)(logger), logger)); const statusReportBase = await (0, status_report_1.createStatusReportBase)(status_report_1.ActionName.Init, "starting", startedAt, config, await (0, util_1.checkDiskUsage)(logger), logger);
if (statusReportBase !== undefined) {
await (0, status_report_1.sendStatusReport)(statusReportBase);
}
const codeQLDefaultVersionInfo = await features.getDefaultCliVersion(gitHubVersion.type); const codeQLDefaultVersionInfo = await features.getDefaultCliVersion(gitHubVersion.type);
toolsFeatureFlagsValid = codeQLDefaultVersionInfo.toolsFeatureFlagsValid; toolsFeatureFlagsValid = codeQLDefaultVersionInfo.toolsFeatureFlagsValid;
const initCodeQLResult = await (0, init_1.initCodeQL)((0, actions_util_1.getOptionalInput)("tools"), apiDetails, (0, actions_util_1.getTemporaryDirectory)(), gitHubVersion.type, codeQLDefaultVersionInfo, logger); const initCodeQLResult = await (0, init_1.initCodeQL)((0, actions_util_1.getOptionalInput)("tools"), apiDetails, (0, actions_util_1.getTemporaryDirectory)(), gitHubVersion.type, codeQLDefaultVersionInfo, logger);
@@ -182,7 +188,10 @@ async function run() {
catch (unwrappedError) { catch (unwrappedError) {
const error = (0, util_1.wrapError)(unwrappedError); const error = (0, util_1.wrapError)(unwrappedError);
core.setFailed(error.message); core.setFailed(error.message);
await (0, status_report_1.sendStatusReport)(await (0, status_report_1.createStatusReportBase)(status_report_1.ActionName.Init, error instanceof util_1.ConfigurationError ? "user-error" : "aborted", startedAt, config, await (0, util_1.checkDiskUsage)(), logger, error.message, error.stack)); const statusReportBase = await (0, status_report_1.createStatusReportBase)(status_report_1.ActionName.Init, error instanceof util_1.ConfigurationError ? "user-error" : "aborted", startedAt, config, await (0, util_1.checkDiskUsage)(), logger, error.message, error.stack);
if (statusReportBase !== undefined) {
await (0, status_report_1.sendStatusReport)(statusReportBase);
}
return; return;
} }
try { try {

File diff suppressed because one or more lines are too long

View File

@@ -38,7 +38,10 @@ async function run() {
const logger = (0, logging_1.getActionsLogger)(); const logger = (0, logging_1.getActionsLogger)();
let config; let config;
try { try {
await (0, status_report_1.sendStatusReport)(await (0, status_report_1.createStatusReportBase)(status_report_1.ActionName.ResolveEnvironment, "starting", startedAt, config, await (0, util_1.checkDiskUsage)(), logger)); const statusReportBase = await (0, status_report_1.createStatusReportBase)(status_report_1.ActionName.ResolveEnvironment, "starting", startedAt, config, await (0, util_1.checkDiskUsage)(), logger);
if (statusReportBase !== undefined) {
await (0, status_report_1.sendStatusReport)(statusReportBase);
}
const gitHubVersion = await (0, api_client_1.getGitHubVersion)(); const gitHubVersion = await (0, api_client_1.getGitHubVersion)();
(0, util_1.checkGitHubVersionInRange)(gitHubVersion, logger); (0, util_1.checkGitHubVersionInRange)(gitHubVersion, logger);
(0, util_1.checkActionVersion)((0, actions_util_1.getActionVersion)(), gitHubVersion); (0, util_1.checkActionVersion)((0, actions_util_1.getActionVersion)(), gitHubVersion);
@@ -61,11 +64,17 @@ async function run() {
else { else {
// For any other error types, something has more seriously gone wrong and we fail. // For any other error types, something has more seriously gone wrong and we fail.
core.setFailed(`Failed to resolve a build environment suitable for automatically building your code. ${error.message}`); core.setFailed(`Failed to resolve a build environment suitable for automatically building your code. ${error.message}`);
await (0, status_report_1.sendStatusReport)(await (0, status_report_1.createStatusReportBase)(status_report_1.ActionName.ResolveEnvironment, (0, status_report_1.getActionsStatus)(error), startedAt, config, await (0, util_1.checkDiskUsage)(), logger, error.message, error.stack)); const statusReportBase = await (0, status_report_1.createStatusReportBase)(status_report_1.ActionName.ResolveEnvironment, (0, status_report_1.getActionsStatus)(error), startedAt, config, await (0, util_1.checkDiskUsage)(), logger, error.message, error.stack);
if (statusReportBase !== undefined) {
await (0, status_report_1.sendStatusReport)(statusReportBase);
}
} }
return; return;
} }
await (0, status_report_1.sendStatusReport)(await (0, status_report_1.createStatusReportBase)(status_report_1.ActionName.ResolveEnvironment, "success", startedAt, config, await (0, util_1.checkDiskUsage)(), logger)); const statusReportBase = await (0, status_report_1.createStatusReportBase)(status_report_1.ActionName.ResolveEnvironment, "success", startedAt, config, await (0, util_1.checkDiskUsage)(), logger);
if (statusReportBase !== undefined) {
await (0, status_report_1.sendStatusReport)(statusReportBase);
}
} }
async function runWrapper() { async function runWrapper() {
try { try {

View File

@@ -1 +1 @@
{"version":3,"file":"resolve-environment-action.js","sourceRoot":"","sources":["../src/resolve-environment-action.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAsC;AAEtC,iDAKwB;AACxB,6CAAgD;AAChD,6CAAsD;AACtD,iDAAmD;AACnD,uCAA6C;AAC7C,+DAAmE;AACnE,mDAKyB;AACzB,iCAMgB;AAEhB,MAAM,uBAAuB,GAAG,aAAa,CAAC;AAE9C,KAAK,UAAU,GAAG;IAChB,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC;IAC7B,MAAM,MAAM,GAAG,IAAA,0BAAgB,GAAE,CAAC;IAElC,IAAI,MAA0B,CAAC;IAE/B,IAAI,CAAC;QACH,MAAM,IAAA,gCAAgB,EACpB,MAAM,IAAA,sCAAsB,EAC1B,0BAAU,CAAC,kBAAkB,EAC7B,UAAU,EACV,SAAS,EACT,MAAM,EACN,MAAM,IAAA,qBAAc,GAAE,EACtB,MAAM,CACP,CACF,CAAC;QAEF,MAAM,aAAa,GAAG,MAAM,IAAA,6BAAgB,GAAE,CAAC;QAC/C,IAAA,gCAAyB,EAAC,aAAa,EAAE,MAAM,CAAC,CAAC;QACjD,IAAA,yBAAkB,EAAC,IAAA,+BAAgB,GAAE,EAAE,aAAa,CAAC,CAAC;QAEtD,MAAM,GAAG,MAAM,IAAA,wBAAS,EAAC,IAAA,oCAAqB,GAAE,EAAE,MAAM,CAAC,CAAC;QAC1D,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YACzB,MAAM,IAAI,KAAK,CACb,yFAAyF,CAC1F,CAAC;QACJ,CAAC;QAED,MAAM,gBAAgB,GAAG,IAAA,+BAAgB,EAAC,mBAAmB,CAAC,CAAC;QAC/D,MAAM,MAAM,GAAG,MAAM,IAAA,gDAA0B,EAC7C,MAAM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BAAS,EAAC,KAAK,CAAC,CAAC,OACnB,EAAE,CACH,CAAC;IACJ,CAAC;IACD,MAAM,IAAA,sBAAe,GAAE,CAAC;AAC1B,CAAC;AAED,KAAK,UAAU,EAAE,CAAC"} {"version":3,"file":"resolve-environment-action.js","sourceRoot":"","sources":["../src/resolve-environment-action.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAsC;AAEtC,iDAKwB;AACxB,6CAAgD;AAChD,6CAAsD;AACtD,iDAAmD;AACnD,uCAA6C;AAC7C,+DAAmE;AACnE,mDAKyB;AACzB,iCAMgB;AAEhB,MAAM,uBAAuB,GAAG,aAAa,CAAC;AAE9C,KAAK,UAAU,GAAG;IAChB,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC;IAC7B,MAAM,MAAM,GAAG,IAAA,0BAAgB,GAAE,CAAC;IAElC,IAAI,MAA0B,CAAC;IAE/B,IAAI,CAAC;QACH,MAAM,gBAAgB,GAAG,MAAM,IAAA,sCAAsB,EACnD,0BAAU,CAAC,kBAAkB,EAC7B,UAAU,EACV,SAAS,EACT,MAAM,EACN,MAAM,IAAA,qBAAc,GAAE,EACtB,MAAM,CACP,CAAC;QACF,IAAI,gBAAgB,KAAK,SAAS,EAAE,CAAC;YACnC,MAAM,IAAA,gCAAgB,EAAC,gBAAgB,CAAC,CAAC;QAC3C,CAAC;QAED,MAAM,aAAa,GAAG,MAAM,IAAA,6BAAgB,GAAE,CAAC;QAC/C,IAAA,gCAAyB,EAAC,aAAa,EAAE,MAAM,CAAC,CAAC;QACjD,IAAA,yBAAkB,EAAC,IAAA,+BAAgB,GAAE,EAAE,aAAa,CAAC,CAAC;QAEtD,MAAM,GAAG,MAAM,IAAA,wBAAS,EAAC,IAAA,oCAAqB,GAAE,EAAE,MAAM,CAAC,CAAC;QAC1D,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YACzB,MAAM,IAAI,KAAK,CACb,yFAAyF,CAC1F,CAAC;QACJ,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tB,MAAM,CACP,CAAC;IACF,IAAI,gBAAgB,KAAK,SAAS,EAAE,CAAC;QACnC,MAAM,IAAA,gCAAgB,EAAC,gBAAgB,CAAC,CAAC;IAC3C,CAAC;AACH,CAAC;AAED,KAAK,UAAU,UAAU;IACvB,IAAI,CAAC;QACH,MAAM,GAAG,EAAE,CAAC;IACd,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,SAAS,CACZ,GAAG,0BAAU,CAAC,kBAAkB,mBAC9B,IAAA,gBAAS,EAAC,KAAK,CAAC,CAAC,OACnB,EAAE,CACH,CAAC;IACJ,CAAC;IACD,MAAM,IAAA,sBAAe,GAAE,CAAC;AAC1B,CAAC;AAED,KAAK,UAAU,EAAE,CAAC"}

12
lib/status-report.js generated
View File

@@ -107,8 +107,10 @@ function setJobStatusIfUnsuccessful(actionStatus) {
* @param startedAt The time this action started executing. * @param startedAt The time this action started executing.
* @param cause Cause of failure (only supply if status is 'failure') * @param cause Cause of failure (only supply if status is 'failure')
* @param exception Exception (only supply if status is 'failure') * @param exception Exception (only supply if status is 'failure')
* @returns undefined if an exception was thrown.
*/ */
async function createStatusReportBase(actionName, status, actionStartedAt, config, diskInfo, logger, cause, exception) { async function createStatusReportBase(actionName, status, actionStartedAt, config, diskInfo, logger, cause, exception) {
try {
const commitOid = (0, actions_util_1.getOptionalInput)("sha") || process.env["GITHUB_SHA"] || ""; const commitOid = (0, actions_util_1.getOptionalInput)("sha") || process.env["GITHUB_SHA"] || "";
const ref = await (0, actions_util_1.getRef)(); const ref = await (0, actions_util_1.getRef)();
const jobRunUUID = process.env[environment_1.EnvVar.JOB_RUN_UUID] || ""; const jobRunUUID = process.env[environment_1.EnvVar.JOB_RUN_UUID] || "";
@@ -124,7 +126,7 @@ async function createStatusReportBase(actionName, status, actionStartedAt, confi
} }
const runnerOs = (0, util_1.getRequiredEnvParam)("RUNNER_OS"); const runnerOs = (0, util_1.getRequiredEnvParam)("RUNNER_OS");
const codeQlCliVersion = (0, util_1.getCachedCodeQlVersion)(); const codeQlCliVersion = (0, util_1.getCachedCodeQlVersion)();
const actionRef = process.env["GITHUB_ACTION_REF"]; const actionRef = process.env["GITHUB_ACTION_REF"] || "";
const testingEnvironment = process.env[environment_1.EnvVar.TESTING_ENVIRONMENT] || ""; const testingEnvironment = process.env[environment_1.EnvVar.TESTING_ENVIRONMENT] || "";
// re-export the testing environment variable so that it is available to subsequent steps, // re-export the testing environment variable so that it is available to subsequent steps,
// even if it was only set for this step // even if it was only set for this step
@@ -162,7 +164,8 @@ async function createStatusReportBase(actionName, status, actionStartedAt, confi
statusReport.languages = config.languages.join(","); statusReport.languages = config.languages.join(",");
} }
if (diskInfo) { if (diskInfo) {
statusReport.runner_available_disk_space_bytes = diskInfo.numAvailableBytes; statusReport.runner_available_disk_space_bytes =
diskInfo.numAvailableBytes;
statusReport.runner_total_disk_space_bytes = diskInfo.numTotalBytes; statusReport.runner_total_disk_space_bytes = diskInfo.numTotalBytes;
} }
// Add optional parameters // Add optional parameters
@@ -199,6 +202,11 @@ async function createStatusReportBase(actionName, status, actionStartedAt, confi
} }
return statusReport; return statusReport;
} }
catch (e) {
logger.warning(`Caught an exception while gathering information for telemetry: ${e}. Will skip sending status report.`);
return undefined;
}
}
exports.createStatusReportBase = createStatusReportBase; exports.createStatusReportBase = createStatusReportBase;
const OUT_OF_DATE_MSG = "CodeQL Action is out-of-date. Please upgrade to the latest version of codeql-action."; const OUT_OF_DATE_MSG = "CodeQL Action is out-of-date. Please upgrade to the latest version of codeql-action.";
const INCOMPATIBLE_MSG = "CodeQL Action version is incompatible with the code scanning endpoint. Please update to a compatible version of codeql-action."; const INCOMPATIBLE_MSG = "CodeQL Action version is incompatible with the code scanning endpoint. Please update to a compatible version of codeql-action.";

File diff suppressed because one or more lines are too long

View File

@@ -59,6 +59,8 @@ function setupEnvironmentAndStub(tmpDir) {
buildMode: config_utils_1.BuildMode.None, buildMode: config_utils_1.BuildMode.None,
languages: [languages_1.Language.java, languages_1.Language.swift], languages: [languages_1.Language.java, languages_1.Language.swift],
}), { numAvailableBytes: 100, numTotalBytes: 500 }, (0, logging_1.getRunnerLogger)(false), "failure cause", "exception stack trace"); }), { numAvailableBytes: 100, numTotalBytes: 500 }, (0, logging_1.getRunnerLogger)(false), "failure cause", "exception stack trace");
t.truthy(statusReport);
if (statusReport !== undefined) {
t.is(statusReport.action_name, status_report_1.ActionName.Init); t.is(statusReport.action_name, status_report_1.ActionName.Init);
t.is(statusReport.action_oid, "unknown"); t.is(statusReport.action_oid, "unknown");
t.is(typeof statusReport.action_version, "string"); t.is(typeof statusReport.action_version, "string");
@@ -81,19 +83,20 @@ function setupEnvironmentAndStub(tmpDir) {
t.is(statusReport.workflow_name, process.env["GITHUB_WORKFLOW"] || ""); t.is(statusReport.workflow_name, process.env["GITHUB_WORKFLOW"] || "");
t.is(statusReport.workflow_run_attempt, 2); t.is(statusReport.workflow_run_attempt, 2);
t.is(statusReport.workflow_run_id, 100); t.is(statusReport.workflow_run_id, 100);
}
}); });
}); });
(0, ava_1.default)("createStatusReportBase_firstParty", async (t) => { (0, ava_1.default)("createStatusReportBase_firstParty", async (t) => {
await (0, util_1.withTmpDir)(async (tmpDir) => { await (0, util_1.withTmpDir)(async (tmpDir) => {
setupEnvironmentAndStub(tmpDir); setupEnvironmentAndStub(tmpDir);
t.is((await (0, status_report_1.createStatusReportBase)(status_report_1.ActionName.UploadSarif, "failure", new Date("May 19, 2023 05:19:00"), (0, testing_utils_1.createTestConfig)({}), { numAvailableBytes: 100, numTotalBytes: 500 }, (0, logging_1.getRunnerLogger)(false), "failure cause", "exception stack trace")).first_party_analysis, false); t.is((await (0, status_report_1.createStatusReportBase)(status_report_1.ActionName.UploadSarif, "failure", new Date("May 19, 2023 05:19:00"), (0, testing_utils_1.createTestConfig)({}), { numAvailableBytes: 100, numTotalBytes: 500 }, (0, logging_1.getRunnerLogger)(false), "failure cause", "exception stack trace"))?.first_party_analysis, false);
t.is((await (0, status_report_1.createStatusReportBase)(status_report_1.ActionName.Autobuild, "failure", new Date("May 19, 2023 05:19:00"), (0, testing_utils_1.createTestConfig)({}), { numAvailableBytes: 100, numTotalBytes: 500 }, (0, logging_1.getRunnerLogger)(false), "failure cause", "exception stack trace")).first_party_analysis, true); t.is((await (0, status_report_1.createStatusReportBase)(status_report_1.ActionName.Autobuild, "failure", new Date("May 19, 2023 05:19:00"), (0, testing_utils_1.createTestConfig)({}), { numAvailableBytes: 100, numTotalBytes: 500 }, (0, logging_1.getRunnerLogger)(false), "failure cause", "exception stack trace"))?.first_party_analysis, true);
process.env["CODEQL_ACTION_INIT_HAS_RUN"] = "foobar"; process.env["CODEQL_ACTION_INIT_HAS_RUN"] = "foobar";
t.is((await (0, status_report_1.createStatusReportBase)(status_report_1.ActionName.UploadSarif, "failure", new Date("May 19, 2023 05:19:00"), (0, testing_utils_1.createTestConfig)({}), { numAvailableBytes: 100, numTotalBytes: 500 }, (0, logging_1.getRunnerLogger)(false), "failure cause", "exception stack trace")).first_party_analysis, false); t.is((await (0, status_report_1.createStatusReportBase)(status_report_1.ActionName.UploadSarif, "failure", new Date("May 19, 2023 05:19:00"), (0, testing_utils_1.createTestConfig)({}), { numAvailableBytes: 100, numTotalBytes: 500 }, (0, logging_1.getRunnerLogger)(false), "failure cause", "exception stack trace"))?.first_party_analysis, false);
t.is((await (0, status_report_1.createStatusReportBase)(status_report_1.ActionName.Init, "failure", new Date("May 19, 2023 05:19:00"), (0, testing_utils_1.createTestConfig)({}), { numAvailableBytes: 100, numTotalBytes: 500 }, (0, logging_1.getRunnerLogger)(false), "failure cause", "exception stack trace")).first_party_analysis, true); t.is((await (0, status_report_1.createStatusReportBase)(status_report_1.ActionName.Init, "failure", new Date("May 19, 2023 05:19:00"), (0, testing_utils_1.createTestConfig)({}), { numAvailableBytes: 100, numTotalBytes: 500 }, (0, logging_1.getRunnerLogger)(false), "failure cause", "exception stack trace"))?.first_party_analysis, true);
process.env["CODEQL_ACTION_INIT_HAS_RUN"] = "true"; process.env["CODEQL_ACTION_INIT_HAS_RUN"] = "true";
t.is((await (0, status_report_1.createStatusReportBase)(status_report_1.ActionName.UploadSarif, "failure", new Date("May 19, 2023 05:19:00"), (0, testing_utils_1.createTestConfig)({}), { numAvailableBytes: 100, numTotalBytes: 500 }, (0, logging_1.getRunnerLogger)(false), "failure cause", "exception stack trace")).first_party_analysis, true); t.is((await (0, status_report_1.createStatusReportBase)(status_report_1.ActionName.UploadSarif, "failure", new Date("May 19, 2023 05:19:00"), (0, testing_utils_1.createTestConfig)({}), { numAvailableBytes: 100, numTotalBytes: 500 }, (0, logging_1.getRunnerLogger)(false), "failure cause", "exception stack trace"))?.first_party_analysis, true);
t.is((await (0, status_report_1.createStatusReportBase)(status_report_1.ActionName.Analyze, "failure", new Date("May 19, 2023 05:19:00"), (0, testing_utils_1.createTestConfig)({}), { numAvailableBytes: 100, numTotalBytes: 500 }, (0, logging_1.getRunnerLogger)(false), "failure cause", "exception stack trace")).first_party_analysis, true); t.is((await (0, status_report_1.createStatusReportBase)(status_report_1.ActionName.Analyze, "failure", new Date("May 19, 2023 05:19:00"), (0, testing_utils_1.createTestConfig)({}), { numAvailableBytes: 100, numTotalBytes: 500 }, (0, logging_1.getRunnerLogger)(false), "failure cause", "exception stack trace"))?.first_party_analysis, true);
}); });
}); });
//# sourceMappingURL=status-report.test.js.map //# sourceMappingURL=status-report.test.js.map

File diff suppressed because one or more lines are too long

2
lib/tools-features.js generated
View File

@@ -3,11 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
exports.isSupportedToolsFeature = exports.ToolsFeature = void 0; exports.isSupportedToolsFeature = exports.ToolsFeature = void 0;
var ToolsFeature; var ToolsFeature;
(function (ToolsFeature) { (function (ToolsFeature) {
ToolsFeature["AnalysisSummaryV2IsDefault"] = "analysisSummaryV2Default";
ToolsFeature["BuildModeOption"] = "buildModeOption"; ToolsFeature["BuildModeOption"] = "buildModeOption";
ToolsFeature["IndirectTracingSupportsStaticBinaries"] = "indirectTracingSupportsStaticBinaries"; ToolsFeature["IndirectTracingSupportsStaticBinaries"] = "indirectTracingSupportsStaticBinaries";
ToolsFeature["InformsAboutUnsupportedPathFilters"] = "informsAboutUnsupportedPathFilters"; ToolsFeature["InformsAboutUnsupportedPathFilters"] = "informsAboutUnsupportedPathFilters";
ToolsFeature["SetsCodeqlRunnerEnvVar"] = "setsCodeqlRunnerEnvVar"; ToolsFeature["SetsCodeqlRunnerEnvVar"] = "setsCodeqlRunnerEnvVar";
ToolsFeature["TraceCommandUseBuildMode"] = "traceCommandUseBuildMode"; ToolsFeature["TraceCommandUseBuildMode"] = "traceCommandUseBuildMode";
ToolsFeature["SarifMergeRunsFromEqualCategory"] = "sarifMergeRunsFromEqualCategory";
})(ToolsFeature || (exports.ToolsFeature = ToolsFeature = {})); })(ToolsFeature || (exports.ToolsFeature = ToolsFeature = {}));
/** /**
* Determines if the given feature is supported by the CLI. * Determines if the given feature is supported by the CLI.

View File

@@ -1 +1 @@
{"version":3,"file":"tools-features.js","sourceRoot":"","sources":["../src/tools-features.ts"],"names":[],"mappings":";;;AAEA,IAAY,YAMX;AAND,WAAY,YAAY;IACtB,mDAAmC,CAAA;IACnC,+FAA+E,CAAA;IAC/E,yFAAyE,CAAA;IACzE,iEAAiD,CAAA;IACjD,qEAAqD,CAAA;AACvD,CAAC,EANW,YAAY,4BAAZ,YAAY,QAMvB;AAED;;;;;;GAMG;AACH,SAAgB,uBAAuB,CACrC,WAAwB,EACxB,OAAqB;IAErB,OAAO,CAAC,CAAC,WAAW,CAAC,QAAQ,IAAI,WAAW,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AACjE,CAAC;AALD,0DAKC"} {"version":3,"file":"tools-features.js","sourceRoot":"","sources":["../src/tools-features.ts"],"names":[],"mappings":";;;AAEA,IAAY,YAQX;AARD,WAAY,YAAY;IACtB,uEAAuD,CAAA;IACvD,mDAAmC,CAAA;IACnC,+FAA+E,CAAA;IAC/E,yFAAyE,CAAA;IACzE,iEAAiD,CAAA;IACjD,qEAAqD,CAAA;IACrD,mFAAmE,CAAA;AACrE,CAAC,EARW,YAAY,4BAAZ,YAAY,QAQvB;AAED;;;;;;GAMG;AACH,SAAgB,uBAAuB,CACrC,WAAwB,EACxB,OAAqB;IAErB,OAAO,CAAC,CAAC,WAAW,CAAC,QAAQ,IAAI,WAAW,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AACjE,CAAC;AALD,0DAKC"}

85
lib/upload-lib.js generated
View File

@@ -34,22 +34,31 @@ const core = __importStar(require("@actions/core"));
const file_url_1 = __importDefault(require("file-url")); const file_url_1 = __importDefault(require("file-url"));
const jsonschema = __importStar(require("jsonschema")); const jsonschema = __importStar(require("jsonschema"));
const actionsUtil = __importStar(require("./actions-util")); const actionsUtil = __importStar(require("./actions-util"));
const actions_util_1 = require("./actions-util");
const api = __importStar(require("./api-client")); const api = __importStar(require("./api-client"));
const api_client_1 = require("./api-client");
const codeql_1 = require("./codeql");
const config_utils_1 = require("./config-utils");
const environment_1 = require("./environment"); const environment_1 = require("./environment");
const feature_flags_1 = require("./feature-flags");
const fingerprints = __importStar(require("./fingerprints")); const fingerprints = __importStar(require("./fingerprints"));
const init_1 = require("./init");
const repository_1 = require("./repository"); const repository_1 = require("./repository");
const tools_features_1 = require("./tools-features");
const util = __importStar(require("./util")); const util = __importStar(require("./util"));
const util_1 = require("./util"); const util_1 = require("./util");
const GENERIC_403_MSG = "The repo on which this action is running has not opted-in to CodeQL code scanning."; const GENERIC_403_MSG = "The repo on which this action is running has not opted-in to CodeQL code scanning.";
const GENERIC_404_MSG = "The CodeQL code scanning feature is forbidden on this repository."; const GENERIC_404_MSG = "The CodeQL code scanning feature is forbidden on this repository.";
// Takes a list of paths to sarif files and combines them together, // Takes a list of paths to sarif files and combines them together,
// returning the contents of the combined sarif file. // returning the contents of the combined sarif file.
function combineSarifFiles(sarifFiles) { function combineSarifFiles(sarifFiles, logger) {
logger.info(`Loading SARIF file(s)`);
const combinedSarif = { const combinedSarif = {
version: null, version: null,
runs: [], runs: [],
}; };
for (const sarifFile of sarifFiles) { for (const sarifFile of sarifFiles) {
logger.debug(`Loading SARIF file: ${sarifFile}`);
const sarifObject = JSON.parse(fs.readFileSync(sarifFile, "utf8")); const sarifObject = JSON.parse(fs.readFileSync(sarifFile, "utf8"));
// Check SARIF version // Check SARIF version
if (combinedSarif.version === null) { if (combinedSarif.version === null) {
@@ -62,6 +71,65 @@ function combineSarifFiles(sarifFiles) {
} }
return combinedSarif; return combinedSarif;
} }
/**
* Checks whether all the runs in the given SARIF files were produced by CodeQL.
* @param sarifFiles The list of SARIF files to check.
*/
function areAllRunsProducedByCodeQL(sarifFiles) {
return sarifFiles.every((sarifFile) => {
const sarifObject = JSON.parse(fs.readFileSync(sarifFile, "utf8"));
return sarifObject.runs?.every((run) => run.tool?.driver?.name === "CodeQL");
});
}
// Takes a list of paths to sarif files and combines them together using the
// CLI `github merge-results` command when all SARIF files are produced by
// CodeQL. Otherwise, it will fall back to combining the files in the action.
// Returns the contents of the combined sarif file.
async function combineSarifFilesUsingCLI(sarifFiles, gitHubVersion, features, logger) {
logger.info("Combining SARIF files using the CodeQL CLI");
if (sarifFiles.length === 1) {
return JSON.parse(fs.readFileSync(sarifFiles[0], "utf8"));
}
if (!areAllRunsProducedByCodeQL(sarifFiles)) {
logger.debug("Not all SARIF files were produced by CodeQL. Merging files in the action.");
// If not, use the naive method of combining the files.
return combineSarifFiles(sarifFiles, logger);
}
// Initialize CodeQL, either by using the config file from the 'init' step,
// or by initializing it here.
let codeQL;
let tempDir = actionsUtil.getTemporaryDirectory();
const config = await (0, config_utils_1.getConfig)(tempDir, logger);
if (config !== undefined) {
codeQL = await (0, codeql_1.getCodeQL)(config.codeQLCmd);
tempDir = config.tempDir;
}
else {
logger.info("Initializing CodeQL since the 'init' Action was not called before this step.");
const apiDetails = {
auth: (0, actions_util_1.getRequiredInput)("token"),
externalRepoAuth: (0, actions_util_1.getOptionalInput)("external-repository-token"),
url: (0, util_1.getRequiredEnvParam)("GITHUB_SERVER_URL"),
apiURL: (0, util_1.getRequiredEnvParam)("GITHUB_API_URL"),
};
const codeQLDefaultVersionInfo = await features.getDefaultCliVersion(gitHubVersion.type);
const initCodeQLResult = await (0, init_1.initCodeQL)(undefined, // There is no tools input on the upload action
apiDetails, tempDir, gitHubVersion.type, codeQLDefaultVersionInfo, logger);
codeQL = initCodeQLResult.codeql;
}
if (!(await codeQL.supportsFeature(tools_features_1.ToolsFeature.SarifMergeRunsFromEqualCategory))) {
logger.warning("The CodeQL CLI does not support merging SARIF files. Merging files in the action.");
return combineSarifFiles(sarifFiles, logger);
}
const baseTempDir = path.resolve(tempDir, "combined-sarif");
fs.mkdirSync(baseTempDir, { recursive: true });
const outputDirectory = fs.mkdtempSync(path.resolve(baseTempDir, "output-"));
const outputFile = path.resolve(outputDirectory, "combined-sarif.sarif");
await codeQL.mergeResults(sarifFiles, outputFile, {
mergeRunsFromEqualCategory: true,
});
return JSON.parse(fs.readFileSync(outputFile, "utf8"));
}
// Populates the run.automationDetails.id field using the analysis_key and environment // Populates the run.automationDetails.id field using the analysis_key and environment
// and return an updated sarif file contents. // and return an updated sarif file contents.
function populateRunAutomationDetails(sarif, category, analysis_key, environment) { function populateRunAutomationDetails(sarif, category, analysis_key, environment) {
@@ -190,6 +258,7 @@ function countResultsInSarif(sarif) {
// Validates that the given file path refers to a valid SARIF file. // Validates that the given file path refers to a valid SARIF file.
// Throws an error if the file is invalid. // Throws an error if the file is invalid.
function validateSarifFileSchema(sarifFilePath, logger) { function validateSarifFileSchema(sarifFilePath, logger) {
logger.info(`Validating ${sarifFilePath}`);
let sarif; let sarif;
try { try {
sarif = JSON.parse(fs.readFileSync(sarifFilePath, "utf8")); sarif = JSON.parse(fs.readFileSync(sarifFilePath, "utf8"));
@@ -222,7 +291,8 @@ function validateSarifFileSchema(sarifFilePath, logger) {
exports.validateSarifFileSchema = validateSarifFileSchema; exports.validateSarifFileSchema = validateSarifFileSchema;
// buildPayload constructs a map ready to be uploaded to the API from the given // buildPayload constructs a map ready to be uploaded to the API from the given
// parameters, respecting the current mode and target GitHub instance version. // parameters, respecting the current mode and target GitHub instance version.
function buildPayload(commitOid, ref, analysisKey, analysisName, zippedSarif, workflowRunID, workflowRunAttempt, checkoutURI, environment, toolNames, mergeBaseCommitOid) { function buildPayload(commitOid, ref, analysisKey, analysisName, zippedSarif, workflowRunID, workflowRunAttempt, checkoutURI, environment, toolNames, mergeBaseCommitOid, logger) {
logger.info(`Combining SARIF files using CLI`);
const payloadObj = { const payloadObj = {
commit_oid: commitOid, commit_oid: commitOid,
ref, ref,
@@ -264,19 +334,26 @@ exports.buildPayload = buildPayload;
async function uploadFiles(sarifFiles, repositoryNwo, commitOid, ref, analysisKey, category, analysisName, workflowRunID, workflowRunAttempt, sourceRoot, environment, logger) { async function uploadFiles(sarifFiles, repositoryNwo, commitOid, ref, analysisKey, category, analysisName, workflowRunID, workflowRunAttempt, sourceRoot, environment, logger) {
logger.startGroup("Uploading results"); logger.startGroup("Uploading results");
logger.info(`Processing sarif files: ${JSON.stringify(sarifFiles)}`); logger.info(`Processing sarif files: ${JSON.stringify(sarifFiles)}`);
const gitHubVersion = await (0, api_client_1.getGitHubVersion)();
const features = new feature_flags_1.Features(gitHubVersion, repositoryNwo, actionsUtil.getTemporaryDirectory(), logger);
// Validate that the files we were asked to upload are all valid SARIF files // Validate that the files we were asked to upload are all valid SARIF files
for (const file of sarifFiles) { for (const file of sarifFiles) {
validateSarifFileSchema(file, logger); validateSarifFileSchema(file, logger);
} }
let sarif = combineSarifFiles(sarifFiles); let sarif = (await features.getValue(feature_flags_1.Feature.CliSarifMerge))
? await combineSarifFilesUsingCLI(sarifFiles, gitHubVersion, features, logger)
: combineSarifFiles(sarifFiles, logger);
sarif = await fingerprints.addFingerprints(sarif, sourceRoot, logger); sarif = await fingerprints.addFingerprints(sarif, sourceRoot, logger);
sarif = populateRunAutomationDetails(sarif, category, analysisKey, environment); sarif = populateRunAutomationDetails(sarif, category, analysisKey, environment);
const toolNames = util.getToolNames(sarif); const toolNames = util.getToolNames(sarif);
logger.debug(`Validating that each SARIF run has a unique category`);
validateUniqueCategory(sarif); validateUniqueCategory(sarif);
logger.debug(`Serializing SARIF for upload`);
const sarifPayload = JSON.stringify(sarif); const sarifPayload = JSON.stringify(sarif);
logger.debug(`Compressing serialized SARIF`);
const zippedSarif = zlib_1.default.gzipSync(sarifPayload).toString("base64"); const zippedSarif = zlib_1.default.gzipSync(sarifPayload).toString("base64");
const checkoutURI = (0, file_url_1.default)(sourceRoot); const checkoutURI = (0, file_url_1.default)(sourceRoot);
const payload = buildPayload(commitOid, ref, analysisKey, analysisName, zippedSarif, workflowRunID, workflowRunAttempt, checkoutURI, environment, toolNames, await actionsUtil.determineMergeBaseCommitOid()); const payload = buildPayload(commitOid, ref, analysisKey, analysisName, zippedSarif, workflowRunID, workflowRunAttempt, checkoutURI, environment, toolNames, await actionsUtil.determineMergeBaseCommitOid(), logger);
// Log some useful debug info about the info // Log some useful debug info about the info
const rawUploadSizeBytes = sarifPayload.length; const rawUploadSizeBytes = sarifPayload.length;
logger.debug(`Raw upload size: ${rawUploadSizeBytes} bytes`); logger.debug(`Raw upload size: ${rawUploadSizeBytes} bytes`);

File diff suppressed because one or more lines are too long

10
lib/upload-lib.test.js generated
View File

@@ -47,7 +47,7 @@ ava_1.default.beforeEach(() => {
}); });
(0, ava_1.default)("validate correct payload used for push, PR merge commit, and PR head", async (t) => { (0, ava_1.default)("validate correct payload used for push, PR merge commit, and PR head", async (t) => {
process.env["GITHUB_EVENT_NAME"] = "push"; process.env["GITHUB_EVENT_NAME"] = "push";
const pushPayload = uploadLib.buildPayload("commit", "refs/heads/master", "key", undefined, "", 1234, 1, "/opt/src", undefined, ["CodeQL", "eslint"], "mergeBaseCommit"); const pushPayload = uploadLib.buildPayload("commit", "refs/heads/master", "key", undefined, "", 1234, 1, "/opt/src", undefined, ["CodeQL", "eslint"], "mergeBaseCommit", (0, logging_1.getRunnerLogger)(true));
// Not triggered by a pull request // Not triggered by a pull request
t.falsy(pushPayload.base_ref); t.falsy(pushPayload.base_ref);
t.falsy(pushPayload.base_sha); t.falsy(pushPayload.base_sha);
@@ -55,11 +55,11 @@ ava_1.default.beforeEach(() => {
process.env["GITHUB_SHA"] = "commit"; process.env["GITHUB_SHA"] = "commit";
process.env["GITHUB_BASE_REF"] = "master"; process.env["GITHUB_BASE_REF"] = "master";
process.env["GITHUB_EVENT_PATH"] = `${__dirname}/../src/testdata/pull_request.json`; process.env["GITHUB_EVENT_PATH"] = `${__dirname}/../src/testdata/pull_request.json`;
const prMergePayload = uploadLib.buildPayload("commit", "refs/pull/123/merge", "key", undefined, "", 1234, 1, "/opt/src", undefined, ["CodeQL", "eslint"], "mergeBaseCommit"); const prMergePayload = uploadLib.buildPayload("commit", "refs/pull/123/merge", "key", undefined, "", 1234, 1, "/opt/src", undefined, ["CodeQL", "eslint"], "mergeBaseCommit", (0, logging_1.getRunnerLogger)(true));
// Uploads for a merge commit use the merge base // Uploads for a merge commit use the merge base
t.deepEqual(prMergePayload.base_ref, "refs/heads/master"); t.deepEqual(prMergePayload.base_ref, "refs/heads/master");
t.deepEqual(prMergePayload.base_sha, "mergeBaseCommit"); t.deepEqual(prMergePayload.base_sha, "mergeBaseCommit");
const prHeadPayload = uploadLib.buildPayload("headCommit", "refs/pull/123/head", "key", undefined, "", 1234, 1, "/opt/src", undefined, ["CodeQL", "eslint"], "mergeBaseCommit"); const prHeadPayload = uploadLib.buildPayload("headCommit", "refs/pull/123/head", "key", undefined, "", 1234, 1, "/opt/src", undefined, ["CodeQL", "eslint"], "mergeBaseCommit", (0, logging_1.getRunnerLogger)(true));
// Uploads for the head use the PR base // Uploads for the head use the PR base
t.deepEqual(prHeadPayload.base_ref, "refs/heads/master"); t.deepEqual(prHeadPayload.base_ref, "refs/heads/master");
t.deepEqual(prHeadPayload.base_sha, "f95f852bd8fca8fcc58a9a2d6c842781e32a215e"); t.deepEqual(prHeadPayload.base_sha, "f95f852bd8fca8fcc58a9a2d6c842781e32a215e");
@@ -192,8 +192,8 @@ ava_1.default.beforeEach(() => {
}; };
const sarifFile = `${__dirname}/../src/testdata/with-invalid-uri.sarif`; const sarifFile = `${__dirname}/../src/testdata/with-invalid-uri.sarif`;
uploadLib.validateSarifFileSchema(sarifFile, mockLogger); uploadLib.validateSarifFileSchema(sarifFile, mockLogger);
t.deepEqual(loggedMessages.length, 1); t.deepEqual(loggedMessages.length, 2);
t.deepEqual(loggedMessages[0], "Warning: 'not a valid URI' is not a valid URI in 'instance.runs[0].results[0].locations[0].physicalLocation.artifactLocation.uri'."); t.deepEqual(loggedMessages[1], "Warning: 'not a valid URI' is not a valid URI in 'instance.runs[0].results[0].locations[0].physicalLocation.artifactLocation.uri'.");
}); });
function createMockSarif(id, tool) { function createMockSarif(id, tool) {
return { return {

File diff suppressed because one or more lines are too long

55
lib/upload-sarif-action-post-helper.js generated Normal file
View File

@@ -0,0 +1,55 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.uploadArtifacts = void 0;
const fs = __importStar(require("fs"));
const path = __importStar(require("path"));
const core = __importStar(require("@actions/core"));
const actionsUtil = __importStar(require("./actions-util"));
async function uploadArtifacts(uploadDebugArtifacts) {
const tempDir = actionsUtil.getTemporaryDirectory();
// Upload Actions SARIF artifacts for debugging when environment variable is set
if (process.env["CODEQL_ACTION_DEBUG_COMBINED_SARIF"] === "true") {
core.info("Uploading available combined SARIF files as Actions debugging artifact...");
const baseTempDir = path.resolve(tempDir, "combined-sarif");
const toUpload = [];
if (fs.existsSync(baseTempDir)) {
const outputDirs = fs.readdirSync(baseTempDir);
for (const outputDir of outputDirs) {
const sarifFiles = fs
.readdirSync(path.resolve(baseTempDir, outputDir))
.filter((f) => f.endsWith(".sarif"));
for (const sarifFile of sarifFiles) {
toUpload.push(path.resolve(baseTempDir, outputDir, sarifFile));
}
}
}
if (toUpload.length > 0) {
await uploadDebugArtifacts(toUpload, baseTempDir, "upload-debug-artifacts");
}
}
}
exports.uploadArtifacts = uploadArtifacts;
//# sourceMappingURL=upload-sarif-action-post-helper.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"upload-sarif-action-post-helper.js","sourceRoot":"","sources":["../src/upload-sarif-action-post-helper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAE7B,oDAAsC;AAEtC,4DAA8C;AAEvC,KAAK,UAAU,eAAe,CACnC,oBAIkB;IAElB,MAAM,OAAO,GAAG,WAAW,CAAC,qBAAqB,EAAE,CAAC;IAEpD,gFAAgF;IAChF,IAAI,OAAO,CAAC,GAAG,CAAC,oCAAoC,CAAC,KAAK,MAAM,EAAE,CAAC;QACjE,IAAI,CAAC,IAAI,CACP,2EAA2E,CAC5E,CAAC;QAEF,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAC;QAE5D,MAAM,QAAQ,GAAa,EAAE,CAAC;QAE9B,IAAI,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;YAC/B,MAAM,UAAU,GAAG,EAAE,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;YAE/C,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;gBACnC,MAAM,UAAU,GAAG,EAAE;qBAClB,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;qBACjD,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;gBAEvC,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;oBACnC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC;gBACjE,CAAC;YACH,CAAC;QACH,CAAC;QAED,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACxB,MAAM,oBAAoB,CACxB,QAAQ,EACR,WAAW,EACX,wBAAwB,CACzB,CAAC;QACJ,CAAC;IACH,CAAC;AACH,CAAC;AAzCD,0CAyCC"}

44
lib/upload-sarif-action-post.js generated Normal file
View File

@@ -0,0 +1,44 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
/**
* This file is the entry point for the `post:` hook of `upload-sarif-action.yml`.
* It will run after the all steps in this job, in reverse order in relation to
* other `post:` hooks.
*/
const core = __importStar(require("@actions/core"));
const debugArtifacts = __importStar(require("./debug-artifacts"));
const uploadSarifActionPostHelper = __importStar(require("./upload-sarif-action-post-helper"));
const util_1 = require("./util");
async function runWrapper() {
try {
await uploadSarifActionPostHelper.uploadArtifacts(debugArtifacts.uploadDebugArtifacts);
}
catch (error) {
core.setFailed(`upload-sarif post-action step failed: ${(0, util_1.wrapError)(error).message}`);
}
}
void runWrapper();
//# sourceMappingURL=upload-sarif-action-post.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"upload-sarif-action-post.js","sourceRoot":"","sources":["../src/upload-sarif-action-post.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;GAIG;AACH,oDAAsC;AAEtC,kEAAoD;AACpD,+FAAiF;AACjF,iCAAmC;AAEnC,KAAK,UAAU,UAAU;IACvB,IAAI,CAAC;QACH,MAAM,2BAA2B,CAAC,eAAe,CAC/C,cAAc,CAAC,oBAAoB,CACpC,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,SAAS,CACZ,yCAAyC,IAAA,gBAAS,EAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CACpE,CAAC;IACJ,CAAC;AACH,CAAC;AAED,KAAK,UAAU,EAAE,CAAC"}

View File

@@ -34,19 +34,24 @@ const upload_lib = __importStar(require("./upload-lib"));
const util_1 = require("./util"); const util_1 = require("./util");
async function sendSuccessStatusReport(startedAt, uploadStats, logger) { async function sendSuccessStatusReport(startedAt, uploadStats, logger) {
const statusReportBase = await (0, status_report_1.createStatusReportBase)(status_report_1.ActionName.UploadSarif, "success", startedAt, undefined, await (0, util_1.checkDiskUsage)(), logger); const statusReportBase = await (0, status_report_1.createStatusReportBase)(status_report_1.ActionName.UploadSarif, "success", startedAt, undefined, await (0, util_1.checkDiskUsage)(), logger);
if (statusReportBase !== undefined) {
const statusReport = { const statusReport = {
...statusReportBase, ...statusReportBase,
...uploadStats, ...uploadStats,
}; };
await (0, status_report_1.sendStatusReport)(statusReport); await (0, status_report_1.sendStatusReport)(statusReport);
} }
}
async function run() { async function run() {
const startedAt = new Date(); const startedAt = new Date();
const logger = (0, logging_1.getActionsLogger)(); const logger = (0, logging_1.getActionsLogger)();
(0, util_1.initializeEnvironment)((0, actions_util_1.getActionVersion)()); (0, util_1.initializeEnvironment)((0, actions_util_1.getActionVersion)());
const gitHubVersion = await (0, api_client_1.getGitHubVersion)(); const gitHubVersion = await (0, api_client_1.getGitHubVersion)();
(0, util_1.checkActionVersion)((0, actions_util_1.getActionVersion)(), gitHubVersion); (0, util_1.checkActionVersion)((0, actions_util_1.getActionVersion)(), gitHubVersion);
await (0, status_report_1.sendStatusReport)(await (0, status_report_1.createStatusReportBase)(status_report_1.ActionName.UploadSarif, "starting", startedAt, undefined, await (0, util_1.checkDiskUsage)(), logger)); const startingStatusReportBase = await (0, status_report_1.createStatusReportBase)(status_report_1.ActionName.UploadSarif, "starting", startedAt, undefined, await (0, util_1.checkDiskUsage)(), logger);
if (startingStatusReportBase !== undefined) {
await (0, status_report_1.sendStatusReport)(startingStatusReportBase);
}
try { try {
const uploadResult = await upload_lib.uploadFromActions(actionsUtil.getRequiredInput("sarif_file"), actionsUtil.getRequiredInput("checkout_path"), actionsUtil.getOptionalInput("category"), logger); const uploadResult = await upload_lib.uploadFromActions(actionsUtil.getRequiredInput("sarif_file"), actionsUtil.getRequiredInput("checkout_path"), actionsUtil.getOptionalInput("category"), logger);
core.setOutput("sarif-id", uploadResult.sarifID); core.setOutput("sarif-id", uploadResult.sarifID);
@@ -67,7 +72,10 @@ async function run() {
const message = error.message; const message = error.message;
core.setFailed(message); core.setFailed(message);
console.log(error); console.log(error);
await (0, status_report_1.sendStatusReport)(await (0, status_report_1.createStatusReportBase)(status_report_1.ActionName.UploadSarif, (0, status_report_1.getActionsStatus)(error), startedAt, undefined, await (0, util_1.checkDiskUsage)(), logger, message, error.stack)); const errorStatusReportBase = await (0, status_report_1.createStatusReportBase)(status_report_1.ActionName.UploadSarif, (0, status_report_1.getActionsStatus)(error), startedAt, undefined, await (0, util_1.checkDiskUsage)(), logger, message, error.stack);
if (errorStatusReportBase !== undefined) {
await (0, status_report_1.sendStatusReport)(errorStatusReportBase);
}
return; return;
} }
} }

View File

@@ -1 +1 @@
{"version":3,"file":"upload-sarif-action.js","sourceRoot":"","sources":["../src/upload-sarif-action.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAsC;AAEtC,4DAA8C;AAC9C,iDAAkD;AAClD,6CAAgD;AAChD,uCAAqD;AACrD,6CAAkD;AAClD,mDAOyB;AACzB,yDAA2C;AAC3C,iCAQgB;AAMhB,KAAK,UAAU,uBAAuB,CACpC,SAAe,EACf,WAA0C,EAC1C,MAAc;IAEd,MAAM,gBAAgB,GAAG,MAAM,IAAA,sCAAsB,EACnD,0BAAU,CAAC,WAAW,EACtB,SAAS,EACT,SAAS,EACT,SAAS,EACT,MAAM,IAAA,qBAAc,GAAE,EACtB,MAAM,CACP,CAAC;IACF,MAAM,YAAY,GAA4B;QAC5C,GAAG,gBAAgB;QACnB,GAAG,WAAW;KACf,CAAC;IACF,MAAM,IAAA,gCAAgB,EAAC,YAAY,CAAC,CAAC;AACvC,CAAC;AAED,KAAK,UAAU,GAAG;IAChB,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC;IAC7B,MAAM,MAAM,GAAG,IAAA,0BAAgB,GAAE,CAAC;IAClC,IAAA,4BAAqB,EAAC,IAAA,+BAAgB,GAAE,CAAC,CAAC;IAE1C,MAAM,aAAa,GAAG,MAAM,IAAA,6BAAgB,GAAE,CAAC;IAC/C,IAAA,yBAAkB,EAAC,IAAA,+BAAgB,GAAE,EAAE,aAAa,CAAC,CAAC;IAEtD,MAAM,IAAA,gCAAgB,EACpB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OAAO,CAAC,CAAC;QACxB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACnB,MAAM,IAAA,gCAAgB,EACpB,MAAM,IAAA,sCAAsB,EAC1B,0BAAU,CAAC,WAAW,EACtB,IAAA,gCAAgB,EAAC,KAAK,CAAC,EACvB,SAAS,EACT,SAAS,EACT,MAAM,IAAA,qBAAc,GAAE,EACtB,MAAM,EACN,OAAO,EACP,KAAK,CAAC,KAAK,CACZ,CACF,CAAC;QACF,OAAO;IACT,CAAC;AACH,CAAC;AAED,KAAK,UAAU,UAAU;IACvB,IAAI,CAAC;QACH,MAAM,GAAG,EAAE,CAAC;IACd,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,SAAS,CACZ,sCAAsC,IAAA,gBAAS,EAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CACjE,CAAC;IACJ,CAAC;AACH,CAAC;AAED,KAAK,UAAU,EAAE,CAAC"} {"version":3,"file":"upload-sarif-action.js","sourceRoot":"","sources":["../src/upload-sarif-action.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAsC;AAEtC,4DAA8C;AAC9C,iDAAkD;AAClD,6CAAgD;AAChD,uCAAqD;AACrD,6CAAkD;AAClD,mDAOyB;AACzB,yDAA2C;AAC3C,iCAQgB;AAMhB,KAAK,UAAU,uBAAuB,CACpC,SAAe,EACf,WAA0C,EAC1C,MAAc;IAEd,MAAM,gBAAgB,GAAG,MAAM,IAAA,sCAAsB,EACnD,0BAAU,CAAC,WAAW,EACtB,SAAS,EACT,SAAS,EACT,SAAS,EACT,MAAM,IAAA,qBAAc,GAAE,EACtB,MAAM,CACP,CAAC;IACF,IAAI,gBAAgB,KAAK,SAAS,EAAE,CAAC;QACnC,MAAM,YAAY,GAA4B;YAC5C,GAAG,gBAAgB;YACnB,GAAG,WAAW;SACf,CAAC;QACF,MAAM,IAAA,gCAAgB,EAAC,YAAY,CAAC,CAAC;IACvC,CAA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"version": "2.24.11",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
@@ -896,12 +896,9 @@
"dev": true "dev": true
}, },
"node_modules/@types/node": { "node_modules/@types/node": {
"version": "20.9.0", "version": "16.11.22",
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.9.0.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.22.tgz",
"integrity": "sha512-nekiGu2NDb1BcVofVcEKMIwzlx4NjHlcjhoxxKBNLtz15Y1z7MYf549DFvkHSId02Ax6kGwWntIBPC3l/JZcmw==", "integrity": "sha512-DYNtJWauMQ9RNpesl4aVothr97/tIJM8HbyOXJ0AYT1Z2bEjLHyfjOBPAQQVMLf8h3kSShYfNk8Wnto8B2zHUA=="
"dependencies": {
"undici-types": "~5.26.4"
}
}, },
"node_modules/@types/node-fetch": { "node_modules/@types/node-fetch": {
"version": "2.6.4", "version": "2.6.4",
@@ -960,16 +957,16 @@
"integrity": "sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA==" "integrity": "sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA=="
}, },
"node_modules/@typescript-eslint/eslint-plugin": { "node_modules/@typescript-eslint/eslint-plugin": {
"version": "7.3.1", "version": "7.4.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.3.1.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.4.0.tgz",
"integrity": "sha512-STEDMVQGww5lhCuNXVSQfbfuNII5E08QWkvAw5Qwf+bj2WT+JkG1uc+5/vXA3AOYMDHVOSpL+9rcbEUiHIm2dw==", "integrity": "sha512-yHMQ/oFaM7HZdVrVm/M2WHaNPgyuJH4WelkSVEWSSsir34kxW2kDJCxlXRhhGWEsMN0WAW/vLpKfKVcm8k+MPw==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@eslint-community/regexpp": "^4.5.1", "@eslint-community/regexpp": "^4.5.1",
"@typescript-eslint/scope-manager": "7.3.1", "@typescript-eslint/scope-manager": "7.4.0",
"@typescript-eslint/type-utils": "7.3.1", "@typescript-eslint/type-utils": "7.4.0",
"@typescript-eslint/utils": "7.3.1", "@typescript-eslint/utils": "7.4.0",
"@typescript-eslint/visitor-keys": "7.3.1", "@typescript-eslint/visitor-keys": "7.4.0",
"debug": "^4.3.4", "debug": "^4.3.4",
"graphemer": "^1.4.0", "graphemer": "^1.4.0",
"ignore": "^5.2.4", "ignore": "^5.2.4",
@@ -995,15 +992,15 @@
} }
}, },
"node_modules/@typescript-eslint/parser": { "node_modules/@typescript-eslint/parser": {
"version": "7.3.1", "version": "7.4.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.3.1.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.4.0.tgz",
"integrity": "sha512-Rq49+pq7viTRCH48XAbTA+wdLRrB/3sRq4Lpk0oGDm0VmnjBrAOVXH/Laalmwsv2VpekiEfVFwJYVk6/e8uvQw==", "integrity": "sha512-ZvKHxHLusweEUVwrGRXXUVzFgnWhigo4JurEj0dGF1tbcGh6buL+ejDdjxOQxv6ytcY1uhun1p2sm8iWStlgLQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@typescript-eslint/scope-manager": "7.3.1", "@typescript-eslint/scope-manager": "7.4.0",
"@typescript-eslint/types": "7.3.1", "@typescript-eslint/types": "7.4.0",
"@typescript-eslint/typescript-estree": "7.3.1", "@typescript-eslint/typescript-estree": "7.4.0",
"@typescript-eslint/visitor-keys": "7.3.1", "@typescript-eslint/visitor-keys": "7.4.0",
"debug": "^4.3.4" "debug": "^4.3.4"
}, },
"engines": { "engines": {
@@ -1023,13 +1020,13 @@
} }
}, },
"node_modules/@typescript-eslint/scope-manager": { "node_modules/@typescript-eslint/scope-manager": {
"version": "7.3.1", "version": "7.4.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.3.1.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.4.0.tgz",
"integrity": "sha512-fVS6fPxldsKY2nFvyT7IP78UO1/I2huG+AYu5AMjCT9wtl6JFiDnsv4uad4jQ0GTFzcUV5HShVeN96/17bTBag==", "integrity": "sha512-68VqENG5HK27ypafqLVs8qO+RkNc7TezCduYrx8YJpXq2QGZ30vmNZGJJJC48+MVn4G2dCV8m5ZTVnzRexTVtw==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@typescript-eslint/types": "7.3.1", "@typescript-eslint/types": "7.4.0",
"@typescript-eslint/visitor-keys": "7.3.1" "@typescript-eslint/visitor-keys": "7.4.0"
}, },
"engines": { "engines": {
"node": "^18.18.0 || >=20.0.0" "node": "^18.18.0 || >=20.0.0"
@@ -1040,13 +1037,13 @@
} }
}, },
"node_modules/@typescript-eslint/type-utils": { "node_modules/@typescript-eslint/type-utils": {
"version": "7.3.1", "version": "7.4.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.3.1.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.4.0.tgz",
"integrity": "sha512-iFhaysxFsMDQlzJn+vr3OrxN8NmdQkHks4WaqD4QBnt5hsq234wcYdyQ9uquzJJIDAj5W4wQne3yEsYA6OmXGw==", "integrity": "sha512-247ETeHgr9WTRMqHbbQdzwzhuyaJ8dPTuyuUEMANqzMRB1rj/9qFIuIXK7l0FX9i9FXbHeBQl/4uz6mYuCE7Aw==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@typescript-eslint/typescript-estree": "7.3.1", "@typescript-eslint/typescript-estree": "7.4.0",
"@typescript-eslint/utils": "7.3.1", "@typescript-eslint/utils": "7.4.0",
"debug": "^4.3.4", "debug": "^4.3.4",
"ts-api-utils": "^1.0.1" "ts-api-utils": "^1.0.1"
}, },
@@ -1067,9 +1064,9 @@
} }
}, },
"node_modules/@typescript-eslint/types": { "node_modules/@typescript-eslint/types": {
"version": "7.3.1", "version": "7.4.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.3.1.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.4.0.tgz",
"integrity": "sha512-2tUf3uWggBDl4S4183nivWQ2HqceOZh1U4hhu4p1tPiIJoRRXrab7Y+Y0p+dozYwZVvLPRI6r5wKe9kToF9FIw==", "integrity": "sha512-mjQopsbffzJskos5B4HmbsadSJQWaRK0UxqQ7GuNA9Ga4bEKeiO6b2DnB6cM6bpc8lemaPseh0H9B/wyg+J7rw==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": "^18.18.0 || >=20.0.0" "node": "^18.18.0 || >=20.0.0"
@@ -1080,13 +1077,13 @@
} }
}, },
"node_modules/@typescript-eslint/typescript-estree": { "node_modules/@typescript-eslint/typescript-estree": {
"version": "7.3.1", "version": "7.4.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.3.1.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.4.0.tgz",
"integrity": "sha512-tLpuqM46LVkduWP7JO7yVoWshpJuJzxDOPYIVWUUZbW+4dBpgGeUdl/fQkhuV0A8eGnphYw3pp8d2EnvPOfxmQ==", "integrity": "sha512-A99j5AYoME/UBQ1ucEbbMEmGkN7SE0BvZFreSnTd1luq7yulcHdyGamZKizU7canpGDWGJ+Q6ZA9SyQobipePg==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@typescript-eslint/types": "7.3.1", "@typescript-eslint/types": "7.4.0",
"@typescript-eslint/visitor-keys": "7.3.1", "@typescript-eslint/visitor-keys": "7.4.0",
"debug": "^4.3.4", "debug": "^4.3.4",
"globby": "^11.1.0", "globby": "^11.1.0",
"is-glob": "^4.0.3", "is-glob": "^4.0.3",
@@ -1132,17 +1129,17 @@
} }
}, },
"node_modules/@typescript-eslint/utils": { "node_modules/@typescript-eslint/utils": {
"version": "7.3.1", "version": "7.4.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.3.1.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.4.0.tgz",
"integrity": "sha512-jIERm/6bYQ9HkynYlNZvXpzmXWZGhMbrOvq3jJzOSOlKXsVjrrolzWBjDW6/TvT5Q3WqaN4EkmcfdQwi9tDjBQ==", "integrity": "sha512-NQt9QLM4Tt8qrlBVY9lkMYzfYtNz8/6qwZg8pI3cMGlPnj6mOpRxxAm7BMJN9K0AiY+1BwJ5lVC650YJqYOuNg==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@eslint-community/eslint-utils": "^4.4.0", "@eslint-community/eslint-utils": "^4.4.0",
"@types/json-schema": "^7.0.12", "@types/json-schema": "^7.0.12",
"@types/semver": "^7.5.0", "@types/semver": "^7.5.0",
"@typescript-eslint/scope-manager": "7.3.1", "@typescript-eslint/scope-manager": "7.4.0",
"@typescript-eslint/types": "7.3.1", "@typescript-eslint/types": "7.4.0",
"@typescript-eslint/typescript-estree": "7.3.1", "@typescript-eslint/typescript-estree": "7.4.0",
"semver": "^7.5.4" "semver": "^7.5.4"
}, },
"engines": { "engines": {
@@ -1157,12 +1154,12 @@
} }
}, },
"node_modules/@typescript-eslint/visitor-keys": { "node_modules/@typescript-eslint/visitor-keys": {
"version": "7.3.1", "version": "7.4.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.3.1.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.4.0.tgz",
"integrity": "sha512-9RMXwQF8knsZvfv9tdi+4D/j7dMG28X/wMJ8Jj6eOHyHWwDW4ngQJcqEczSsqIKKjFiLFr40Mnr7a5ulDD3vmw==", "integrity": "sha512-0zkC7YM0iX5Y41homUUeW1CHtZR01K3ybjM1l6QczoMuay0XKtrb93kv95AxUGwdjGr64nNqnOCwmEl616N8CA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@typescript-eslint/types": "7.3.1", "@typescript-eslint/types": "7.4.0",
"eslint-visitor-keys": "^3.4.1" "eslint-visitor-keys": "^3.4.1"
}, },
"engines": { "engines": {
@@ -6089,11 +6086,6 @@
"url": "https://github.com/sponsors/ljharb" "url": "https://github.com/sponsors/ljharb"
} }
}, },
"node_modules/undici-types": {
"version": "5.26.5",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",
"integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA=="
},
"node_modules/universal-user-agent": { "node_modules/universal-user-agent": {
"version": "6.0.0", "version": "6.0.0",
"resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz",

0
node_modules/@types/node/LICENSE generated vendored Normal file → Executable file
View File

11
node_modules/@types/node/README.md generated vendored Normal file → Executable file
View File

@@ -2,14 +2,15 @@
> `npm install --save @types/node` > `npm install --save @types/node`
# Summary # Summary
This package contains type definitions for node (https://nodejs.org/). This package contains type definitions for Node.js (https://nodejs.org/).
# Details # Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node. Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node/v16.
### Additional Details ### Additional Details
* Last updated: Tue, 07 Nov 2023 20:08:00 GMT * Last updated: Tue, 01 Feb 2022 08:31:30 GMT
* Dependencies: [undici-types](https://npmjs.com/package/undici-types) * Dependencies: none
* Global values: `AbortController`, `AbortSignal`, `__dirname`, `__filename`, `console`, `exports`, `gc`, `global`, `module`, `process`, `require`
# Credits # Credits
These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [Alberto Schiabel](https://github.com/jkomyno), [Alvis HT Tang](https://github.com/alvis), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [Chigozirim C.](https://github.com/smac89), [David Junger](https://github.com/touffy), [Deividas Bakanas](https://github.com/DeividasBakanas), [Eugene Y. Q. Shen](https://github.com/eyqs), [Hannes Magnusson](https://github.com/Hannes-Magnusson-CK), [Huw](https://github.com/hoo29), [Kelvin Jin](https://github.com/kjin), [Klaus Meinhardt](https://github.com/ajafff), [Lishude](https://github.com/islishude), [Mariusz Wiktorczyk](https://github.com/mwiktorczyk), [Mohsen Azimi](https://github.com/mohsen1), [Nicolas Even](https://github.com/n-e), [Nikita Galkin](https://github.com/galkin), [Parambir Singh](https://github.com/parambirs), [Sebastian Silbermann](https://github.com/eps1lon), [Thomas den Hollander](https://github.com/ThomasdenH), [Wilco Bakker](https://github.com/WilcoBakker), [wwwy3y3](https://github.com/wwwy3y3), [Samuel Ainsworth](https://github.com/samuela), [Kyle Uehlein](https://github.com/kuehlein), [Thanik Bhongbhibhat](https://github.com/bhongy), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Victor Perin](https://github.com/victorperin), [Yongsheng Zhang](https://github.com/ZYSzys), [NodeJS Contributors](https://github.com/NodeJS), [Linus Unnebäck](https://github.com/LinusU), [wafuwafu13](https://github.com/wafuwafu13), [Matteo Collina](https://github.com/mcollina), and [Dmitry Semigradsky](https://github.com/Semigradsky). These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [DefinitelyTyped](https://github.com/DefinitelyTyped), [Alberto Schiabel](https://github.com/jkomyno), [Alvis HT Tang](https://github.com/alvis), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [Chigozirim C.](https://github.com/smac89), [David Junger](https://github.com/touffy), [Deividas Bakanas](https://github.com/DeividasBakanas), [Eugene Y. Q. Shen](https://github.com/eyqs), [Hannes Magnusson](https://github.com/Hannes-Magnusson-CK), [Huw](https://github.com/hoo29), [Kelvin Jin](https://github.com/kjin), [Klaus Meinhardt](https://github.com/ajafff), [Lishude](https://github.com/islishude), [Mariusz Wiktorczyk](https://github.com/mwiktorczyk), [Mohsen Azimi](https://github.com/mohsen1), [Nicolas Even](https://github.com/n-e), [Nikita Galkin](https://github.com/galkin), [Parambir Singh](https://github.com/parambirs), [Sebastian Silbermann](https://github.com/eps1lon), [Seth Westphal](https://github.com/westy92), [Simon Schick](https://github.com/SimonSchick), [Thomas den Hollander](https://github.com/ThomasdenH), [Wilco Bakker](https://github.com/WilcoBakker), [wwwy3y3](https://github.com/wwwy3y3), [Samuel Ainsworth](https://github.com/samuela), [Kyle Uehlein](https://github.com/kuehlein), [Thanik Bhongbhibhat](https://github.com/bhongy), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Victor Perin](https://github.com/victorperin), [Yongsheng Zhang](https://github.com/ZYSzys), [NodeJS Contributors](https://github.com/NodeJS), [Linus Unnebäck](https://github.com/LinusU), and [wafuwafu13](https://github.com/wafuwafu13).

252
node_modules/@types/node/assert.d.ts generated vendored Normal file → Executable file
View File

@@ -1,9 +1,9 @@
/** /**
* The `node:assert` module provides a set of assertion functions for verifying * The `assert` module provides a set of assertion functions for verifying
* invariants. * invariants.
* @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/assert.js) * @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/assert.js)
*/ */
declare module "assert" { declare module 'assert' {
/** /**
* An alias of {@link ok}. * An alias of {@link ok}.
* @since v0.5.9 * @since v0.5.9
@@ -12,29 +12,15 @@ declare module "assert" {
function assert(value: unknown, message?: string | Error): asserts value; function assert(value: unknown, message?: string | Error): asserts value;
namespace assert { namespace assert {
/** /**
* Indicates the failure of an assertion. All errors thrown by the `node:assert`module will be instances of the `AssertionError` class. * Indicates the failure of an assertion. All errors thrown by the `assert` module
* will be instances of the `AssertionError` class.
*/ */
class AssertionError extends Error { class AssertionError extends Error {
/**
* Set to the `actual` argument for methods such as {@link assert.strictEqual()}.
*/
actual: unknown; actual: unknown;
/**
* Set to the `expected` argument for methods such as {@link assert.strictEqual()}.
*/
expected: unknown; expected: unknown;
/**
* Set to the passed in operator value.
*/
operator: string; operator: string;
/**
* Indicates if the message was auto-generated (`true`) or not.
*/
generatedMessage: boolean; generatedMessage: boolean;
/** code: 'ERR_ASSERTION';
* Value is always `ERR_ASSERTION` to show that the error is an assertion error.
*/
code: "ERR_ASSERTION";
constructor(options?: { constructor(options?: {
/** If provided, the error message is set to this value. */ /** If provided, the error message is set to this value. */
message?: string | undefined; message?: string | undefined;
@@ -50,10 +36,9 @@ declare module "assert" {
}); });
} }
/** /**
* This feature is deprecated and will be removed in a future version. * This feature is currently experimental and behavior might still change.
* Please consider using alternatives such as the `mock` helper function.
* @since v14.2.0, v12.19.0 * @since v14.2.0, v12.19.0
* @deprecated Deprecated * @experimental
*/ */
class CallTracker { class CallTracker {
/** /**
@@ -62,7 +47,7 @@ declare module "assert" {
* error. * error.
* *
* ```js * ```js
* import assert from 'node:assert'; * import assert from 'assert';
* *
* // Creates call tracker. * // Creates call tracker.
* const tracker = new assert.CallTracker(); * const tracker = new assert.CallTracker();
@@ -80,44 +65,26 @@ declare module "assert" {
*/ */
calls(exact?: number): () => void; calls(exact?: number): () => void;
calls<Func extends (...args: any[]) => any>(fn?: Func, exact?: number): Func; calls<Func extends (...args: any[]) => any>(fn?: Func, exact?: number): Func;
/**
* Example:
*
* ```js
* import assert from 'node:assert';
*
* const tracker = new assert.CallTracker();
*
* function func() {}
* const callsfunc = tracker.calls(func);
* callsfunc(1, 2, 3);
*
* assert.deepStrictEqual(tracker.getCalls(callsfunc),
* [{ thisArg: undefined, arguments: [1, 2, 3] }]);
* ```
* @since v18.8.0, v16.18.0
* @param fn
* @return An Array with all the calls to a tracked function.
*/
getCalls(fn: Function): CallTrackerCall[];
/** /**
* The arrays contains information about the expected and actual number of calls of * The arrays contains information about the expected and actual number of calls of
* the functions that have not been called the expected number of times. * the functions that have not been called the expected number of times.
* *
* ```js * ```js
* import assert from 'node:assert'; * import assert from 'assert';
* *
* // Creates call tracker. * // Creates call tracker.
* const tracker = new assert.CallTracker(); * const tracker = new assert.CallTracker();
* *
* function func() {} * function func() {}
* *
* function foo() {}
*
* // Returns a function that wraps func() that must be called exact times * // Returns a function that wraps func() that must be called exact times
* // before tracker.verify(). * // before tracker.verify().
* const callsfunc = tracker.calls(func, 2); * const callsfunc = tracker.calls(func, 2);
* *
* // Returns an array containing information on callsfunc() * // Returns an array containing information on callsfunc()
* console.log(tracker.report()); * tracker.report();
* // [ * // [
* // { * // {
* // message: 'Expected the func function to be executed 2 time(s) but was * // message: 'Expected the func function to be executed 2 time(s) but was
@@ -130,39 +97,15 @@ declare module "assert" {
* // ] * // ]
* ``` * ```
* @since v14.2.0, v12.19.0 * @since v14.2.0, v12.19.0
* @return An Array of objects containing information about the wrapper functions returned by `calls`. * @return of objects containing information about the wrapper functions returned by `calls`.
*/ */
report(): CallTrackerReportInformation[]; report(): CallTrackerReportInformation[];
/**
* Reset calls of the call tracker.
* If a tracked function is passed as an argument, the calls will be reset for it.
* If no arguments are passed, all tracked functions will be reset.
*
* ```js
* import assert from 'node:assert';
*
* const tracker = new assert.CallTracker();
*
* function func() {}
* const callsfunc = tracker.calls(func);
*
* callsfunc();
* // Tracker was called once
* assert.strictEqual(tracker.getCalls(callsfunc).length, 1);
*
* tracker.reset(callsfunc);
* assert.strictEqual(tracker.getCalls(callsfunc).length, 0);
* ```
* @since v18.8.0, v16.18.0
* @param fn a tracked function to reset.
*/
reset(fn?: Function): void;
/** /**
* Iterates through the list of functions passed to `tracker.calls()` and will throw an error for functions that * Iterates through the list of functions passed to `tracker.calls()` and will throw an error for functions that
* have not been called the expected number of times. * have not been called the expected number of times.
* *
* ```js * ```js
* import assert from 'node:assert'; * import assert from 'assert';
* *
* // Creates call tracker. * // Creates call tracker.
* const tracker = new assert.CallTracker(); * const tracker = new assert.CallTracker();
@@ -182,10 +125,6 @@ declare module "assert" {
*/ */
verify(): void; verify(): void;
} }
interface CallTrackerCall {
thisArg: object;
arguments: unknown[];
}
interface CallTrackerReportInformation { interface CallTrackerReportInformation {
message: string; message: string;
/** The actual number of times the function was called. */ /** The actual number of times the function was called. */
@@ -204,7 +143,7 @@ declare module "assert" {
* it will be thrown instead of the `AssertionError`. * it will be thrown instead of the `AssertionError`.
* *
* ```js * ```js
* import assert from 'node:assert/strict'; * import assert from 'assert/strict';
* *
* assert.fail(); * assert.fail();
* // AssertionError [ERR_ASSERTION]: Failed * // AssertionError [ERR_ASSERTION]: Failed
@@ -229,7 +168,7 @@ declare module "assert" {
message?: string | Error, message?: string | Error,
operator?: string, operator?: string,
// tslint:disable-next-line:ban-types // tslint:disable-next-line:ban-types
stackStartFn?: Function, stackStartFn?: Function
): never; ): never;
/** /**
* Tests if `value` is truthy. It is equivalent to`assert.equal(!!value, true, message)`. * Tests if `value` is truthy. It is equivalent to`assert.equal(!!value, true, message)`.
@@ -242,7 +181,7 @@ declare module "assert" {
* thrown in a file! See below for further details. * thrown in a file! See below for further details.
* *
* ```js * ```js
* import assert from 'node:assert/strict'; * import assert from 'assert/strict';
* *
* assert.ok(true); * assert.ok(true);
* // OK * // OK
@@ -277,7 +216,7 @@ declare module "assert" {
* ``` * ```
* *
* ```js * ```js
* import assert from 'node:assert/strict'; * import assert from 'assert/strict';
* *
* // Using `assert()` works the same: * // Using `assert()` works the same:
* assert(0); * assert(0);
@@ -298,11 +237,11 @@ declare module "assert" {
* > Stability: 3 - Legacy: Use {@link strictEqual} instead. * > Stability: 3 - Legacy: Use {@link strictEqual} instead.
* *
* Tests shallow, coercive equality between the `actual` and `expected` parameters * Tests shallow, coercive equality between the `actual` and `expected` parameters
* using the [`==` operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Equality). `NaN` is specially handled * using the [Abstract Equality Comparison](https://tc39.github.io/ecma262/#sec-abstract-equality-comparison) ( `==` ). `NaN` is special handled
* and treated as being identical if both sides are `NaN`. * and treated as being identical in case both sides are `NaN`.
* *
* ```js * ```js
* import assert from 'node:assert'; * import assert from 'assert';
* *
* assert.equal(1, 1); * assert.equal(1, 1);
* // OK, 1 == 1 * // OK, 1 == 1
@@ -331,11 +270,12 @@ declare module "assert" {
* *
* > Stability: 3 - Legacy: Use {@link notStrictEqual} instead. * > Stability: 3 - Legacy: Use {@link notStrictEqual} instead.
* *
* Tests shallow, coercive inequality with the [`!=` operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Inequality). `NaN` is * Tests shallow, coercive inequality with the [Abstract Equality Comparison](https://tc39.github.io/ecma262/#sec-abstract-equality-comparison)(`!=` ). `NaN` is special handled and treated as
* specially handled and treated as being identical if both sides are `NaN`. * being identical in case both
* sides are `NaN`.
* *
* ```js * ```js
* import assert from 'node:assert'; * import assert from 'assert';
* *
* assert.notEqual(1, 2); * assert.notEqual(1, 2);
* // OK * // OK
@@ -382,24 +322,24 @@ declare module "assert" {
* Tests for any deep inequality. Opposite of {@link deepEqual}. * Tests for any deep inequality. Opposite of {@link deepEqual}.
* *
* ```js * ```js
* import assert from 'node:assert'; * import assert from 'assert';
* *
* const obj1 = { * const obj1 = {
* a: { * a: {
* b: 1, * b: 1
* }, * }
* }; * };
* const obj2 = { * const obj2 = {
* a: { * a: {
* b: 2, * b: 2
* }, * }
* }; * };
* const obj3 = { * const obj3 = {
* a: { * a: {
* b: 1, * b: 1
* }, * }
* }; * };
* const obj4 = { __proto__: obj1 }; * const obj4 = Object.create(obj1);
* *
* assert.notDeepEqual(obj1, obj1); * assert.notDeepEqual(obj1, obj1);
* // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } } * // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } }
@@ -422,10 +362,10 @@ declare module "assert" {
function notDeepEqual(actual: unknown, expected: unknown, message?: string | Error): void; function notDeepEqual(actual: unknown, expected: unknown, message?: string | Error): void;
/** /**
* Tests strict equality between the `actual` and `expected` parameters as * Tests strict equality between the `actual` and `expected` parameters as
* determined by [`Object.is()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is). * determined by the [SameValue Comparison](https://tc39.github.io/ecma262/#sec-samevalue).
* *
* ```js * ```js
* import assert from 'node:assert/strict'; * import assert from 'assert/strict';
* *
* assert.strictEqual(1, 2); * assert.strictEqual(1, 2);
* // AssertionError [ERR_ASSERTION]: Expected inputs to be strictly equal: * // AssertionError [ERR_ASSERTION]: Expected inputs to be strictly equal:
@@ -460,10 +400,10 @@ declare module "assert" {
function strictEqual<T>(actual: unknown, expected: T, message?: string | Error): asserts actual is T; function strictEqual<T>(actual: unknown, expected: T, message?: string | Error): asserts actual is T;
/** /**
* Tests strict inequality between the `actual` and `expected` parameters as * Tests strict inequality between the `actual` and `expected` parameters as
* determined by [`Object.is()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is). * determined by the [SameValue Comparison](https://tc39.github.io/ecma262/#sec-samevalue).
* *
* ```js * ```js
* import assert from 'node:assert/strict'; * import assert from 'assert/strict';
* *
* assert.notStrictEqual(1, 2); * assert.notStrictEqual(1, 2);
* // OK * // OK
@@ -494,7 +434,7 @@ declare module "assert" {
* Tests for deep strict inequality. Opposite of {@link deepStrictEqual}. * Tests for deep strict inequality. Opposite of {@link deepStrictEqual}.
* *
* ```js * ```js
* import assert from 'node:assert/strict'; * import assert from 'assert/strict';
* *
* assert.notDeepStrictEqual({ a: 1 }, { a: '1' }); * assert.notDeepStrictEqual({ a: 1 }, { a: '1' });
* // OK * // OK
@@ -525,14 +465,14 @@ declare module "assert" {
* Custom validation object/error instance: * Custom validation object/error instance:
* *
* ```js * ```js
* import assert from 'node:assert/strict'; * import assert from 'assert/strict';
* *
* const err = new TypeError('Wrong value'); * const err = new TypeError('Wrong value');
* err.code = 404; * err.code = 404;
* err.foo = 'bar'; * err.foo = 'bar';
* err.info = { * err.info = {
* nested: true, * nested: true,
* baz: 'text', * baz: 'text'
* }; * };
* err.reg = /abc/i; * err.reg = /abc/i;
* *
@@ -545,16 +485,16 @@ declare module "assert" {
* message: 'Wrong value', * message: 'Wrong value',
* info: { * info: {
* nested: true, * nested: true,
* baz: 'text', * baz: 'text'
* }, * }
* // Only properties on the validation object will be tested for. * // Only properties on the validation object will be tested for.
* // Using nested objects requires all properties to be present. Otherwise * // Using nested objects requires all properties to be present. Otherwise
* // the validation is going to fail. * // the validation is going to fail.
* }, * }
* ); * );
* *
* // Using regular expressions to validate error properties: * // Using regular expressions to validate error properties:
* assert.throws( * throws(
* () => { * () => {
* throw err; * throw err;
* }, * },
@@ -568,17 +508,17 @@ declare module "assert" {
* info: { * info: {
* nested: true, * nested: true,
* // It is not possible to use regular expressions for nested properties! * // It is not possible to use regular expressions for nested properties!
* baz: 'text', * baz: 'text'
* }, * },
* // The `reg` property contains a regular expression and only if the * // The `reg` property contains a regular expression and only if the
* // validation object contains an identical regular expression, it is going * // validation object contains an identical regular expression, it is going
* // to pass. * // to pass.
* reg: /abc/i, * reg: /abc/i
* }, * }
* ); * );
* *
* // Fails due to the different `message` and `name` properties: * // Fails due to the different `message` and `name` properties:
* assert.throws( * throws(
* () => { * () => {
* const otherErr = new Error('Not found'); * const otherErr = new Error('Not found');
* // Copy all enumerable properties from `err` to `otherErr`. * // Copy all enumerable properties from `err` to `otherErr`.
@@ -589,20 +529,20 @@ declare module "assert" {
* }, * },
* // The error's `message` and `name` properties will also be checked when using * // The error's `message` and `name` properties will also be checked when using
* // an error as validation object. * // an error as validation object.
* err, * err
* ); * );
* ``` * ```
* *
* Validate instanceof using constructor: * Validate instanceof using constructor:
* *
* ```js * ```js
* import assert from 'node:assert/strict'; * import assert from 'assert/strict';
* *
* assert.throws( * assert.throws(
* () => { * () => {
* throw new Error('Wrong value'); * throw new Error('Wrong value');
* }, * },
* Error, * Error
* ); * );
* ``` * ```
* *
@@ -612,13 +552,13 @@ declare module "assert" {
* therefore also include the error name. * therefore also include the error name.
* *
* ```js * ```js
* import assert from 'node:assert/strict'; * import assert from 'assert/strict';
* *
* assert.throws( * assert.throws(
* () => { * () => {
* throw new Error('Wrong value'); * throw new Error('Wrong value');
* }, * },
* /^Error: Wrong value$/, * /^Error: Wrong value$/
* ); * );
* ``` * ```
* *
@@ -628,7 +568,7 @@ declare module "assert" {
* It will otherwise fail with an `AssertionError`. * It will otherwise fail with an `AssertionError`.
* *
* ```js * ```js
* import assert from 'node:assert/strict'; * import assert from 'assert/strict';
* *
* assert.throws( * assert.throws(
* () => { * () => {
@@ -644,7 +584,7 @@ declare module "assert" {
* // possible. * // possible.
* return true; * return true;
* }, * },
* 'unexpected error', * 'unexpected error'
* ); * );
* ``` * ```
* *
@@ -654,7 +594,7 @@ declare module "assert" {
* a string as the second argument gets considered: * a string as the second argument gets considered:
* *
* ```js * ```js
* import assert from 'node:assert/strict'; * import assert from 'assert/strict';
* *
* function throwingFirst() { * function throwingFirst() {
* throw new Error('First'); * throw new Error('First');
@@ -710,20 +650,20 @@ declare module "assert" {
* propagated back to the caller. * propagated back to the caller.
* *
* If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes),
* [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), or a validation * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions) or a validation
* function. See {@link throws} for more details. * function. See {@link throws} for more details.
* *
* The following, for instance, will throw the `TypeError` because there is no * The following, for instance, will throw the `TypeError` because there is no
* matching error type in the assertion: * matching error type in the assertion:
* *
* ```js * ```js
* import assert from 'node:assert/strict'; * import assert from 'assert/strict';
* *
* assert.doesNotThrow( * assert.doesNotThrow(
* () => { * () => {
* throw new TypeError('Wrong value'); * throw new TypeError('Wrong value');
* }, * },
* SyntaxError, * SyntaxError
* ); * );
* ``` * ```
* *
@@ -731,27 +671,27 @@ declare module "assert" {
* 'Got unwanted exception...': * 'Got unwanted exception...':
* *
* ```js * ```js
* import assert from 'node:assert/strict'; * import assert from 'assert/strict';
* *
* assert.doesNotThrow( * assert.doesNotThrow(
* () => { * () => {
* throw new TypeError('Wrong value'); * throw new TypeError('Wrong value');
* }, * },
* TypeError, * TypeError
* ); * );
* ``` * ```
* *
* If an `AssertionError` is thrown and a value is provided for the `message`parameter, the value of `message` will be appended to the `AssertionError` message: * If an `AssertionError` is thrown and a value is provided for the `message`parameter, the value of `message` will be appended to the `AssertionError` message:
* *
* ```js * ```js
* import assert from 'node:assert/strict'; * import assert from 'assert/strict';
* *
* assert.doesNotThrow( * assert.doesNotThrow(
* () => { * () => {
* throw new TypeError('Wrong value'); * throw new TypeError('Wrong value');
* }, * },
* /Wrong value/, * /Wrong value/,
* 'Whoops', * 'Whoops'
* ); * );
* // Throws: AssertionError: Got unwanted exception: Whoops * // Throws: AssertionError: Got unwanted exception: Whoops
* ``` * ```
@@ -765,7 +705,7 @@ declare module "assert" {
* from the error passed to `ifError()` including the potential new frames for`ifError()` itself. * from the error passed to `ifError()` including the potential new frames for`ifError()` itself.
* *
* ```js * ```js
* import assert from 'node:assert/strict'; * import assert from 'assert/strict';
* *
* assert.ifError(null); * assert.ifError(null);
* // OK * // OK
@@ -811,7 +751,7 @@ declare module "assert" {
* If specified, `message` will be the message provided by the `AssertionError` if the `asyncFn` fails to reject. * If specified, `message` will be the message provided by the `AssertionError` if the `asyncFn` fails to reject.
* *
* ```js * ```js
* import assert from 'node:assert/strict'; * import assert from 'assert/strict';
* *
* await assert.rejects( * await assert.rejects(
* async () => { * async () => {
@@ -819,13 +759,13 @@ declare module "assert" {
* }, * },
* { * {
* name: 'TypeError', * name: 'TypeError',
* message: 'Wrong value', * message: 'Wrong value'
* }, * }
* ); * );
* ``` * ```
* *
* ```js * ```js
* import assert from 'node:assert/strict'; * import assert from 'assert/strict';
* *
* await assert.rejects( * await assert.rejects(
* async () => { * async () => {
@@ -835,16 +775,16 @@ declare module "assert" {
* assert.strictEqual(err.name, 'TypeError'); * assert.strictEqual(err.name, 'TypeError');
* assert.strictEqual(err.message, 'Wrong value'); * assert.strictEqual(err.message, 'Wrong value');
* return true; * return true;
* }, * }
* ); * );
* ``` * ```
* *
* ```js * ```js
* import assert from 'node:assert/strict'; * import assert from 'assert/strict';
* *
* assert.rejects( * assert.rejects(
* Promise.reject(new Error('Wrong value')), * Promise.reject(new Error('Wrong value')),
* Error, * Error
* ).then(() => { * ).then(() => {
* // ... * // ...
* }); * });
@@ -857,11 +797,7 @@ declare module "assert" {
* @since v10.0.0 * @since v10.0.0
*/ */
function rejects(block: (() => Promise<unknown>) | Promise<unknown>, message?: string | Error): Promise<void>; function rejects(block: (() => Promise<unknown>) | Promise<unknown>, message?: string | Error): Promise<void>;
function rejects( function rejects(block: (() => Promise<unknown>) | Promise<unknown>, error: AssertPredicate, message?: string | Error): Promise<void>;
block: (() => Promise<unknown>) | Promise<unknown>,
error: AssertPredicate,
message?: string | Error,
): Promise<void>;
/** /**
* Awaits the `asyncFn` promise or, if `asyncFn` is a function, immediately * Awaits the `asyncFn` promise or, if `asyncFn` is a function, immediately
* calls the function and awaits the returned promise to complete. It will then * calls the function and awaits the returned promise to complete. It will then
@@ -878,24 +814,24 @@ declare module "assert" {
* error messages as expressive as possible. * error messages as expressive as possible.
* *
* If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes),
* [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), or a validation * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions) or a validation
* function. See {@link throws} for more details. * function. See {@link throws} for more details.
* *
* Besides the async nature to await the completion behaves identically to {@link doesNotThrow}. * Besides the async nature to await the completion behaves identically to {@link doesNotThrow}.
* *
* ```js * ```js
* import assert from 'node:assert/strict'; * import assert from 'assert/strict';
* *
* await assert.doesNotReject( * await assert.doesNotReject(
* async () => { * async () => {
* throw new TypeError('Wrong value'); * throw new TypeError('Wrong value');
* }, * },
* SyntaxError, * SyntaxError
* ); * );
* ``` * ```
* *
* ```js * ```js
* import assert from 'node:assert/strict'; * import assert from 'assert/strict';
* *
* assert.doesNotReject(Promise.reject(new TypeError('Wrong value'))) * assert.doesNotReject(Promise.reject(new TypeError('Wrong value')))
* .then(() => { * .then(() => {
@@ -904,20 +840,13 @@ declare module "assert" {
* ``` * ```
* @since v10.0.0 * @since v10.0.0
*/ */
function doesNotReject( function doesNotReject(block: (() => Promise<unknown>) | Promise<unknown>, message?: string | Error): Promise<void>;
block: (() => Promise<unknown>) | Promise<unknown>, function doesNotReject(block: (() => Promise<unknown>) | Promise<unknown>, error: AssertPredicate, message?: string | Error): Promise<void>;
message?: string | Error,
): Promise<void>;
function doesNotReject(
block: (() => Promise<unknown>) | Promise<unknown>,
error: AssertPredicate,
message?: string | Error,
): Promise<void>;
/** /**
* Expects the `string` input to match the regular expression. * Expects the `string` input to match the regular expression.
* *
* ```js * ```js
* import assert from 'node:assert/strict'; * import assert from 'assert/strict';
* *
* assert.match('I will fail', /pass/); * assert.match('I will fail', /pass/);
* // AssertionError [ERR_ASSERTION]: The input did not match the regular ... * // AssertionError [ERR_ASSERTION]: The input did not match the regular ...
@@ -940,7 +869,7 @@ declare module "assert" {
* Expects the `string` input not to match the regular expression. * Expects the `string` input not to match the regular expression.
* *
* ```js * ```js
* import assert from 'node:assert/strict'; * import assert from 'assert/strict';
* *
* assert.doesNotMatch('I will fail', /fail/); * assert.doesNotMatch('I will fail', /fail/);
* // AssertionError [ERR_ASSERTION]: The input was expected to not match the ... * // AssertionError [ERR_ASSERTION]: The input was expected to not match the ...
@@ -959,20 +888,7 @@ declare module "assert" {
* @since v13.6.0, v12.16.0 * @since v13.6.0, v12.16.0
*/ */
function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void; function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void;
const strict: const strict: Omit<typeof assert, 'equal' | 'notEqual' | 'deepEqual' | 'notDeepEqual' | 'ok' | 'strictEqual' | 'deepStrictEqual' | 'ifError' | 'strict'> & {
& Omit<
typeof assert,
| "equal"
| "notEqual"
| "deepEqual"
| "notDeepEqual"
| "ok"
| "strictEqual"
| "deepStrictEqual"
| "ifError"
| "strict"
>
& {
(value: unknown, message?: string | Error): asserts value; (value: unknown, message?: string | Error): asserts value;
equal: typeof strictEqual; equal: typeof strictEqual;
notEqual: typeof notStrictEqual; notEqual: typeof notStrictEqual;
@@ -990,7 +906,7 @@ declare module "assert" {
} }
export = assert; export = assert;
} }
declare module "node:assert" { declare module 'node:assert' {
import assert = require("assert"); import assert = require('assert');
export = assert; export = assert;
} }

8
node_modules/@types/node/assert/strict.d.ts generated vendored Normal file → Executable file
View File

@@ -1,8 +1,8 @@
declare module "assert/strict" { declare module 'assert/strict' {
import { strict } from "node:assert"; import { strict } from 'node:assert';
export = strict; export = strict;
} }
declare module "node:assert/strict" { declare module 'node:assert/strict' {
import { strict } from "node:assert"; import { strict } from 'node:assert';
export = strict; export = strict;
} }

Some files were not shown because too many files have changed in this diff Show More