-
Notifications
You must be signed in to change notification settings - Fork 425
Overlay: Check database metadata for overlayBaseSpecifier #3340
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
35d5d53 to
6391bd0
Compare
fd0d09f to
aff036b
Compare
|
The failing |
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 an additional validation check for overlay-base databases by running codeql resolve database and verifying the presence of an overlayBaseSpecifier key in the database metadata. This check helps ensure that only valid overlay-base databases are uploaded to the cache or used for overlay analysis.
Key changes:
- New
resolveDatabasemethod added to the CodeQL CLI interface that runscodeql resolve database --format=json - Enhanced
checkOverlayBaseDatabasefunction to validate theoverlayBaseSpecifiermetadata for each language - Test coverage added for the new validation scenario where
overlayBaseSpecifieris missing
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/codeql.ts | Added resolveDatabase method and ResolveDatabaseOutput interface to support querying database metadata |
| src/overlay-database-utils.ts | Enhanced overlay-base database validation to check for overlayBaseSpecifier using codeql resolve database |
| src/overlay-database-utils.test.ts | Added test case for missing overlayBaseSpecifier and updated test infrastructure to mock resolveDatabase |
| src/testing-utils.ts | Changed default language in createTestConfig from empty array to [KnownLanguage.java] to support tests that iterate over languages |
| lib/*.js | Auto-generated JavaScript files reflecting the TypeScript changes |
src/overlay-database-utils.ts
Outdated
| resolveDatabaseOutput === undefined || | ||
| !("overlayBaseSpecifier" in resolveDatabaseOutput) | ||
| ) { | ||
| logger.info(`${warningPrefix}: no overlayBaseSpecifier defined`); |
Copilot
AI
Dec 3, 2025
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 logging level here should be logger.warning instead of logger.info to be consistent with line 189 where a similar validation failure is logged as a warning. Validation failures that cause the function to return false should be warnings so they're visible in the logs.
| logger.info(`${warningPrefix}: no overlayBaseSpecifier defined`); | |
| logger.warning(`${warningPrefix}: no overlayBaseSpecifier defined`); |
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 info log-level is intentional. The extractor is allowed to decide not to produce an overlay-base. This will for instance happen for Go if the extractor is asked to produce an overlay-base for a traced build. In that case the Go extractor will decide not to produce an overlay-base and we shouldn't generate a warning for that case.
c96efdb to
505fdd0
Compare
505fdd0 to
c4efbda
Compare
|
Rebased on top of #3341. |
This PR adds an additional validity check for overlay-base databases before uploading an overlay-base to the actions cache or using an overlay-base for overlay analysis. The additional check consists of running
codeql resolve databaseand checking for the existence of anoverlayBaseSpecifierkey.Risk assessment
For internal use only. Please select the risk level of this change:
Which use cases does this change impact?
Workflow types:
dynamicworkflows (Default Setup, CCR, ...).Products:
analysis-kinds: code-scanning.analysis-kinds: code-quality.Environments:
github.com.How did/will you validate this change?
.test.tsfiles).If something goes wrong after this change is released, what are the mitigation and rollback strategies?
How will you know if something goes wrong after this change is released?
Are there any special considerations for merging or releasing this change?
Merge / deployment checklist