- Notifications
You must be signed in to change notification settings - Fork373
Allow using new CodeQL languages without updating the CodeQL Action#2914
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Pull Request Overview
This PR updates language handling to rely on the CodeQL CLI for alias resolution and tracing detection, renames theLanguage
enum toKnownLanguage
, simplifies parsing logic inconfig-utils.ts
, and adds async utilities.
- Introduce
asyncFilter
/asyncSome
inutil.js
for async predicate operations. - Replace sync tracing checks with async file-based checks (
isTracedLanguage
) and use them throughout. - Remove hardcoded
Language
enum in favor ofKnownLanguage
and drive parsing via the CLI (betterResolveLanguages
→getSupportedLanguageMap
).
Reviewed Changes
Copilot reviewed 60 out of 60 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
lib/util.js | AddedasyncFilter andasyncSome helpers. |
lib/languages.js | Dropped oldLanguage enum and parsing, now only exportsKnownLanguage . |
lib/start-proxy.js | NewparseLanguage implementation with alias support. |
lib/tracer-config.js | SwitchedshouldEnableIndirectTracing to async language checks. |
lib/config-utils.js | SimplifiedgetLanguages /getRawLanguages , renamed some exports. |
lib/codeql.js | AddedisTracedLanguage ,isScannedLanguage , andgetSupportedLanguageMap . |
lib/autobuild.js | Updated to use async tracing checks; refactored parameter order. |
Tests (various) | Updated to useKnownLanguage , added new async stubs. |
Comments suppressed due to low confidence (2)
lib/autobuild.js:61
- Checking
if (!autobuildLanguages)
will never catch the case whereautobuildLanguages
is an empty array because an empty array is truthy. Replace this withif (autobuildLanguages.length === 0)
to correctly handle no-trace languages.
if (!autobuildLanguages) {
lib/start-proxy.test.js:115
- [nitpick] Add tests for the remaining aliases defined in
LANGUAGE_ALIASES
, such as"javascript-typescript"
→KnownLanguage.javascript
and"java-kotlin"
→KnownLanguage.java
, to ensure full coverage of alias mappings.
t.deepEqual((0, start_proxy_1.parseLanguage)("typescript"), languages_1.KnownLanguage.javascript);
This PR revives#779, adding a few new features:
tracing-config.lua
file — this is what we do in the CLI tooconfig-utils.ts
Commit-by-commit review recommended as one commit has a large diff from renaming the
Language
enum toKnownLanguage
.Caveats:
start-proxy
Action generic, because this Action can't assume access to the CodeQL CLI, which is the source of truth. However this is probably OK because the default behaviour of this Action, i.e. not to proxy anything, is OK for new languages.Merge / deployment checklist