Skip to content

Commit 54c268b

Browse files
felickzCopilot
andauthored
Add JavaScript, Ruby, and C++ extension packs (#254)
Add an empty data extension pack (<language>/ext) for JavaScript, Ruby and C++, like the Rust one, so that models can be contributed for these languages. Build and publish them in the extensions jobs, add them to the publish summary, make the test packs depend on them, and list them in CONTRIBUTING.md. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4124a708-0b20-41df-a2e2-c945fbf86752
1 parent 61d7f9a commit 54c268b

16 files changed

Lines changed: 58 additions & 7 deletions

File tree

‎.github/scripts/build-publish-summary.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ TYPES=(src lib ext ext-library-sources)
4040
# have no shared library use cases and should not produce empty placeholder packs.
4141
LIB_LANGUAGES=(cpp csharp go java javascript python ruby)
4242
# Languages with an `ext` (model/extension) pack - matches the `extensions` job's matrix.
43-
EXT_LANGUAGES=(csharp go java python rust)
43+
EXT_LANGUAGES=(cpp csharp go java javascript python ruby rust)
4444
# Languages with an `ext-library-sources` pack - matches the `library_sources_extensions`
4545
# job's matrix. This is a strict subset of EXT_LANGUAGES: go/python ship `ext` packs but
4646
# have no `ext-library-sources` pack, so they must not be expected to have a result for it.

‎.github/workflows/ci.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ jobs:
266266
strategy:
267267
fail-fast: false
268268
matrix:
269-
language: [ 'csharp', 'go', 'java', 'python', 'rust' ]
269+
language: [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby', 'rust' ]
270270

271271
steps:
272272
- uses: actions/checkout@v7

‎.github/workflows/publish.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ jobs:
211211
strategy:
212212
fail-fast: false
213213
matrix:
214-
language: ["csharp", "go", "java", "python", "rust"]
214+
language: ["cpp", "csharp", "go", "java", "javascript", "python", "ruby", "rust"]
215215

216216
steps:
217217
- uses: actions/checkout@v7

‎CONTRIBUTING.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ instead of, or alongside, a query change.
7272

7373
1. **Pick the right pack: `ext` vs `ext-library-sources`**
7474

75-
Every language with data-extension support has a `<language>/ext` pack (`csharp`/`go`/`java`/
76-
`python`/`rust`). Two of those languages additionally have a second, narrower pack,
75+
Every language with data-extension support has a `<language>/ext` pack (`cpp`/`csharp`/`go`/`java`/
76+
`javascript`/`python`/`ruby`/`rust`). Two of those languages additionally have a second, narrower pack,
7777
`<language>/ext-library-sources` (`csharp`/`java` only). They hold different *kinds* of models,
7878
and picking the right one matters:
7979

@@ -313,7 +313,7 @@ process for each; most of it is manual today.
313313
[`publish.yml`][publish-workflow] is organized as five jobs: four publish jobs, one per pack type
314314
(`queries` for `src`, `library` for `lib`, `extensions` for `ext`, `library_sources_extensions` for
315315
`ext-library-sources`), each matrixed over every language that has that pack type
316-
(`src` includes Actions, Rust, and Swift; `lib` is only created where there is shared library code; `ext` runs for `csharp`/`go`/`java`/`python`/`rust`; `ext-library-sources` only runs for `csharp`/`java`, the only languages with that pack) - plus a fifth
316+
(`src` includes Actions, Rust, and Swift; `lib` is only created where there is shared library code; `ext` runs for `cpp`/`csharp`/`go`/`java`/`javascript`/`python`/`ruby`/`rust`; `ext-library-sources` only runs for `csharp`/`java`, the only languages with that pack) - plus a fifth
317317
`summary` job that runs after the other four (`if: always()`, so it still runs even if one of them
318318
fails), aggregates their per-pack results into the publish-summary and CodeQL library/query pack
319319
version tables, and (on the release-cut `push` trigger only) upserts both tables into the GitHub
@@ -350,7 +350,7 @@ To ship a change:
350350

351351
- [ ] Make your change in the pack directory you intend to publish: `<language>/src` (queries),
352352
`<language>/lib` (shared library code, only where needed), `<language>/ext` (extensions,
353-
`csharp`/`go`/`java`/`python`/`rust`),
353+
`cpp`/`csharp`/`go`/`java`/`javascript`/`python`/`ruby`/`rust`),
354354
or `<language>/ext-library-sources` (extensions, `csharp`/`java` only). See [Adding a data
355355
extension](#adding-a-data-extension) above if you're not sure which extensions pack to use.
356356
- [ ] Bump `version:` in that pack's `qlpack.yml`, following [semver](https://semver.org/). Only bump

‎cpp/ext/generated/.gitkeep‎

Whitespace-only changes.

‎cpp/ext/manual/.gitkeep‎

Whitespace-only changes.

‎cpp/ext/qlpack.yml‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
library: true
2+
name: githubsecuritylab/codeql-cpp-extensions
3+
version: 0.9.0
4+
# Keep this '*' (unconstrained) - never pin/floor it to a specific
5+
# codeql/cpp-all version. Unlike `dependencies:`, an unsatisfied
6+
# extensionTargets constraint doesn't fail loudly: it silently drops this
7+
# whole extension pack (zero models applied) with only a low-visibility
8+
# "is unused" warning, no CI signal for downstream consumers. See
9+
# GitHubSecurityLab/CodeQL-Community-Packs#206 and CONTRIBUTING.md.
10+
extensionTargets:
11+
codeql/cpp-all: '*'
12+
dataExtensions:
13+
- 'manual/*.yml'
14+
- 'manual/**/*.yml'
15+
- 'generated/*.yml'
16+
- 'generated/**/*.yml'

‎cpp/test/qlpack.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ dependencies:
55
codeql/cpp-queries: '1.10.0'
66
githubsecuritylab/codeql-cpp-queries: '*'
77
githubsecuritylab/codeql-cpp-libs: '*'
8+
githubsecuritylab/codeql-cpp-extensions: '*'
89
extractor: cpp
910
tests: .

‎javascript/ext/generated/.gitkeep‎

Whitespace-only changes.

‎javascript/ext/manual/.gitkeep‎

Whitespace-only changes.

0 commit comments

Comments
 (0)