4088 Commits

Author SHA1 Message Date
Henry Mercer
bee82de8ba Add tools download durations to the init status report
Surface `tools_extraction_duration_ms` and `tools_total_duration_ms` from
both the `init` and `setup-codeql` actions.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 628ce334-991a-4578-9c1b-93d2e96bbddb
2026-08-24 18:32:08 +01:00
Henry Mercer
c05e445696 Report tools download durations on both download paths
The streaming path reported no timings at all, so we have no data for the
path that most runs take. It now reports a total duration, which is also
populated on the download-then-extract path.

That path additionally reports the extraction duration, which was
previously computed but only logged.

`downloadDurationMs` keeps its existing meaning of time spent downloading
alone, so existing telemetry stays comparable.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 628ce334-991a-4578-9c1b-93d2e96bbddb
2026-08-24 18:32:04 +01:00
Paolo Tranquilli
97b7459e09 Merge remote-tracking branch 'origin/main' into redsun82-linux-arm64-support 2026-08-21 17:43:09 +02:00
github-actions[bot]
f9d9f07d37 Update supported GitHub Enterprise Server versions 2026-08-19 00:11:43 +00:00
Henry Mercer
1aef003397 Address review feedback on overlay disk flags
Document each minimum disk feature flag individually and replace the tuple list with an explicit feature-to-threshold mapping.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-08-18 12:09:33 +01:00
Henry Mercer
508b83bc41 Merge main into overlay minimum disk feature branch
Resolve the overlap with the separately shipped promotion of the overlay resource checks while preserving the feature-flagged minimum disk thresholds.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-08-18 12:09:09 +01:00
Mario Campos
fcd8d74cda Refactor output-caching functions to accept file path dependency
This makes it easier to test. Credit to @mbg.
2026-08-14 14:41:04 -05:00
Mario Campos
b5d34388b7 Refactor tests in output-cache.test.ts to use named imports from output-cache 2026-08-14 14:28:17 -05:00
Mario Campos
1f46830a1f Fix VersionInfo derived type to pass linter 2026-08-14 14:24:37 -05:00
Mario Campos
b60777a215 Delete unnecessary statement from JSDoc comments 2026-08-14 14:05:42 -05:00
Mario Campos
f3deecb42d Refactor OutputCache with json module 2026-08-14 11:38:38 -05:00
Mario Campos
c8ba2d2a05 Refactor isVersionInfo with json module 2026-08-14 11:35:14 -05:00
Mario Campos
d7d901a925 Refactor tests to use getCommandCacheFilePath
As well as fixup a few other problems.
2026-08-14 10:56:07 -05:00
Mario Campos
cb9d39fcc1 Export getCommandCacheFilePath function for use in tests 2026-08-14 10:55:33 -05:00
Michael B. Gale
47fa622223 Make EACCES a ConfigurationError 2026-08-14 11:56:26 +01:00
Michael B. Gale
45693cc688 Refactor ENOSPC check into isDiskConfigurationError function 2026-08-14 11:53:32 +01:00
Mario Campos
93d793c5fe Use json module for JSON validation in output-cache 2026-08-13 23:19:37 -05:00
Mario Campos
c56f48e9bd Log unexpected conditions during caching CLI output 2026-08-13 09:14:00 -05:00
Mario Campos
aa0eadc572 Merge branch 'main' into mario-campos/version-cache-to-disk
# Conflicts:
#	lib/entry-points.js
2026-08-13 09:02:15 -05:00
Mario Campos
43250d671a Change cache key to string type to include CLI args 2026-08-13 08:59:09 -05:00
Mario Campos
2d49edbac6 Re-order env to be first argument for consistency 2026-08-13 08:13:49 -05:00
Michael B. Gale
9310334b11 Merge pull request #4086 from github/mbg/thread-action-state-to-codeql
Make a `Logger` available to `getCodeQLForCmd`
2026-08-13 10:03:46 +00:00
Mario Campos
6dc633238e Bolster output-cache unit tests with more test cases 2026-08-12 13:45:22 -05:00
Mario Campos
6c0d9018d4 Change OutputCache to use object for entries
This will ensure it works nicely with `JSON.stringify`. And, then we can validate the type before marshaling.
2026-08-12 12:01:20 -05:00
Mario Campos
bf96b0df93 Expand test to ensure it does not throw an exception 2026-08-12 11:39:32 -05:00
Mario Campos
337136ab8a Rename CommandCacheRecord -> OutputCache 2026-08-12 11:29:11 -05:00
Mario Campos
a9baab8dee Export CLI cache types 2026-08-12 11:26:52 -05:00
Mario Campos
33d70867d5 Pass environment explicitly to CLI caching functions 2026-08-12 11:24:37 -05:00
Michael B. Gale
38055a3c3c Drop logger from databaseInitCluster in interface 2026-08-12 16:49:45 +01:00
Michael B. Gale
dc1b98ad1c Make logger available to getCodeQLForCmd 2026-08-12 16:43:22 +01:00
github-actions[bot]
0e8a5d99f8 Update default bundle to codeql-bundle-v2.26.3 2026-08-12 15:30:15 +00:00
Mario Campos
40f80a8df0 Rename type to better match generic intention 2026-08-11 18:09:09 -05:00
Mario Campos
b222c3aaea Generalize file cache data structure 2026-08-11 18:09:09 -05:00
Mario Campos
11569df0a1 Update JSDoc of getCachedCodeQlVersion 2026-08-11 15:55:16 -05:00
Mario Campos
0a99875ae5 Move VersionInfo-related types to cli/output-cache.ts
This brings them out of the crowded all-purpose `util.ts` and into `cli/output-cache.ts` where they are exclusively used.
2026-08-11 15:55:15 -05:00
Mario Campos
246018e041 Move VersionInfo to dedicated module 2026-08-11 15:55:15 -05:00
Mario Campos
1332611f51 Move cache-related util functions into dedicated module 2026-08-11 15:55:15 -05:00
Mario Campos
4dc327a942 Introduce basic cli/output-cache.ts module 2026-08-11 15:36:17 -05:00
Mario Campos
bb19330c5e Add test of getCachedCodeQlVersion with no file 2026-08-11 15:36:17 -05:00
Mario Campos
0e85c0e99c Refactor unit test to extract testing values 2026-08-11 15:36:17 -05:00
Mario Campos
bfcd769ba1 Fix JSDoc of env param 2026-08-11 15:36:17 -05:00
Mario Campos
208a88adc7 Simplify JSDoc of getCachedCodeQlVersion
Co-authored-by: Michael B. Gale <mbg@github.com>
2026-08-11 11:06:17 -05:00
Michael B. Gale
f47bb7b9aa Remove v2 from test title 2026-08-11 14:08:57 +01:00
Michael B. Gale
c205ff6f09 Promote OverlayAnalysisResourceChecksV2
This feature has been rolled out to 100% and therefore the default behaviour for some time.
2026-08-11 14:03:49 +01:00
Mario Campos
9183a7b6e1 Handle file-read errors as cache misses
This is particularly important for the first time that `getCachedCodeQlVersion` is invoked, as this cache file will not yet exist.
2026-08-10 10:44:48 -05:00
Mario Campos
5f8c44ba62 Persist CodeQL version output to file rather than environment 2026-08-07 15:11:20 -05:00
Henry Mercer
794f5bc385 Fix the memory check debug message at equality
The comparison accepts exactly the minimum, so say "at or above", to
match the wording of the disk space check.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-08-06 16:48:44 +01:00
Henry Mercer
54109818e0 Address review feedback on the disk space check
Say "at or above" in the debug message logged when the check passes,
since the comparison accepts exactly the minimum.

