-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 flag to turn off extractor path resolution #18813
base: main
Are you sure you want to change the base?
Conversation
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.
PR Overview
This PR adds a flag to disable the extractor’s path resolution, giving users control over whether to resolve paths during extraction. The changes include adding a new enum (ResolvePaths), updating the Translator struct and constructors to accept a resolve_paths parameter, and propagating this flag via configuration files and test options.
- Introduce the ResolvePaths flag in the extractor (Yes/No).
- Update the Translator and extraction functions to conditionally skip path resolution.
- Add configuration options in YAML and Rust config to support the new flag.
- Update test files to verify behavior when path resolution is disabled.
Changes
File | Description |
---|---|
rust/ql/test/extractor-tests/canonical_path/disabled/anonymous.rs | Adds test code to verify extractor behavior with path resolution disabled. |
rust/ql/test/extractor-tests/canonical_path/disabled/regular.rs | Provides additional test coverage for the new flag. |
rust/codeql-extractor.yml | Introduces the new skip_path_resolution configuration flag. |
rust/ql/test/extractor-tests/canonical_path/disabled/options.yml | Enables the skip_path_resolution flag for testing purposes. |
rust/extractor/src/translate.rs | Updates re-exports to include the new ResolvePaths enum. |
rust/extractor/src/translate/base.rs | Adds the ResolvePaths enum, a new field in Translator, and conditional checks to skip path resolution. |
rust/extractor/src/main.rs | Adjusts extraction function signatures and logic to pass the resolve_paths parameter. |
rust/extractor/src/config.rs | Adds the skip_path_resolution flag to the configuration structure. |
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (1)
rust/ql/test/extractor-tests/canonical_path/disabled/anonymous.rs:26
- [nitpick] Consider renaming the locally defined 'OtherStruct' in the nested function to a more descriptive name to avoid potential confusion with the 'OtherStruct' defined earlier in the file, even though they are in separate scopes.
struct OtherStruct;
Tip: Copilot only keeps its highest confidence comments to reduce noise and keep you focused. Learn more
rust/ql/test/extractor-tests/canonical_path/disabled/canonical_paths.qlref
Fixed
Show fixed
Hide fixed
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.
This looks good to me. Could you try a DCA run comparing extraction with and without this feature?
No description provided.