[NO-TICKET] Decouple environment variable from programmatic config precedence#4610
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4610 +/- ##
=======================================
Coverage 97.72% 97.72%
=======================================
Files 1412 1412
Lines 86260 86273 +13
Branches 4357 4348 -9
=======================================
+ Hits 84300 84313 +13
Misses 1960 1960 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Datadog ReportBranch report: ✅ 0 Failed, 20821 Passed, 1376 Skipped, 3m 37.78s Total Time |
Strech
left a comment
There was a problem hiding this comment.
I think it's a great change, but I do think that testing gone a bit over the edge.
BenchmarksBenchmark execution time: 2025-04-29 13:04:12 Comparing candidate commit 098b100 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 31 metrics, 2 unstable metrics. |
Strech
left a comment
There was a problem hiding this comment.
I have a few suggestions for tests
* master: (25 commits) Continue on error Comment on Gemfile Run CI Avoid example redefinition warning in test suite (DataDog#4612) [NO-TICKET] Decouple environment variable from programmatic config precedence (DataDog#4610) Update rack/rails/sinatra to use security events Rewrite Event.record logic for non-attack events Warn when ignoring on_error argument due to it not being a proc (DataDog#4611) Bump the gh-actions-packages group across 3 directories with 6 updates Update Event to use SecurityEvent class Replace events with new SecurityEvent class Add new class SecurityEvent Rename AppSec API security method Rewrite Event#record public interface Add attack headers test to the rails contib Remove unused keys from the events Add new test scenarios for security event Change visibility of Event internal methods Rewrite Event#record specs Return complete rule files into assets ...
What does this PR do?
This PR decouples environment variables and programmatic configuration precedence value by adding an environment precedence value.
Motivation:
in #4592, I need to add a new precedence value higher than environment but lower than programmatic.
Change log entry
Yes. Change behaviour of programmatic configurations previously overwriting environment variables. Unsetting a programmatic configuration will now restore the environment variable value.
Additional Notes:
I'm not sure if this is considered a breaking change, it seems like this was a bug in the first place (booting an app with an env var, a programmatic config and unsetting that programmatic config previously dismissed the env var too)
How to test the change?
CI.