Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions .ado/codeql-variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ variables:
# Keeps third-party, test and benchmark code out of the interpreted-language
# CodeQL database (JavaScript, Python, Actions). Without it, the deeply
# nested expressions in test/Parser overflow the JavaScript extractor's stack
# and the whole database fails. The extractors read this variable from the
# environment; traced C++ builds ignore it. Keep the paths in sync with
# .github/codeql/codeql-config.yml.
# and the whole database fails. tools/hermes-parser (upstream Flow-syntax
# tooling) and the header and footer fragments only produce parse errors.
# The extractors read this variable from the environment; traced C++ builds
# ignore it. Keep the paths in sync with .github/codeql/codeql-config.yml
# and .github/codeql/codeql-config-javascript.yml.
- name: LGTM_INDEX_FILTERS
value: |-
exclude:external
Expand All @@ -17,3 +19,8 @@ variables:
exclude:benchmarks
exclude:.yarn
exclude:**/__tests__
exclude:tools/hermes-parser
exclude:lib/InternalJavaScript/00-header.js
exclude:lib/InternalJavaScript/99-footer.js
exclude:API/hermes/extensions/00-header.js
exclude:API/hermes/extensions/99-footer.js
23 changes: 23 additions & 0 deletions .github/codeql/codeql-config-javascript.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: hermes-windows CodeQL config for JavaScript/TypeScript

# Same as codeql-config.yml, plus `paths`. On Linux runners the JavaScript
# extractor skips folders whose names start with a dot, except .github, so
# .ado/scripts must be listed to scan our CI scripts; `.` keeps the rest of the
# repository in scope. Other languages must not use these `paths`: with them,
# the C/C++ no-build extractor finds no source files. Keep paths-ignore in sync
# with codeql-config.yml and .ado/codeql-variables.yml.
paths:
- .
- .ado/scripts
paths-ignore:
- external
- test
- unittests
- benchmarks
- .yarn
- "**/__tests__"
- tools/hermes-parser
- lib/InternalJavaScript/00-header.js
- lib/InternalJavaScript/99-footer.js
- API/hermes/extensions/00-header.js
- API/hermes/extensions/99-footer.js
10 changes: 9 additions & 1 deletion .github/codeql/codeql-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ name: hermes-windows CodeQL config
# Scan first-party code only. Vendored code, test fixtures and benchmarks are
# excluded: the deeply nested parser fixtures in test/ overflow the JavaScript
# extractor's stack, and including external/ runs the C/C++ analysis out of
# memory on a standard runner. Keep the paths in sync with
# memory on a standard runner. tools/hermes-parser is upstream tooling written
# in Flow syntax that CodeQL cannot parse, and the header and footer files are
# fragments that only parse once the build wraps other files with them. Keep
# the paths in sync with .github/codeql/codeql-config-javascript.yml and
# .ado/codeql-variables.yml.
paths-ignore:
- external
Expand All @@ -12,3 +15,8 @@ paths-ignore:
- benchmarks
- .yarn
- "**/__tests__"
- tools/hermes-parser
- lib/InternalJavaScript/00-header.js
- lib/InternalJavaScript/99-footer.js
- API/hermes/extensions/00-header.js
- API/hermes/extensions/99-footer.js
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
with:
languages: ${{ matrix.language }}
build-mode: none
config-file: ./.github/codeql/codeql-config.yml
config-file: ./.github/codeql/${{ matrix.language == 'javascript-typescript' && 'codeql-config-javascript.yml' || 'codeql-config.yml' }}

# Keep the default setup's categories so existing alerts carry over.
- uses: github/codeql-action/analyze@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1
Expand Down
5 changes: 3 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,9 @@ platform instead of only x64 and x86.

GitHub code scanning uses CodeQL advanced setup in
`.github/workflows/codeql.yml`, with no-build analysis and path exclusions in
`.github/codeql/codeql-config.yml`. Repository default setup must stay
disabled; otherwise GitHub rejects the workflow's uploads. The Azure DevOps
`.github/codeql/codeql-config.yml` (`codeql-config-javascript.yml` for
JavaScript/TypeScript, which also scans `.ado/scripts`). Repository default
setup must stay disabled; otherwise GitHub rejects the workflow's uploads. The Azure DevOps
pipelines run CodeQL 3000 through the 1ES templates. `.ado/codeql-variables.yml`
sets `LGTM_INDEX_FILTERS` to keep the same paths out of its interpreted-language
database, and `CodeQL.yml` at the repository root classifies third-party and
Expand Down
Loading