Merged
Conversation
…t not within unit tests)
|
🎯 Code Coverage 🔗 Commit SHA: e7e3d79 | Docs | Datadog PR Page | Was this helpful? Give us feedback! |
jacobotb
approved these changes
Feb 10, 2026
| .use_rulesets | ||
| .get_or_insert_with(|| Vec::with_capacity(rulesets.len())); | ||
| for ruleset_name in rulesets { | ||
| // if list.iter().find(|&name| ruleset_name.as_ref() ==) |
| } | ||
|
|
||
| // test behaviors | ||
| // add empty rulesets to v2 doesn't instantiate a use_rulesets |
| || prettify_yaml(&fixed), | ||
| |original_content| reconcile_comments(original_content, &fixed, true), | ||
| || prettify_yaml(&yaml), | ||
| |original_content| reconcile_comments(original_content, &yaml, true), |
Contributor
There was a problem hiding this comment.
The reconcile_comments function may not work with V2 structure. The test may only care about V1, so the fact that they pass may not indicate that it works with V2 as well. We should probably extend the tests to cover v2 as well.
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.
Note
The commits are additive and tightly-scoped. You'll want to review commit-by-commit.
What this PR does
datadog-static-analyzerand git hook)datadog-static-analyzer-serverendpoints for config editing)datadog-static-analyzer-serverPOST requests to/analyze)Summary
For both v1 and v2, parsing a configuration file happens in two stages. 1) The file is parsed into a "YamlConfigFile" struct. Then, that struct is translated into a "ConfigFile".
If a configuration file is a v1 file, it gets convert from a
file_v1::YamlConfigFileto afile_v2::YamlConfigFile(operating at this level this makes it easy to provide a CLI tool to convert files):datadog-static-analyzer/crates/cli/src/config_file.rs
Lines 56 to 59 in e495f67
From there, a
file_v2::YamlConfigFileis always translated into afile_v2::ConfigFile, which all program logic uses.Notes for reviewer
For the IDE, the only relevant commits are:
datadog-static-analyzer/crates/bins/src/bin/datadog_static_analyzer_server/ide/configuration_file/static_analysis_config_file.rs
Lines 873 to 876 in ff4df07
For the analyzer, please:
datadog-static-analyzerbinary to use v2 structs under the hood. Check thatuse-rulesets, but "java-security" also exists in the default ruleset list.What's Next
Once the backend implements v2:
(At this point, we can start using v2 everywhere)