Commit Graph

4035 Commits

Author SHA1 Message Date
Henry Mercer
79fe3a1270 Move download telemetry into the status-report directory
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-17 19:04:38 +01:00
Henry Mercer
ead1f7d93f Rename the platform module
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-17 19:03:27 +01:00
Henry Mercer
549d498da3 Simplify per-language platform eligibility checks
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-17 19:02:12 +01:00
Henry Mercer
ed3a24ccbc Group bundle eligibility test state overrides
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-17 19:01:31 +01:00
Henry Mercer
28b8f598f5 Use shared test state for bundle eligibility
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-17 19:00:38 +01:00
Henry Mercer
69f47159b1 Use Result.orElse for bundle extraction paths
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-16 19:55:13 +01:00
Henry Mercer
f4fa111630 Share elapsed-time rounding for bundle downloads
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-16 19:51:23 +01:00
Henry Mercer
89606bbad1 Return toolcache rejection reasons with Result
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-16 19:43:05 +01:00
Henry Mercer
bd2ddba96c Extract explicit CodeQL bundle URL classification
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-16 19:36:07 +01:00
Henry Mercer
2f552a99f3 Clarify bundle resolution and latest-nightly selection
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-16 17:36:46 +01:00
Henry Mercer
f536ef48b7 Centralize CodeQL download telemetry fields
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-16 17:30:50 +01:00
Henry Mercer
dfb9bf52c9 Share CodeQL bundle platform definitions
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-16 17:28:00 +01:00
Henry Mercer
2d47caf123 Isolate per-language bundle eligibility state
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-16 17:25:24 +01:00
Henry Mercer
59ce3a25ba Include failed bundle attempts in fallback timing
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-16 16:56:49 +01:00
Henry Mercer
289376d7dd Use per-language CodeQL bundles
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-16 16:56:33 +01:00
Henry Mercer
f3e0c870be Clarify resolved bundle handling
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-16 12:16:13 +01:00
Henry Mercer
1970c450ec Separate CodeQL bundle resolution from installation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-15 15:25:18 +01:00
Henry Mercer
d65664dcae Merge pull request #4138 from github/henrymercer/bundle-download-errors
Preserve HTTP errors from streaming bundle downloads
2026-09-15 12:36:14 +00:00
Henry Mercer
0224ca9728 Use a plain error when the HTTP status is unknown
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-15 12:55:26 +01:00
Henry Mercer
13354125bc Omit unknown HTTP status codes from download errors
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-14 11:41:48 +01:00
Mario Campos
1cf8f518e1 Merge pull request #4140 from github/mario-campos/move-withTmpFile
Move `withTmpFile` next to `withTmpDir`
2026-09-11 18:54:51 +00:00
Mario Campos
faf4f3af21 Add JSDoc to withTmpFile 2026-09-11 11:12:03 -05:00
Mario Campos
80d5f4e36a Always clean-up temp dirs in withTmpDir 2026-09-10 18:48:14 -05:00
Mario Campos
f6491d646e Reduce duplication by using withTmpDir in withTmpFile 2026-09-10 15:37:39 -05:00
Mario Campos
4375107b7e Move withTmpFile to util.ts and update tests to use it 2026-09-10 15:36:26 -05:00
Henry Mercer
5bdaf5d4af Preserve HTTP errors from streaming bundle downloads
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-10 19:05:41 +01:00
github-actions[bot]
40484b3395 Update default bundle to codeql-bundle-v2.27.0 2026-09-09 11:33:48 +00:00
Henry Mercer
40a6b38247 Address toolcache cleanup review feedback
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-08 15:55:41 +01:00
copilot-swe-agent[bot]
034db721dd Merge remote-tracking branch 'origin/main' into henrymercer/toolcache-bundle-cleanup
Co-authored-by: henrymercer <14129055+henrymercer@users.noreply.github.com>
2026-09-07 12:57:51 +00:00
Henry Mercer
313a0b9922 Merge pull request #4122 from github/henrymercer/friendly-potato
Don't record an overlay status when the job was cancelled
2026-09-04 16:55:52 +00:00
Henry Mercer
31da345c07 Address review comments
Delete each version directory individually so that a symlinked one is skipped rather than removed, take an `ActionState` so the environment is read through `ReadOnlyEnv` rather than the deprecated `getOptionalEnvVar`, let `deleteToolcacheBundles` report its own failure to locate the toolcache instead of having the caller catch it, quote paths in log messages, and rename `HAS_OBTAINED_CODEQL_TOOLS` to `HAS_SET_UP_CODEQL`, which is also set when we find the tools in the toolcache rather than downloading them.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-04 17:43:40 +01:00
Henry Mercer
a48f2d3077 Record an overlay status only for conclusive job statuses
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-04 17:33:02 +01:00
Henry Mercer
657964c39f Read the job status from a ReadOnlyEnv in recordOverlayStatus
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-04 17:31:24 +01:00
Henry Mercer
e13c3dc834 Only clean up a toolcache on the workspace filesystem
Some runner images keep the toolcache on a different volume to the workspace, so deleting the tools there frees up disk space that the analysis cannot use, and costs a later step that wanted them in the toolcache a download. Windows runners are laid out this way, with the toolcache on `C:` and the workspace on `D:`.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-04 11:00:56 +01:00
Henry Mercer
1331773b9a Address Copilot review feedback
Run the cleanup even when the download will not be cached in the toolcache, since the toolcache shares a filesystem with the directory we extract to, so freeing it helps either way, and report an error other than the toolcache being absent as a failure rather than as an empty toolcache.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-04 10:26:09 +01:00
Henry Mercer
4a0b22ec25 Delete unused CodeQL bundles from the toolcache before downloading
When we download a bundle the toolcache often already holds a different one that the job will not use, and on GitHub-hosted runners it shares a filesystem with the workspace, so it takes space away from the analysis. Empty the toolcache before downloading, which also frees space for the archive during extraction, and which is safe because getting as far as a download means the tools were not resolved from the toolcache. Skip this once a step has obtained the tools, since a later step may run a path it was given, and gate it on the runner being GitHub-hosted and on a feature flag that is off by default.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-04 10:12:10 +01:00
Henry Mercer
762a5ed7f7 Add a helper to delete the CodeQL tools from the toolcache
`deleteToolcacheBundles` removes `$RUNNER_TOOL_CACHE/CodeQL` and reports which versions were there. It refuses to follow a symlinked CodeQL directory so that it can only ever delete paths that are really inside the toolcache, and reports failures rather than throwing. Not called yet.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-04 10:12:10 +01:00
Henry Mercer
ceb85f25b5 Distinguish GitHub-hosted runners from ones that look hosted
`isHostedRunner` infers hostedness from the runner name and the toolcache path, so it also matches self-hosted runners that are configured to resemble hosted ones. Rename it to `looksLikeHostedRunner` so callers can see they are getting a heuristic, and add `isGitHubHostedRunner`, which reads the `RUNNER_ENVIRONMENT` value the Actions service reports. The existing callers keep the heuristic, so there is no behaviour change.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-04 10:12:09 +01:00
Henry Mercer
9fddc16f0d Merge pull request #4088 from github/dependabot/npm_and_yarn/octokit/plugin-rest-endpoint-methods-18.0.0
Bump @octokit/plugin-rest-endpoint-methods from 17.0.0 to 18.0.0
2026-09-04 07:23:47 +00:00
Henry Mercer
38dd4a088a Don't record an overlay status when the job was cancelled
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-03 18:21:46 +01:00
Paolo Tranquilli
4cccb3aa86 Merge pull request #4072 from github/redsun82-linux-arm64-support
Add support for Linux Arm64 runners
2026-09-03 13:58:15 +00:00
Mario Campos
a0c73122a6 Merge pull request #4096 from github/mario-campos/use-json-module
Use `json` module for JSON validation in `output-cache`
2026-09-01 15:17:48 +00:00
Paolo Tranquilli
025009006c Address review comments
- Stub process.platform/arch in the supported-platform test and loop
  over all supported pairs (including linux/arm64) so it no longer
  depends on the host
