[PR #1580] [MERGED] ci(codeql): leave artifacts/ out of the CodeQL checkout #1574

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Agents/pull/1580
Author: @Promansis
Created: 10/22/2026
Status: ✅ Merged
Merged: 10/22/2026
Merged by: @Promansis

Base: staging ← Head: chore(ci)/1578-codeql-sparse-checkout


📝 Commits (2)

  • 664eac8 ci(codeql): leave artifacts/ out of the CodeQL checkout (#1578)
  • 887d7f9 Merge branch 'staging' into chore(ci)/1578-codeql-sparse-checkout

📊 Changes

1 file changed (+7 additions, -0 deletions)

View changed files

📝 .github/workflows/codeql.yml (+7 -0)

📄 Description

Pull request

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #1578

Why this change

  • Analyze javascript-typescript is the slowest required check on every pull request (median 4.3 min over 8–22 October), and about 90 s of it is the checkout.
  • The checkout fetches every blob at HEAD: 2.54 GB, of which artifacts/ is 2.46 GB of package zips in 888 files. CodeQL never reads them. The rest of the tree is about 80 MB.
  • Analyze actions pays the same 90 s for a 2.3 min job.

What changed

  • .github/workflows/codeql.yml, "Checkout repository": a non-cone sparse checkout that takes everything except artifacts/, with a comment saying why.
       - name: Checkout repository
         uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
         with:
           persist-credentials: false
+          sparse-checkout: |
+            /*
+            !/artifacts/
+          sparse-checkout-cone-mode: false

When sparse-checkout is set, actions/checkout fetches with --filter=blob:none, so the fetch transfers only the commit and trees, and the checkout then downloads just the blobs the patterns select. Non-cone mode is needed because cone mode can only include directories, not exclude one. The workflow still runs on every pull request: a required check skipped by a paths filter would block the merge instead of speeding it up.

Package and security impact

  • Affected package IDs: none (CI only)
  • Engine compatibility impact: none
  • New or changed permissions/entrypoints: none; the workflow's permissions are unchanged
  • Restart, storage, update, or uninstall impact: none

Validation

  • node scripts/validate-catalog.mjs passes locally
  • git diff --check passes locally
  • Rebuilt every affected manifest, payload, artifact, and catalog entry
  • Installed or updated the affected package through Marinara Engine
  • Checked supported modes, restart behavior, and uninstall cleanup
  • Read and followed CONTRIBUTING.md

Run locally on the pushed commit:

  • actionlint 1.7.7 on the workflow passes.

  • The checkout was emulated with git 2.43.0 using the same steps as actions/checkout (core.sparseCheckout=true, the two patterns in info/sparse-checkout, fetch --filter=blob:none --depth=1, checkout --force <sha>) against a local mirror of staging (96e05d42b) with uploadpack.allowFilter on, as GitHub has it:

    Stage Objects transferred
    fetch 1 commit, 485 trees, 0 blobs
    checkout 2,992 blobs, 76 MB

    Afterwards artifacts/ is absent, its 888 index entries are skip-worktree, the tree on disk is 85 MB, and .github/workflows has all 14 files. Against a server that does not allow filters the same steps fetched all 3,880 blobs (2.4 GB), which is why the saving depends on the blob:none filter rather than on the sparse patterns alone.

  • git diff --check is clean.

  • npm run check was not run: its Prettier and ESLint globs don't include .github/workflows.

CodeQL runs on pull_request, so this PR's own Analyze runs use the changed workflow and measure the saving.

Measured on this PR's first run (664eac8b0), against the 8–22 October medians:

Job Checkout before Checkout now Job before Job now
Analyze javascript-typescript about 90 s 7 s 4.3 min 2.1 min (124 s)
Analyze actions about 90 s 7 s 2.3 min 0.9 min (54 s)

Both jobs succeeded and the CodeQL check passed.

Manual verification notes

  • On this PR's Analyze javascript-typescript run, manually verify the "Checkout repository" step takes a few seconds (recent staging PRs: about 90 s) and that "Setting up sparse checkout" appears in its log.
  • Manually verify both Analyze jobs complete and upload results, with no "no source code was seen" error, and that the alert count matches a recent staging run.

Merge Danger

Door: two-way. One workflow step, fully undone by a revert.

Blast radius: the two CodeQL jobs. If the sparse checkout misbehaved, the required check would fail on every PR until reverted; no other workflow, package or artifact is touched.

Documentation impact

  • No documentation changes needed
  • Updated this README catalog and package guidance
  • Updated linked Marinara Engine documentation

UI evidence (if applicable)

Not applicable (CI only).

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Agents/pull/1580 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 10/22/2026 **Status:** ✅ Merged **Merged:** 10/22/2026 **Merged by:** [@Promansis](https://github.com/Promansis) **Base:** `staging` ← **Head:** `chore(ci)/1578-codeql-sparse-checkout` --- ### 📝 Commits (2) - [`664eac8`](https://github.com/Pasta-Devs/Marinara-Agents/commit/664eac8b0bb20669872e41e92af430887a490ac3) ci(codeql): leave artifacts/ out of the CodeQL checkout (#1578) - [`887d7f9`](https://github.com/Pasta-Devs/Marinara-Agents/commit/887d7f99ee027117c23799e12d17a97ffa67674c) Merge branch 'staging' into chore(ci)/1578-codeql-sparse-checkout ### 📊 Changes **1 file changed** (+7 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/codeql.yml` (+7 -0) </details> ### 📄 Description # Pull request > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. ## Linked issue Closes #1578 ## Why this change - `Analyze javascript-typescript` is the slowest required check on every pull request (median 4.3 min over 8–22 October), and about 90 s of it is the checkout. - The checkout fetches every blob at HEAD: 2.54 GB, of which `artifacts/` is 2.46 GB of package zips in 888 files. CodeQL never reads them. The rest of the tree is about 80 MB. - `Analyze actions` pays the same 90 s for a 2.3 min job. ## What changed - `.github/workflows/codeql.yml`, "Checkout repository": a non-cone sparse checkout that takes everything except `artifacts/`, with a comment saying why. ```diff - name: Checkout repository uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false + sparse-checkout: | + /* + !/artifacts/ + sparse-checkout-cone-mode: false ``` When `sparse-checkout` is set, `actions/checkout` fetches with `--filter=blob:none`, so the fetch transfers only the commit and trees, and the checkout then downloads just the blobs the patterns select. Non-cone mode is needed because cone mode can only include directories, not exclude one. The workflow still runs on every pull request: a required check skipped by a `paths` filter would block the merge instead of speeding it up. ## Package and security impact - Affected package IDs: none (CI only) - Engine compatibility impact: none - New or changed permissions/entrypoints: none; the workflow's permissions are unchanged - Restart, storage, update, or uninstall impact: none ## Validation - [ ] `node scripts/validate-catalog.mjs` passes locally - [ ] `git diff --check` passes locally - [ ] Rebuilt every affected manifest, payload, artifact, and catalog entry - [ ] Installed or updated the affected package through Marinara Engine - [ ] Checked supported modes, restart behavior, and uninstall cleanup - [ ] Read and followed `CONTRIBUTING.md` Run locally on the pushed commit: - `actionlint 1.7.7` on the workflow passes. - The checkout was emulated with git 2.43.0 using the same steps as `actions/checkout` (`core.sparseCheckout=true`, the two patterns in `info/sparse-checkout`, `fetch --filter=blob:none --depth=1`, `checkout --force <sha>`) against a local mirror of `staging` (96e05d42b) with `uploadpack.allowFilter` on, as GitHub has it: | Stage | Objects transferred | | --- | --- | | fetch | 1 commit, 485 trees, 0 blobs | | checkout | 2,992 blobs, 76 MB | Afterwards `artifacts/` is absent, its 888 index entries are skip-worktree, the tree on disk is 85 MB, and `.github/workflows` has all 14 files. Against a server that does not allow filters the same steps fetched all 3,880 blobs (2.4 GB), which is why the saving depends on the `blob:none` filter rather than on the sparse patterns alone. - `git diff --check` is clean. - `npm run check` was not run: its Prettier and ESLint globs don't include `.github/workflows`. CodeQL runs on `pull_request`, so this PR's own `Analyze` runs use the changed workflow and measure the saving. Measured on this PR's first run (664eac8b0), against the 8–22 October medians: | Job | Checkout before | Checkout now | Job before | Job now | | --- | --- | --- | --- | --- | | Analyze javascript-typescript | about 90 s | 7 s | 4.3 min | 2.1 min (124 s) | | Analyze actions | about 90 s | 7 s | 2.3 min | 0.9 min (54 s) | Both jobs succeeded and the `CodeQL` check passed. ### Manual verification notes - On this PR's `Analyze javascript-typescript` run, manually verify the "Checkout repository" step takes a few seconds (recent staging PRs: about 90 s) and that "Setting up sparse checkout" appears in its log. - Manually verify both `Analyze` jobs complete and upload results, with no "no source code was seen" error, and that the alert count matches a recent staging run. ## Merge Danger **Door:** two-way. One workflow step, fully undone by a revert. **Blast radius:** the two CodeQL jobs. If the sparse checkout misbehaved, the required check would fail on every PR until reverted; no other workflow, package or artifact is touched. ## Documentation impact - [ ] No documentation changes needed - [ ] Updated this README catalog and package guidance - [ ] Updated linked Marinara Engine documentation ## UI evidence (if applicable) Not applicable (CI only). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:03:18 +07:00
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#1574
No description provided.