Rust: add option to extract dependencies as source files#19583
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
Adds a new flag to control whether dependencies are extracted as full source files rather than libraries, and wires it through the extractor’s configuration, main logic, and YAML schema.
- Introduce
extract_dependencies_as_sourceinConfig - Update
main.rsto switch extraction mode and path resolution based on the new flag - Extend
codeql-extractor.ymlschema with the new option
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| rust/extractor/src/config.rs | Added extract_dependencies_as_source: bool to Config |
| rust/extractor/src/main.rs | Conditionally select SourceKind and ResolvePaths |
| rust/codeql-extractor.yml | Defined extract_dependencies_as_source schema option |
Comments suppressed due to low confidence (1)
rust/extractor/src/main.rs:325
- [nitpick] This
info!call can produce very verbose logs on each file; consider removing it or lowering it todebug!if it was added for temporary debugging.
tracing::info!("file: {}", file.display());
| Skip path resolution. This is experimental, while we move path resolution from the extractor to the QL library. | ||
| type: string | ||
| pattern: "^(false|true)$" | ||
| extract_dependencies_as_source: |
There was a problem hiding this comment.
The schema defines this option as a string with a boolean pattern, but Config expects a bool. Change type: string to type: boolean and remove the pattern to align with the Rust flag.
paldepind
reviewed
May 27, 2025
Co-authored-by: Simon Friis Vindum <simonfv@gmail.com>
paldepind
approved these changes
May 27, 2025
Contributor
paldepind
left a comment
There was a problem hiding this comment.
Thanks for implementing this 😄
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.
@paldepind FYI