Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The placeholder compilation lacks completion data, causing false extraction-failure diagnostics in upgraded databases.
1 open issue
What changed in this PR
This PR extends the C/C++ CodeQL schema to associate file annotations with compilations while preserving existing file-level language checks.
Changes:
- Add a compilation reference to
fileannotations. - Update C and C++ file predicates for the expanded relation.
- Add upgrade and downgrade migrations with matching schema snapshots.
| File | Description |
|---|---|
cpp/ql/lib/upgrades/293904928d857b61a44dc0ff34c89c9eccb8a90a/upgrades.ql |
Migrate existing annotations using a placeholder compilation. |
cpp/ql/lib/upgrades/293904928d857b61a44dc0ff34c89c9eccb8a90a/upgrade.properties |
Register the upgrade transformations. |
cpp/ql/lib/upgrades/293904928d857b61a44dc0ff34c89c9eccb8a90a/semmlecode.cpp.dbscheme |
Define the upgrade’s target schema. |
cpp/ql/lib/upgrades/293904928d857b61a44dc0ff34c89c9eccb8a90a/old.dbscheme |
Capture the pre-upgrade schema. |
cpp/ql/lib/semmlecode.cpp.dbscheme |
Add the compilation column to the current schema. |
cpp/ql/lib/semmle/code/cpp/File.qll |
Preserve language checks across compilations. |
cpp/downgrades/a765f5c5abd3e27f76d5c48fbd09c1b2e4c3febc/upgrade.properties |
Register the downgrade transformation. |
cpp/downgrades/a765f5c5abd3e27f76d5c48fbd09c1b2e4c3febc/old.dbscheme |
Capture the downgrade’s input schema. |
cpp/downgrades/a765f5c5abd3e27f76d5c48fbd09c1b2e4c3febc/fileannotations.ql |
Remove the compilation column for older databases. |
Review effort: Max
Comment on lines
+18
to
+19
| compilation = Fresh::map(TPlaceHolderCompilation()) and | ||
| cwd = "" |
Contributor
Author
There was a problem hiding this comment.
I think this is fine given that we only claim "partial" support.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

See internal PR. I'm omitting the change note, as this is not exposed through any QL libraries at the moment.