Skip to content

Rust: Make source kinds consistent with other languages #19333

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 2 commits into from
Apr 17, 2025

Conversation

geoffw0
Copy link
Contributor

@geoffw0 geoffw0 commented Apr 17, 2025

Make source kinds consistent with other languages and https://github.com/github/codeql/blob/main/docs/codeql/reusables/threat-model-description.rst . Somehow we ended up with different strings for environment and commandargs sources.

@geoffw0 geoffw0 added no-change-note-required This PR does not need a change note Rust Pull requests that update Rust code labels Apr 17, 2025
@Copilot Copilot AI review requested due to automatic review settings April 17, 2025 09:35
@geoffw0 geoffw0 requested a review from a team as a code owner April 17, 2025 09:35
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 pull request updates the source kind strings in the Rust standard library environment model to align with naming conventions used in other languages and the CodeQL threat model documentation.

  • Renames command-line source kinds to "commandargs".
  • Renames environment source kinds to "environment".
Files not reviewed (4)
  • rust/ql/lib/codeql/rust/Concepts.qll: Language not supported
  • rust/ql/test/query-tests/security/CWE-020/RegexInjection.expected: Language not supported
  • rust/ql/test/query-tests/security/CWE-089/SqlInjection.expected: Language not supported
  • rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected: Language not supported
Comments suppressed due to low confidence (2)

rust/ql/lib/codeql/rust/frameworks/stdlib/env.model.yml:6

  • [nitpick] The source kind 'commandargs' replaces the previous 'command-line-source'. Confirm that this naming is consistently applied across the codebase and aligns with our naming conventions as referenced in the documentation.
      - ["lang:std", "crate::env::args", "ReturnValue.Element", "commandargs", "manual"]

rust/ql/lib/codeql/rust/frameworks/stdlib/env.model.yml:11

  • [nitpick] The renaming to 'environment' updates the prior 'environment-source'. Please verify that all external references and documentation are updated to reflect this change.
      - ["lang:std", "crate::env::var", "ReturnValue.Field[crate::result::Result::Ok(0)]", "environment", "manual"]

Copy link
Contributor

@aibaars aibaars left a comment

Choose a reason for hiding this comment

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

Nice!

@geoffw0 geoffw0 merged commit 22b3ef7 into github:main Apr 17, 2025
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-change-note-required This PR does not need a change note Rust Pull requests that update Rust code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants