Skip to content

Rust: Add new MaD format based on QL-computed canonical paths #19790

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

Merged
merged 3 commits into from
Jun 18, 2025

Conversation

hvitved
Copy link
Contributor

@hvitved hvitved commented Jun 17, 2025

It is not possible to overload extensible predicates, so the existing predicates have been suffixed with Deprecated; once all existing models have been migrated to the new format, we can get rid of the deprecated predicates.

@github-actions github-actions bot added the Rust Pull requests that update Rust code label Jun 17, 2025
@hvitved hvitved force-pushed the rust/new-mad-format branch 2 times, most recently from 32ed987 to ad9cadc Compare June 18, 2025 10:12
@hvitved hvitved force-pushed the rust/new-mad-format branch from ad9cadc to 63379df Compare June 18, 2025 10:14
@hvitved hvitved marked this pull request as ready for review June 18, 2025 10:50
@Copilot Copilot AI review requested due to automatic review settings June 18, 2025 10:50
@hvitved hvitved requested a review from a team as a code owner June 18, 2025 10:50
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

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, and summaryModel predicates to *Deprecated.
  • Add new 5-field extensible predicates (sourceModel, sinkModel, summaryModel) that omit the crate parameter.
  • Update all .ext.yml model 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

  • callResolvesTo is defined to take a single path argument, but here it's called with two arguments (crate, path). Update the call to this.callResolvesTo(path).
    this.callResolvesTo(crate, path)

rust/ql/lib/codeql/rust/dataflow/internal/ModelsAsData.qll:269

  • callResolvesTo is defined to take a single path argument, but here it's called with two arguments (crate, path). Update the call to this.callResolvesTo(path).
    this.callResolvesTo(crate, path)

@hvitved hvitved force-pushed the rust/new-mad-format branch from 41d3360 to c88a504 Compare June 18, 2025 11:16
Copy link
Contributor

@redsun82 redsun82 left a comment

Choose a reason for hiding this comment

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

🚀

@hvitved hvitved merged commit ee9ceb5 into github:main Jun 18, 2025
16 checks passed
@hvitved hvitved deleted the rust/new-mad-format branch June 18, 2025 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Rust Pull requests that update Rust code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants