We want to be able to fetch the configuration remotely.
Solution
We attempt to read the configuration file
If there is a configuration file, we attempt to get the remote configuration by passing the existing config file and the backend returns the final config
If there is no config, we retrieve the remote configuration by passing a null configuration to the API
Notes
We fetch the remote configuration ONLY if we have some API keys defined. Otherwise, we do not even try
We added a lot of debug information so that customer will be able to troubleshoot
Testing
Tested locally, existing tests should pass
cargo run --bin datadog-static-analyzer -- --staging --directory /Users/julien.delange/git/datadog-ci --format sarif --output ~/plop.json --debug yes
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.16s
Running `target/debug/datadog-static-analyzer --staging --directory /Users/julien.delange/git/datadog-ci --format sarif --output /Users/julien.delange/plop.json --debug yes`
Remote config (base64): "cnVsZXNldHM6CiAgLSBvcmctcnVsZXNldAogIC0ga2Rza2xmanNsZGYK"
Error: ruleset org-ruleset not found
Error: error when reading rules from API
Caused by:
Error: ruleset org-ruleset not found
What problem are you trying to solve?
We want to be able to fetch the configuration remotely.
Solution
We attempt to read the configuration file
null
configuration to the APINotes
Testing
Tested locally, existing tests should pass