Commit Graph

270 Commits

Author SHA1 Message Date
Henry Mercer 239e305d18 Check disk usage using Node.js API
This was introduced in Node.js 18
2025-10-27 18:34:23 +00:00
Michael B. Gale ad35676669 Add getOptionalEnvVar function
Also add tests for it and `getRequiredEnvParam`
2025-10-24 15:00:42 +01:00
Henry Mercer 40e26468f3 Require message field too 2025-10-21 10:27:54 +01:00
Henry Mercer c64c4070cc Handle HTTP errors with httpStatusCode property 2025-10-20 14:38:02 +01:00
Paolo Tranquilli 25c8db918a Revert "Specify reason for skipping SARIF upload in logs"
This reverts commit 680b07003d.
2025-10-06 16:59:45 +02:00
Paolo Tranquilli 680b07003d Specify reason for skipping SARIF upload in logs 2025-10-06 15:39:29 +02:00
Paolo Tranquilli 882667e383 Update src/util.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-06 15:22:34 +02:00
Paolo Tranquilli e0b9da7b0a Introduce CODEQL_ACTION_SKIP_SARIF_UPLOAD
This triggers a subset of the behavior of `CODEQL_ACTION_TEST_MODE`,
specifically just skipping the SARIF upload step. This is required for
our internal testing where we want the SARIF file (via
`CODEQL_ACTION_DUMP_SARIF_DIR`) but don't want to actually upload it,
but we don't want the rest of the behaviour of `CODEQL_ACTION_TEST_MODE`
that is specific for `codeql-action` own CI checks.
2025-10-06 14:38:32 +02:00
Michael B. Gale 91a63dc72c Remove undefined values from results of unsafeEntriesInvariant 2025-10-01 15:28:56 +01:00
Michael B. Gale 9a0b46abff Rename keys and entries helpers and update docs 2025-09-30 12:52:04 +01:00
Michael B. Gale 0417531633 Add keysTyped and entriesTyped helpers 2025-09-29 15:07:15 +01:00
Chuan-kai Lin 8185897cad Rename withTimeout() to waitForResultWithTimeLimit()
The name withTimeout() gives the impression that it would limit the
execution of the promise to the given time bound. But that is not the
case: it is only the _waiting_ that is limited, and the promise would
keep running beyond the time bound.

