Rust: Add new MaD format based on QL-computed canonical paths#19790
Merged
hvitved merged 3 commits intogithub:mainfrom Jun 18, 2025
Merged
Rust: Add new MaD format based on QL-computed canonical paths#19790hvitved merged 3 commits intogithub:mainfrom
hvitved merged 3 commits intogithub:mainfrom
Conversation
32ed987 to
ad9cadc
Compare
ad9cadc to
63379df
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
Introduce a new “MaD” model format that uses QL-computed canonical paths by deprecating the old crate-qualified extensible predicates and adding new 5-column predicates without the crate parameter.
- Rename existing
sourceModel,sinkModel, andsummaryModelpredicates to*Deprecated. - Add new 5-field extensible predicates (
sourceModel,sinkModel,summaryModel) that omit thecrateparameter. - Update all
.ext.ymlmodel files, tests, expected outputs, and QLL logic to use the new format and preserve the deprecated predicates.
Reviewed Changes
Copilot reviewed 102 out of 102 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| rust/ql/test/utils-tests/modelgenerator/CaptureSourceModels.ext.yml | Switch from sourceModel to sourceModelDeprecated |
| rust/ql/test/utils-tests/modelgenerator/CaptureSinkModels.ext.yml | Switch from sinkModel to sinkModelDeprecated |
| rust/ql/test/library-tests/dataflow/models/models.ext.yml | Replace repo::test entries with canonical main::… and 5-field records |
| rust/ql/test/library-tests/dataflow/models/models.expected | Update expected output to match new canonical paths |
| rust/ql/lib/codeql/rust/frameworks/url.model.yml | Deprecate summaryModel extension |
| rust/ql/lib/codeql/rust/frameworks/tokio/net.model.yml | Deprecate sourceModel and summaryModel extensions |
| rust/ql/lib/codeql/rust/frameworks/tokio/io.model.yml | Deprecate sourceModel and summaryModel extensions |
| rust/ql/lib/codeql/rust/frameworks/tokio/fs.model.yml | Deprecate sourceModel extension |
| rust/ql/lib/codeql/rust/frameworks/tokio-postgres.model.yml | Deprecate sinkModel and sourceModel extensions |
| rust/ql/lib/codeql/rust/frameworks/stdlib/net.model.yml | Deprecate sourceModel and summaryModel extensions |
| rust/ql/lib/codeql/rust/frameworks/stdlib/lang-core.model.yml | Deprecate summaryModel, sourceModel, and sinkModel |
| rust/ql/lib/codeql/rust/frameworks/stdlib/lang-alloc.model.yml | Deprecate sourceModel, sinkModel, and summaryModel |
| rust/ql/lib/codeql/rust/frameworks/stdlib/io.model.yml | Deprecate sourceModel and summaryModel extensions |
| rust/ql/lib/codeql/rust/frameworks/stdlib/fs.model.yml | Deprecate sourceModel, sinkModel, and summaryModel |
| rust/ql/lib/codeql/rust/frameworks/stdlib/env.model.yml | Deprecate sourceModel extension |
| rust/ql/lib/codeql/rust/frameworks/rustls.model.yml | Deprecate sourceModel and summaryModel extensions |
| rust/ql/lib/codeql/rust/frameworks/rustcrypto/rustcrypto.model.yml | Deprecate sinkModel extension |
| rust/ql/lib/codeql/rust/frameworks/rusqlite.model.yml | Deprecate sinkModel and sourceModel extensions |
| rust/ql/lib/codeql/rust/frameworks/reqwest.model.yml | Deprecate sourceModel, sinkModel, and summaryModel |
| rust/ql/lib/codeql/rust/frameworks/regex.model.yml | Deprecate summaryModel extension |
| rust/ql/lib/codeql/rust/frameworks/postgres.model.yml | Deprecate sinkModel extension |
| rust/ql/lib/codeql/rust/frameworks/log.model.yml | Deprecate sinkModel extension |
| rust/ql/lib/codeql/rust/frameworks/libc.model.yml | Deprecate sourceModel and sinkModel extensions |
| rust/ql/lib/codeql/rust/frameworks/http.model.yml | Deprecate sourceModel extension |
| rust/ql/lib/codeql/rust/frameworks/futures.model.yml | Deprecate summaryModel extension |
| rust/ql/lib/codeql/rust/frameworks/async-rs.model.yml | Deprecate sourceModel extension |
| rust/ql/lib/codeql/rust/dataflow/internal/empty.model.yml | Add empty definitions for all *Deprecated predicates |
| rust/ql/lib/codeql/rust/dataflow/internal/ModelsAsData.qll | Rename and overload extensible predicates; adjust signatures |
| rust/ql/lib/codeql/rust/dataflow/internal/FlowSummaryImpl.qll | Add callResolvesTo helper predicate |
| rust/ql/lib/codeql/rust/dataflow/internal/DataFlowConsistency.qll | Remove obsolete consistency queries |
Comments suppressed due to low confidence (2)
rust/ql/lib/codeql/rust/dataflow/internal/ModelsAsData.qll:236
callResolvesTois defined to take a singlepathargument, but here it's called with two arguments (crate,path). Update the call tothis.callResolvesTo(path).
this.callResolvesTo(crate, path)
rust/ql/lib/codeql/rust/dataflow/internal/ModelsAsData.qll:269
callResolvesTois defined to take a singlepathargument, but here it's called with two arguments (crate,path). Update the call tothis.callResolvesTo(path).
this.callResolvesTo(crate, path)
41d3360 to
c88a504
Compare
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.
It is not possible to overload
extensiblepredicates, so the existing predicates have been suffixed withDeprecated; once all existing models have been migrated to the new format, we can get rid of the deprecated predicates.