- Run the default queries in the Linux Arm64 PR check so the databases
  are finalized end-to-end

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: fb7e2d12-6620-4a67-9c1c-4e82f4a5e8d9
2026-08-28 17:28:29 +02:00
Henry Mercer
1bcdd0c019 Derive the API client type from @actions/github
`ApiClient` was hand-composed from `Octokit`, `Api` and `PaginateInterface`, imported directly from separately versioned Octokit packages. That asserted a shape matching what `@actions/github` actually returns, which held only while the versions happened to agree.

`@octokit/plugin-rest-endpoint-methods` v18 adds twelve Actions cache-limit methods. `@actions/github` still depends on `^17.0.0`, so the client it constructs no longer satisfies the v18-derived alias and the build fails.

Deriving the type from the constructor removes the assumption, so the alias tracks whatever `@actions/github` returns.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-08-27 18:56:47 +01:00
Paolo Tranquilli
6441b26a49 Merge remote-tracking branch 'origin/main' into redsun82-linux-arm64-support 2026-08-27 10:09:22 +02:00
Henry Mercer
3e93618b99 Merge pull request #4105 from github/henrymercer/tools-download-telemetry
Improve CodeQL tools download time telemetry
2026-08-26 17:01:23 +00:00
github-actions[bot]
adcdf4a70d Update default bundle to codeql-bundle-v2.26.4 2026-08-26 08:23:20 +00:00
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