[GH-ISSUE #1578] [Issue]: CodeQL checks out 2.5 GB of artifacts it never analyzes #1553

Closed
opened 2026-10-23 04:02:57 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @Promansis on GitHub (Oct 22, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1578

Originally assigned to: @SpicyMarinara, @Promansis on GitHub.

Summary

Analyze javascript-typescript is the slowest required check on every pull request, and about a third of its time is the checkout. The job checks out artifacts/, 2.46 GB of package zips that CodeQL never reads.

Affected package

catalog/repository (CI: .github/workflows/codeql.yml)

Expected behavior

The CodeQL jobs check out only what they analyze: the repository sources, scripts, tests and .github/. Without artifacts/ the tree is about 80 MB, so the checkout should take a few seconds and the required check should finish about a minute sooner.

Actual behavior

From the pull_request runs between 8 and 22 October 2026 (1,156 runs, 320 heads):

Check Median Of which checkout
Analyze javascript-typescript 4.3 min about 1.5 min
Analyze actions 2.3 min about 1.5 min

The checkout is actions/checkout with its defaults (depth 1, no sparse patterns), so it fetches every blob at HEAD. The HEAD tree is 2.54 GB, of which artifacts/ is 2.46 GB in 888 zips. A full-history fetch (fetch-depth: 0, used by Pull Request Checks) takes 35–50 s because the server reuses its packs; the shallow fetch here is slower, at about 90 s, because the server builds the pack on the fly. The tree size, not the history, is the cost.

Analyze javascript-typescript is the slowest required check, so every pull request waits for it before it can merge.

Steps to reproduce

  1. Open any pull request into staging.
  2. Open the Analyze javascript-typescript run and expand "Checkout repository": about 90 s.
  3. Compare with du -sh artifacts/ (2.46 GB) and the rest of the tree (about 80 MB).

Environment

  • Marinara Engine version: n/a
  • Package version: n/a
  • Install type: other (GitHub Actions, ubuntu-latest)
  • OS + version: ubuntu-latest runner
  • Browser or app shell: n/a

Logs, screenshots, or video

Run durations were read from the Actions API (/actions/runs?event=pull_request and each run's /jobs).

Additional context

Minimal fix

.github/workflows/codeql.yml, "Checkout repository" step: add a sparse checkout that excludes artifacts/.

with:
  persist-credentials: false
  sparse-checkout: |
    /*
    !/artifacts/
  sparse-checkout-cone-mode: false

When sparse-checkout is set, actions/checkout fetches with --filter=blob:none and the checkout only downloads the blobs the patterns select, so the zips are never transferred. Non-cone mode is needed because cone mode can only include directories, not exclude one.

CodeQL's javascript-typescript extractor scans source files and actions scans .github/workflows; neither reads zips, so the analysis is unchanged. Keep the workflow running on every pull request: a required check that is skipped by a paths filter blocks the merge instead of speeding it up.

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @Promansis on GitHub (Oct 22, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1578 Originally assigned to: @SpicyMarinara, @Promansis on GitHub. ## Summary `Analyze javascript-typescript` is the slowest required check on every pull request, and about a third of its time is the checkout. The job checks out `artifacts/`, 2.46 GB of package zips that CodeQL never reads. ## Affected package catalog/repository (CI: `.github/workflows/codeql.yml`) ## Expected behavior The CodeQL jobs check out only what they analyze: the repository sources, scripts, tests and `.github/`. Without `artifacts/` the tree is about 80 MB, so the checkout should take a few seconds and the required check should finish about a minute sooner. ## Actual behavior From the `pull_request` runs between 8 and 22 October 2026 (1,156 runs, 320 heads): | Check | Median | Of which checkout | | --- | --- | --- | | Analyze javascript-typescript | 4.3 min | about 1.5 min | | Analyze actions | 2.3 min | about 1.5 min | The checkout is `actions/checkout` with its defaults (depth 1, no sparse patterns), so it fetches every blob at HEAD. The HEAD tree is 2.54 GB, of which `artifacts/` is 2.46 GB in 888 zips. A full-history fetch (`fetch-depth: 0`, used by Pull Request Checks) takes 35–50 s because the server reuses its packs; the shallow fetch here is slower, at about 90 s, because the server builds the pack on the fly. The tree size, not the history, is the cost. `Analyze javascript-typescript` is the slowest required check, so every pull request waits for it before it can merge. ## Steps to reproduce 1. Open any pull request into `staging`. 2. Open the `Analyze javascript-typescript` run and expand "Checkout repository": about 90 s. 3. Compare with `du -sh artifacts/` (2.46 GB) and the rest of the tree (about 80 MB). ## Environment - Marinara Engine version: n/a - Package version: n/a - Install type: other (GitHub Actions, `ubuntu-latest`) - OS + version: `ubuntu-latest` runner - Browser or app shell: n/a ## Logs, screenshots, or video Run durations were read from the Actions API (`/actions/runs?event=pull_request` and each run's `/jobs`). ## Additional context ### Minimal fix `.github/workflows/codeql.yml`, "Checkout repository" step: add a sparse checkout that excludes `artifacts/`. ```yaml with: persist-credentials: false sparse-checkout: | /* !/artifacts/ sparse-checkout-cone-mode: false ``` When `sparse-checkout` is set, `actions/checkout` fetches with `--filter=blob:none` and the checkout only downloads the blobs the patterns select, so the zips are never transferred. Non-cone mode is needed because cone mode can only include directories, not exclude one. CodeQL's `javascript-typescript` extractor scans source files and `actions` scans `.github/workflows`; neither reads zips, so the analysis is unchanged. Keep the workflow running on every pull request: a required check that is skipped by a `paths` filter blocks the merge instead of speeding it up. ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Agents#1553
No description provided.