Skip to content

Conversation

asgerf
Copy link
Contributor

@asgerf asgerf commented Aug 28, 2025

This contains some of the initial changes needed for overlay support for JavaScript and TypeScript:

  • Extractor changes
  • DBscheme and upgrade/downgrade scripts
  • Discard predicates

It does not include

  • Overlay annotations (except for discard predicates)
  • compileForOverlayEval, to be enabled separately when it does not cause a slowdown

@github-actions github-actions bot added the JS label Aug 28, 2025
@asgerf asgerf added the no-change-note-required This PR does not need a change note label Aug 29, 2025
@asgerf asgerf marked this pull request as ready for review August 29, 2025 09:48
@asgerf asgerf requested a review from a team as a code owner August 29, 2025 09:48
@Copilot Copilot AI review requested due to automatic review settings August 29, 2025 09:48
Copy link
Contributor

@Copilot Copilot AI left a 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 implements initial overlay support for JavaScript and TypeScript extractors to enable incremental analysis of codebases. It adds the necessary infrastructure for tracking file changes, discarding outdated entities, and managing database metadata while preparing for future overlay evaluation capabilities.

  • Database schema updates with overlay-specific relations and support version
  • Java extractor changes to filter extraction based on changed files and write overlay metadata
  • CodeQL library support for identifying and discarding obsolete entities in overlay scenarios

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
javascript/resources/codeql-extractor.yml Adds overlay support version configuration
javascript/ql/lib/upgrades/ccefb5e2d49318eea4aeafd4c6ae2af9f94ac72a/upgrade.properties Defines upgrade metadata for overlay relations
javascript/ql/lib/upgrades/ccefb5e2d49318eea4aeafd4c6ae2af9f94ac72a/semmlecode.javascript.dbscheme New database schema with overlay support
javascript/ql/lib/upgrades/ccefb5e2d49318eea4aeafd4c6ae2af9f94ac72a/old.dbscheme Previous database schema for upgrade comparison
javascript/ql/lib/semmlecode.javascript.dbscheme.stats Statistics for overlay relations
javascript/ql/lib/semmlecode.javascript.dbscheme Main schema with overlay metadata and changed files tables
javascript/ql/lib/semmle/javascript/internal/Overlay.qll Overlay logic for discarding outdated entities
javascript/ql/lib/javascript.qll Imports overlay support module
javascript/extractor/src/com/semmle/js/extractor/OverlayChanges.java Data class for overlay change information
javascript/extractor/src/com/semmle/js/extractor/AutoBuild.java Extractor modifications for overlay file filtering and metadata writing
javascript/downgrades/76a926a00d5f3bc199c203a1437796fd7b2835ba/upgrade.properties Downgrade configuration for overlay relations
javascript/downgrades/76a926a00d5f3bc199c203a1437796fd7b2835ba/semmlecode.javascript.dbscheme Downgrade schema without overlay support

Copy link
Contributor

@nickrolfe nickrolfe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks sensible. Have you tested that it still works when the base and overlay are extracted using different source locations, so the CLI provides a path transformer when extracting the overlay?

@asgerf
Copy link
Contributor Author

asgerf commented Sep 1, 2025

Have you tested that it still works when the base and overlay are extracted using different source locations, so the CLI provides a path transformer when extracting the overlay?

No. Does DCA test this?

@nickrolfe
Copy link
Contributor

Have you tested that it still works when the base and overlay are extracted using different source locations, so the CLI provides a path transformer when extracting the overlay?

No. Does DCA test this?

Unfortunately not, it currently uses the same source location for both. Once you have overlay compilation enabled, we can write an integration test to cover this.

For now, I tested it by manually creating an overlay database, and I can see it's working as expected. Specifically:

  • the different source location doesn't interfere with the filtering of filesToExtract.
  • paths in the TRAP are transformed appropriately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
JS no-change-note-required This PR does not need a change note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants