Skip to content

ci(codeql): trigger push analysis on TypeScript paths, not Python - #67

Merged
c-vigo merged 1 commit into
devfrom
bugfix/61-codeql-ts-paths
Jul 14, 2026
Merged

c-vigo merged 1 commit into
devfrom
bugfix/61-codeql-ts-paths

Conversation

@c-vigo

@c-vigo c-vigo commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

The push trigger's paths filter still carried the Python scaffold's **.py, so push-to-main CodeQL analysis never fired for the TypeScript source this repo ships (cf5e93f switched the language matrix but left the filter).

Filter on **.ts, **.js, package*.json, and workflow files instead. Marked as a LOCAL FIX divergence from the devkit scaffold, tracked upstream by vig-os/devkit#1027 / vig-os/devkit#1039.

Closes #61

The push trigger's paths filter still carried the Python scaffold's '**.py',
a leftover from the devkit CodeQL workflow. cf5e93f pointed the language
matrix at javascript-typescript but left this filter, so push-to-main
analysis never fired for the TypeScript source this repo ships.

Filter on the paths that matter here: '**.ts', '**.js', 'package*.json', and
workflow files. Marked as a LOCAL FIX divergence from the scaffold; the
upstream fix is tracked by the language-aware scaffold work in
vig-os/devkit#1027 / vig-os/devkit#1039.

Refs: #61
@c-vigo
c-vigo merged commit 4db0683 into dev Jul 14, 2026
9 checks passed
@c-vigo
c-vigo deleted the bugfix/61-codeql-ts-paths branch July 14, 2026 09:25
c-vigo added a commit to vig-os/devkit that referenced this pull request Jul 16, 2026
## Description

`render_codeql_matrix()` (`assets/init-workspace.sh`) rewrites the
CodeQL
`language:` matrix per detected language (#1025) but left the
push-to-main
trigger's `paths:` filter hardcoded to `**.py`. On a Node consumer, a
push
touching only TS/JS therefore never fired the post-merge CodeQL scan —
only the
unfiltered PR trigger caught it. And because `codeql.yml` is a managed
file,
consumer hand-fixes (e.g. commit-action's `**.ts` patch,
vig-os/commit-action#67)
were silently reverted on every devkit upgrade.

## Type of Change

- [x] `fix` -- Bug fix

## Changes Made

- Extend `render_codeql_matrix()` to build the push `paths:` list from
the same
  language detection it already uses for the matrix:
  - python → `'**.py'`
  - node → `'**.ts'`, `'**.js'`, `'**.mjs'`, `'**.cjs'`
  - rust → no source globs (CodeQL ships no Rust analyzer)
  - the `'.github/workflows/**'` catch-all is always kept
  - marker-less repos get a workflows-only filter
- Rewrite the `paths:` block with `awk` (the item count varies per
language, so
a single `sed` line-replace can't do it); the language matrix render is
  unchanged.
- Regression bats tests for node / python / rust / marker-less
consumers.

## Changelog Entry

### Fixed
- **Render CodeQL push `paths:` filter per detected language**
([#1142](#1142))
  - full entry in `CHANGELOG.md` under `## Unreleased`.

## Testing

- [x] Tests pass locally (`just test`)
- [x] Manual testing performed (describe below)

### Manual Testing Details

- `bats tests/bats/init-workspace.bats` → 212/212 pass (4 new #1142
tests + the
  existing #1025 matrix tests).
- Scaffolded a throwaway Node consumer and confirmed the rendered
`on.push.paths`
block lists `**.ts`/`**.js`/`**.mjs`/`**.cjs` + `.github/workflows/**`
with
  clean YAML indentation.
- `shellcheck -x assets/init-workspace.sh` clean; full `prek run
--all-files` green.

## Checklist

- [x] My code follows the project's style guidelines
- [x] I have performed a self-review of my code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have updated `CHANGELOG.md` in the `[Unreleased]` section (and
pasted the entry above)
- [x] My changes generate no new warnings or errors
- [x] I have added tests that prove my fix is effective
- [x] New and existing unit tests pass locally with my changes

## Additional Notes

Found during the sync-issues-action deploy recon — affects every
JS-action
consumer (commit-action today, sync-issues-action next). With this
merged,
deploys no longer need to re-patch `codeql.yml` by hand after each
scaffold sync.

Closes #1142

Refs: #1142
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