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.
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
Rust: Add some flow source models #18069
base: main
Are you sure you want to change the base?
Rust: Add some flow source models #18069
Changes from 9 commits
3fa93e5
ca424d1
a85ad4e
be40085
3747698
e64f139
176e9a4
292b29b
20eaaa5
ed67dae
194f967
fe2d0b6
75a3c93
d8b58f2
f2f577f
4c50c08
d38f0ee
bded708
1090164
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Check warning on line 55 in rust/ql/lib/codeql/rust/Concepts.qll
GitHub Actions / qldoc
Check warning on line 56 in rust/ql/lib/codeql/rust/Concepts.qll
GitHub Actions / qldoc
Check warning on line 68 in rust/ql/lib/codeql/rust/Concepts.qll
GitHub Actions / qldoc
Check warning on line 69 in rust/ql/lib/codeql/rust/Concepts.qll
GitHub Actions / qldoc
Check warning on line 81 in rust/ql/lib/codeql/rust/Concepts.qll
GitHub Actions / qldoc
Check warning on line 82 in rust/ql/lib/codeql/rust/Concepts.qll
GitHub Actions / qldoc
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.
@redsun82 these paths don't look right - I assume the correct path would be something like
std::env::args
orcrate::std::env::args
? They do match both what we get in the tests and what we see in real databases at the moment.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.
(fixing this will probably be follow-up work, what we have works well enough right now and is needed to get queries working)
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.
hmm, this might have to do with the prelude, I'll have a look
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.
ah, no, currently that is expected.
The thing is that a path only makes sense in the context of a crate (there is no such thing as a global concept of path across crates). So that path is the correct one relative to the std crate.
The other piece of information is the (highly non-standard and prone to be changed)
getCrateOrigin
, which giveslang:std
for the std lib.we could theoretically combine the two, it's just that while I'm quite confident of the correctness of the resolved path (up to the fact that it may not cover all entities yet), I'm still unsure about the effectiveness of
getCrateOrigin
.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. It sounds like we could check
getCrateOrigin
for models where we're worried about ambiguity ("crate::get"
makes me nervous), but perhaps not check it for cases where we aren't (e.g."crate::env::vars"
) since that will be more robust ifgetCrateOrigin
is potentially prone to change. Alternatively we could fall back on other details such as types to ensure our models are matching the right things - to the extent that we extract enough information.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.
I've push a commit adding the restriction I described above.
I've also added an agenda item next week to discuss crate origins, how we can get reliable information and how they will interact with models-as-data.
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.
@redsun82 I tried to stub
reqwest
, it has a much simpler interface thansqlx
. But I ran into a problem that it's not possible (I think) to emulate the correct paths for the library and import it into atest.rs
at the moment. When we can, we can switch to a stubbing approach forreqwest
at least.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.
(fixing this will probably be follow-up work, what we have works well enough right now)