Check each feature flag against the threshold its name declares, rather
than only exercising a few of them, so that a mistake in one of the
mappings cannot go unnoticed. Both sides of the boundary are needed to
pin a threshold down: a mapping to a lower value would still pass the
case at the limit, and one to a higher value would still fail the case
below it.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-08-06 16:41:48 +01:00
Henry Mercer
99caaa8b90 Remove the overlay_analysis_resource_checks_v2 feature flag
The flag no longer has any effect now that its 14 GB threshold is the
unconditional default, so remove it. Setting
CODEQL_ACTION_OVERLAY_ANALYSIS_RESOURCE_CHECKS_V2 no longer does
anything.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-08-06 16:38:34 +01:00
Henry Mercer
6117bb503a Derive overlay minimum disk space from feature flags
Overlay analysis required 20 GB of available disk space, lowered to
14 GB when overlay_analysis_resource_checks_v2 was enabled. That gave
us a single step to roll out, and any further reduction needed another
flag and another release.

Determine the threshold from the new overlay_analysis_min_disk_N_gb
flags instead, taking the lowest one that is enabled so that a lower
limit can be rolled out to a subset of repositories without first
disabling the flag above it. When none are enabled, the 14 GB limit
now applies unconditionally, replacing the 20 GB default.

Thresholds remain in decimal MB, matching the bytes-per-MB convention
the disk check already used, so the effective byte values are unchanged
from the previous 14 GB path. Also log the available and required space
at debug level when the check passes, so that run logs show which
threshold took effect.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-08-06 16:38:33 +01:00