This commit renames withTimeout() to waitForResultWithTimeLimit() so
that developers are more likely to understand the actual behavior of
this function.
2025-09-18 08:27:36 -07:00
Michael B. Gale 811aef84cb Move isDefined from start-proxy to util 2025-09-04 11:39:22 +01:00
Henry Mercer 09839488db Update del 2025-08-29 19:22:46 +01:00
Henry Mercer c2b56013b4 Update get-folder-size 2025-08-29 19:11:25 +01:00
Chuan-kai Lin 8dbcef50df Extract getGeneratedSuitePath() 2025-08-08 08:53:04 -07:00
Henry Mercer cfb8d07200 Remove unnecessary String initializations
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-08-05 11:18:46 +01:00
Henry Mercer c481481d7d Merge branch 'main' into henrymercer/language-extensibility 2025-08-05 11:07:39 +01:00
Koen Vlaswinkel e30db30685 Ignore pre-release parts when comparing GHES versions 2025-07-16 11:51:53 +02:00
Koen Vlaswinkel c6a6c1490f Move comment to JSDoc 2025-07-14 13:18:38 +02:00
Koen Vlaswinkel 59d67fc4bf Fix parsing of GHES pre-release versions 2025-07-14 11:25:20 +02:00
Henry Mercer 3b57965c44 Remove per-language hardcoded traced/scanned info 2025-05-30 17:58:19 +01:00
Henry Mercer f681ad69a7 Add utility function to get testing environment 2025-05-14 14:10:19 +01:00
Ian Lynagh 32505c6f2d Warn about small amounts of MB, not GB
The number of GB is at most 2, and can be tiny. MB gives a more
comprehensible range of values.
2025-02-26 15:11:14 +00:00
Chuan-kai Lin dae1626680 Filter alerts by pr-diff-range JSON file 2025-02-19 06:26:11 -08:00
Angela P Wen 8d2753b250 Add public changelog blog post link 2025-01-10 08:52:16 -08:00
Angela P Wen 04b5afaa72 Convert deprecation warning to error 2025-01-07 13:59:42 -08:00
Henry Mercer b58f4471c8 Use @actions/io to locate binaries 2024-12-19 14:21:06 +00:00
Angela P Wen b500b62cea Throw configuration error when tar is not available 2024-11-18 11:21:11 -08:00
Michael B. Gale 7bc6222c12 Allow warnings in tryGetFolderBytes to be suppressed
To avoid confusing run annotations when dependency caching is enabled
2024-11-12 15:16:18 +00:00
Dave Bartolomeo 7e9defdf1b Support YAML in CODEQL_ACTION_EXTRA_OPTIONS 2024-10-18 17:23:16 -04:00
Henry Mercer 28db28fc03 Improve clean up if extraction fails 2024-10-02 15:45:55 +01:00
Henry Mercer dd7307d603 Refactoring: Simplify retrieving error message 2024-09-16 22:38:35 +02:00
Angela P Wen 7e27807413 Only run check SIP enablement once in init step (#2441)
Co-authored-by: Henry Mercer <henrymercer@github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-08-23 09:17:22 -07:00
Angela P Wen 202b3b97bf Stop checking disk usage for MacOS ARM with SIP disabled (#2434)
* Stop checking disk usage for MacOS ARM with SIP disabled

On MacOS ARM machines where SIP is disabled, after the build tracer is initialized in the `init` Action, we receive warnings when we run send status reports due to the `df` binary. This change will make it so that we no longer run `df` for those machines.
2024-08-20 16:04:03 -07:00
Remco Vermeulen 7c2bec0cc3 Merge remote-tracking branch 'upstream/main' into rvermeulen/extend-init-complete-status-report 2024-08-06 09:11:17 -07:00
Henry Mercer ecb9ccfcb1 Fix new linter errors 2024-08-05 19:22:26 +01:00
Remco Vermeulen 7be3a64c02 Move cloneObject into utilities and export it. 2024-07-31 17:56:06 -07:00
github-actions[bot] 9cf3243b0b Rebuild 2024-06-25 09:21:42 +00:00
Henry Mercer 1ea11ca775 Enable no-unsafe-return rule 2024-06-13 19:52:39 +01:00
Koen Vlaswinkel 8b0dfa84c7 Add deprecation warning for merging SARIF files with non-unique categories 2024-04-26 14:22:30 +02:00
Angela P Wen ac2f82a1ff Log warning if SIP is disabled and CLI version is < 2.15.1 (#2261)
* PR Checks: use `macos-12` runners for CLI v. < 2.15.1

Prior to CLI v2.15.1, MacOS ARM runners were not supported by the build tracer. "macos-latest" is now an ARM runner, so we run these tests on the old CLIs on Intel runners instead.

* Log a warning if SIP is disabled and CLI is < 2.15.1

* Add changenote for SIP-disabled support on old CLI versions

* Set up Python 3.11 for all MacOS checks
2024-04-25 22:20:13 +00:00
Henry Mercer 5b74166227 Move BuildMode to util.ts 2024-04-12 16:37:13 +01:00
Henry Mercer 1a60a91726 Remove support for CodeQL v2.12.5 and earlier 2024-04-09 12:29:14 +01:00
Angela P Wen 8cb81db135 Add unit tests for getCgroupCpuCountFromCpus 2024-02-16 12:48:04 +00:00
Angela P Wen ef0a773901 Account for existing but empty cpus file
If a CPU file exists but is empty, previously we reported this file with a CPU count of 1, which resulted in a single-threaded run.
2024-02-15 16:18:04 +00:00
Angela P Wen 1515e2bb20 Refactor configuration errors (#2105)
Refactor the existing classes of configuration errors into their own file; consolidate the place we check for configuration errors into `codeql.ts`, where the actual command invocations happen.

Also, rename the `UserError` type to `ConfigurationError` to standardize on a single term.
2024-02-08 17:20:03 +00:00
Henry Mercer f9dea84e29 Status report: Handle failures determining disk usage 2024-02-02 16:31:04 +00:00
Angela P Wen 65c74964a9 Respect Linux cgroup CPU number for --threads value (#2083)
We want to respect cgroup constraints so that when we run in a container, we respect the limits set for the container rather than use the host OS's number of cores.

We check both `/sys/fs/cgroup/cpuset.cpus.effective` (`cgroup v2`) and `/sys/fs/cgroup/cpuset.cpus` (`cgroup v1`) to find the number of cores available. We also check `sys/fs/cgroup/cpu.max` (v1, v2) to calculate the number of cores from the limits set in this file.

The max threads value is set to the minimum of these values, and if no values were found in these files, we default to the original value of the host OS.
2024-01-23 14:50:06 +00:00
nickfyson e86ee7f7b4 fix typo in comment 2024-01-19 15:03:13 +00:00