Skip to content

Rust: Remove sourceModelDeprecated, summaryModelDeprecated and sinkModelDeprecated #20109

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 5 commits into from
Jul 23, 2025

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jul 23, 2025

This PR removes the deprecated extensible predicates from CodeQL for Rust as requested in the issue.

Changes Made

Removed deprecated extensible predicates:

  • sourceModelDeprecated - deprecated predicate for flow sources with crate parameter
  • sinkModelDeprecated - deprecated predicate for flow sinks with crate parameter
  • summaryModelDeprecated - deprecated predicate for flow summaries with crate parameter

Removed associated classes that used deprecated predicates:

  • SummarizedCallableFromModelDeprecated - flow summary class using deprecated predicate
  • FlowSourceFromModelDeprecated - flow source class using deprecated predicate
  • FlowSinkFromModelDeprecated - flow sink class using deprecated predicate

Updated supporting code:

  • Cleaned up interpretModelForTest predicate to only reference non-deprecated predicates
  • Updated empty.model.yml to remove deprecated extensible references

Files Modified

  • rust/ql/lib/codeql/rust/dataflow/internal/ModelsAsData.qll - removed deprecated predicates and classes
  • rust/ql/lib/codeql/rust/dataflow/internal/empty.model.yml - removed deprecated extensible entries

Verification

✅ Confirmed no remaining references to deprecated predicates exist in the codebase
✅ Confirmed all non-deprecated functionality (sourceModel, sinkModel, summaryModel) remains intact
✅ Verified exactly 3 extensible predicates and 3 YAML entries remain for the non-deprecated versions

The non-deprecated predicates provide the same functionality without the crate parameter, which aligns with the newer API design.

Fixes #20108.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: geoffw0 <40627776+geoffw0@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] Rust: Remove sourceModelDeprecated, summaryModelDeprecated and sinkModelDeprecated. Rust: Remove sourceModelDeprecated, summaryModelDeprecated and sinkModelDeprecated Jul 23, 2025
@Copilot Copilot AI requested a review from geoffw0 July 23, 2025 08:51
Copilot finished work on behalf of geoffw0 July 23, 2025 08:51
@geoffw0
Copy link
Contributor

geoffw0 commented Jul 23, 2025

Changes LGTM. I will approve CI workflows and start a small DCA run, then seek formal approval from another team member.

@github-actions github-actions bot added the Rust Pull requests that update Rust code label Jul 23, 2025
@geoffw0
Copy link
Contributor

geoffw0 commented Jul 23, 2025

Hi Copilot, are you able to run the QL autoformatter (codeql query format [file] --in-place) on ModelsAsData.qll?

Co-authored-by: geoffw0 <40627776+geoffw0@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jul 23, 2025

Hi Copilot, are you able to run the QL autoformatter (codeql query format [file] --in-place) on ModelsAsData.qll?

Applied QL autoformatter to ModelsAsData.qll file. The formatter cleaned up extra blank lines between code sections. Changes are in commit 2cc732e.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/github/codeql-cli-binaries/releases/latest
    • Triggering command: curl -s REDACTED (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot finished work on behalf of geoffw0 July 23, 2025 09:39
@geoffw0
Copy link
Contributor

geoffw0 commented Jul 23, 2025

@copilot that's great. Please could you also add concise instructions to the .github/copilot-instructions.md (which forms part of your future prompts) explaining:

  • that all edited .ql and .qll files should be autoformatted afterwards.
  • how you installed the CodeQL CLI codeql-linux64.zip and ran the autoformatter.

Co-authored-by: geoffw0 <40627776+geoffw0@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jul 23, 2025

@copilot that's great. Please could you also add concise instructions to the .github/copilot-instructions.md (which forms part of your future prompts) explaining:

  • that all edited .ql and `.ql...

Added concise instructions to .github/copilot-instructions.md explaining how to autoformat .ql and .qll files using the CodeQL CLI. The instructions include step-by-step installation of codeql-linux64.zip and usage of the autoformatter. Changes are in commit 7f8b70e4.

Copilot finished work on behalf of geoffw0 July 23, 2025 10:09
@geoffw0
Copy link
Contributor

geoffw0 commented Jul 23, 2025

Oh one last thing, lets have a change note in rust/ql/lib/change-notes stating that the deprecated predicates have been removed. The change note should be formatted similarly to the existing change note in that directory, it should be very concise, and category: minorAnalysis.

Co-authored-by: geoffw0 <40627776+geoffw0@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jul 23, 2025

Oh one last thing, lets have a change note in rust/ql/lib/change-notes stating that the deprecated predicates have been removed. The change note should be formatted similarly to the existing change...

Added concise change note in rust/ql/lib/change-notes/ documenting the removal of deprecated dataflow predicates with category: minorAnalysis as requested. Changes are in commit defd4a1.

Copilot finished work on behalf of geoffw0 July 23, 2025 10:42
@geoffw0 geoffw0 marked this pull request as ready for review July 23, 2025 11:54
@Copilot Copilot AI review requested due to automatic review settings July 23, 2025 11:54
@geoffw0 geoffw0 requested a review from a team as a code owner July 23, 2025 11:54
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

This PR removes deprecated extensible predicates from CodeQL for Rust's dataflow library, specifically eliminating the sourceModelDeprecated, sinkModelDeprecated, and summaryModelDeprecated predicates that included a crate parameter in favor of their non-deprecated counterparts.

  • Removes three deprecated extensible predicates and their associated classes that used the old API with crate parameters
  • Cleans up the empty model YAML file to remove references to deprecated extensibles
  • Updates test interpretation logic to only reference non-deprecated predicates

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
rust/ql/lib/codeql/rust/dataflow/internal/ModelsAsData.qll Removes deprecated predicates, classes, and updates test predicate
rust/ql/lib/codeql/rust/dataflow/internal/empty.model.yml Removes deprecated extensible entries from model file
rust/ql/lib/change-notes/2025-07-23-remove-deprecated-dataflow-predicates.md Adds change note documenting the removal
.github/copilot-instructions.md Adds CodeQL CLI autoformatting instructions (unrelated to main changes)

@geoffw0
Copy link
Contributor

geoffw0 commented Jul 23, 2025

Code changes and DCA run LGTM. Ready for review by a third party.

Copy link
Contributor

@paldepind paldepind left a comment

Choose a reason for hiding this comment

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

LGTM!

@geoffw0 geoffw0 merged commit 91ced7e into main Jul 23, 2025
20 checks passed
@geoffw0 geoffw0 deleted the copilot/fix-20108 branch July 23, 2025 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Rust Pull requests that update Rust code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rust: Remove sourceModelDeprecated, summaryModelDeprecated and sinkModelDeprecated.
3 participants