-
Notifications
You must be signed in to change notification settings - Fork 388
Enable resolving languages without CodeQL CLI #3116
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 our terms of service and privacy 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?
Conversation
This workflow checks that src/resolved-languages.json exists and is up-to-date with respect to the default (linked) CodeQL version.
This commit fixes the BetterResolveLanguagesOutput interface, which currently defines the `extractors` map values as tuples: [ { extractor_root: string; ... }, ] Instead of arrays (which are what the CodeQL CLI produces): Array<{ extractor_root: string; ... }>
d2d866e
to
376055c
Compare
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 adds functionality to resolve supported languages without requiring the CodeQL CLI to be available. It introduces getStoredSupportedLanguageMap()
function and refactors the existing language resolution logic to support both CLI-based and stored language maps.
Key changes:
- Added a stored language map functionality using a static JSON file
- Refactored
getLanguages()
to accept a pre-computed language map instead of generating it internally - Added validation workflow to ensure the stored language data stays current
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
src/resolved-languages.json | New static file containing pre-resolved language and extractor information |
src/config-utils.ts | Added getStoredSupportedLanguageMap() , refactored getLanguages() signature, and extracted buildSupportedLanguageMap() helper |
src/config-utils.test.ts | Updated test calls to match new getLanguages() signature |
src/codeql.ts | Updated BetterResolveLanguagesOutput interface to use consistent array type |
lib/init-action.js | Generated JavaScript reflecting the TypeScript changes |
.github/workflows/validate-resolved-languages.yml | New workflow to validate the stored language file stays current |
@@ -27,6 +27,7 @@ import { | |||
OverlayDatabaseMode, | |||
} from "./overlay-database-utils"; | |||
import { RepositoryNwo } from "./repository"; | |||
import * as resolvedLanguages from "./resolved-languages.json"; |
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.
The import statement assumes the JSON file will always be valid. Consider adding runtime validation to ensure the imported data conforms to the expected BetterResolveLanguagesOutput
structure, or handling potential parsing errors gracefully.
Copilot uses AI. Check for mistakes.
This PR adds
getStoredSupportedLanguageMap()
and refactorsgetLanguages()
so that theinit
action can get the list of supported languages (along with their aliases) even when the CodeQL CLI is unavailable.getStoredSupportedLanguageMap()
is currently unused. It will be used in a future PR.Risk assessment
For internal use only. Please select the risk level of this change:
Merge / deployment checklist