Skip to content

improvement(ci): move CodeQL off default setup onto Blacksmith - #6219

Merged
waleedlatif1 merged 2 commits into
stagingfrom
ci/codeql-advanced-setup
Aug 3, 2026
Merged

improvement(ci): move CodeQL off default setup onto Blacksmith#6219
waleedlatif1 merged 2 commits into
stagingfrom
ci/codeql-advanced-setup

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

CodeQL was running via GitHub Advanced Security default setup — no workflow file, so no control over runner, triggers, or concurrency. Result: PR scans of 30–125 min on a 4-vCPU GitHub-hosted runner, re-running on every push. PR #6183 alone burned six overlapping runs (94/96/100/100/125/93 min).

This replaces it with advanced setup. Default setup has already been disabled — the two cannot both be active.

Changes

  • Blacksmith 8-vCPU via the same CI_PROVIDER escape-hatch expression as ci.yml
  • cancel-in-progress scoped to pull_request, mirroring ci.yml:31, so push and scheduled scans still run to completion
  • Triggers: push to main + PR to main/staging + nightly safety net + workflow_dispatch
  • paths filter so doc/config-only PRs skip the run entirely
  • paths-ignore config dropping tests/mocks/fixtures: 12,716 → 11,128 extracted files
  • languages: [javascript-typescript, actions] — python dropped (7 files in the tree)
  • Draft-PR skip, persist-credentials: false, SHA-pinned actions, timeout-minutes: 60

On the language list

Default setup listed javascript, javascript-typescript and typescript. Those are aliases of one extractor (github/codeql-actionsrc/languages/builtin.json), so it was always a single analysis, not three — the logs show Extracting javascript once. Not a source of the slowness.

Prior art

Modelled on how comparable OSS repos configure this. Notably, none of n8n, cal.com, supabase, twenty, PostHog, medusa, next.js or trigger.dev commit a CodeQL workflow at all. Among those that do:

Trigger Runner Languages cancel-in-progress
elastic/kibana PR (paths, non-draft, gated) + nightly self-hosted javascript gated instead
getsentry/sentry PR (paths, !tests/**) + weekly ubuntu-latest js, python yes
immich-app/immich push + PR + weekly ubuntu-latest js, python yes
directus/directus nightly only ubuntu-latest javascript
prisma/prisma weekly only ubuntu-latest javascript
nodejs/node nightly only ubuntu-slim cpp, js, python

Kibana is the closest analogue (large TS tree) and solves it the same way: dedicated runner + aggressive paths-ignore.

Not adopted: kibana's CODEQL_EXTRACTOR_JAVASCRIPT_OPTION_SKIP_TYPES: true. It is the largest single speedup available, but a GitHub code search returns 4 hits worldwide (kibana + a fork), it is undocumented, and it weakens type-based taint tracking. Available as an escape hatch if runtimes are still unacceptable.

Verification owed

  • Confirm actual runtime on this PR (expectation ~10–20 min, unproven)
  • Confirm no SOC2/Vanta control requires the Python language or the previous cadence

@vercel

vercel Bot commented Aug 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview Aug 3, 2026 7:49pm

Request Review

@cursor

cursor Bot commented Aug 3, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
CI and CodeQL configuration only; no application runtime, auth, or data-path changes. Slightly narrower static analysis surface (excluded tests/fixtures and dropped Python) is intentional for speed, not a production behavior change.

Overview
Replaces GitHub Advanced Security default CodeQL setup with a repo-owned advanced workflow, after default setup was disabled so scans no longer run on a fixed 4-vCPU runner with overlapping PR pushes (30–125 min per run).

The new .github/workflows/codeql.yml runs javascript-typescript and actions on Blacksmith 8-vCPU via the same CI_PROVIDER expression as ci.yml, with PR-only cancel-in-progress, draft PR skip, ready_for_review trigger, path filters for JS/TS and workflow changes, nightly schedule plus workflow_dispatch, SHA-pinned CodeQL actions, and NODE_OPTIONS for heap.

.github/codeql/codeql-config.yml shrinks extraction (tests, mocks, fixtures, e2e, build artifacts, docs content) while avoiding **/test/** globs so a real Next.js API route under a test path stays in scope; Python language coverage is dropped from the matrix.

Reviewed by Cursor Bugbot for commit e29086b. Configure here.

@greptile-apps

greptile-apps Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR replaces GitHub CodeQL default setup with a repository-managed advanced setup using Blacksmith runners and scoped concurrency.

  • Adds push, pull-request, nightly, and manual scan triggers.
  • Configures JavaScript/TypeScript and GitHub Actions analysis with targeted extraction exclusions.
  • Preserves analysis of production routes named test by removing broad test-directory exclusions.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains; the previously reported production-route coverage hole is fixed by removing the broad test-directory exclusions.

Important Files Changed

Filename Overview
.github/codeql/codeql-config.yml Adds extraction exclusions while retaining coverage of production routes under directories named test; the previously reported coverage hole is fixed.
.github/workflows/codeql.yml Adds the advanced CodeQL workflow with Blacksmith runner selection, scoped cancellation, draft handling, pinned actions, and JavaScript/TypeScript plus Actions matrices.

Reviews (2): Last reviewed commit: "fix(ci): restore CodeQL coverage of the ..." | Re-trigger Greptile

Comment thread .github/codeql/codeql-config.yml Outdated
Comment thread .github/workflows/codeql.yml
Comment thread .github/workflows/codeql.yml
Default setup pinned every scan to a 4-vCPU GitHub-hosted runner with no
cancel-in-progress: PR scans ran 30-125 min and re-ran on every push (#6183
burned six overlapping runs). None of that is reachable from the settings UI,
so the config moves into the repo.

- Blacksmith 8-vCPU via the same CI_PROVIDER escape hatch as ci.yml
- cancel-in-progress scoped to pull_request so push/schedule scans finish
- push to main + PR to main/staging + nightly safety net
- paths filter so doc-only PRs skip the run entirely
- paths-ignore config drops tests/mocks/fixtures: 12,716 -> 11,128 files
- languages: javascript-typescript + actions; python dropped (7 files in tree)

Default setup has been disabled; the two cannot both be active.
Review round 1.

- Drop the '**/test/**' and '**/tests/**' globs. A `test` directory is a
  routable Next.js path segment, and those globs excluded
  apps/sim/app/api/organizations/[id]/data-drains/[drainId]/test/route.ts —
  a POST handler that authorizes, decrypts destination credentials and makes
  an outbound request. CodeQL paths-ignore has no `!` negation to carve it
  back out, and the globs only covered 76 of 12,716 files.
- Add `ready_for_review` to the pull_request activity types. It is not a
  default type, so a PR opened as a draft and later marked ready was skipped
  by the draft guard and never rescanned until the next push.
@waleedlatif1
waleedlatif1 force-pushed the ci/codeql-advanced-setup branch from 1f1b2e7 to e29086b Compare August 3, 2026 19:45
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit e29086b. Configure here.

@waleedlatif1
waleedlatif1 merged commit 09eba8a into staging Aug 3, 2026
30 checks passed
@waleedlatif1
waleedlatif1 deleted the ci/codeql-advanced-setup branch August 3, 2026 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant