-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Java/Ruby/Rust/QL: add overlayChangedFiles
relation to dbscheme
#19896
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
3a6fe71
to
b6d49dc
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.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
b6d49dc
to
2ac7bf8
Compare
2ac7bf8
to
d8574a6
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.
Looks fine to me. Just make sure to coordinate with @redsun82 to avoid conflicts with another PR that adds upgrade/downgrade scripts for Rust.
@@ -114,6 +114,10 @@ databaseMetadata( | |||
string value: string ref | |||
); | |||
|
|||
overlayChangedFiles( | |||
string path: string ref |
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.
Why string
and not @file
?
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.
Because this will be populated by the CLI from the list of changed files calculated by the CodeQL Action, which in turn uses git
to diff against the base branch, and it seems quite possible that there will be paths for files that aren't in the database and therefore don't have a @file
entity.
If we wanted to use @file
, we'd have to consider making the CLI also emit files
tuples to ensure db consistency. It seems simpler just to use strings, at the low cost of adding an extra join in the discard predicates.
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.
Ok makes sense.
Sure. Thankfully, git will complain about conflicts if that happens (it already did once since I opened this PR). |
This PR will be synchronised with a CLI change that emits
overlayChangedFiles
tuples, which will let us write more robust discard predicates (including discarding tuples from files that have been deleted in the overlay).Also, bump the
overlay_support_version
tag for Ruby, since the updated version will be used to indicate that the dbscheme contains theoverlayChangedFiles
relation.