Migrate tree debug stripping to Python #61623
All Vouch review confidence checks passed
Residual risk 0.25 = Change Risk (0.63) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.63 · 296 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.341
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.063
Real PR Conversation Timeline
1 comments
"Review active on #61623"
general
weight: 0.35
alopezz
<!--Please give us some feedback on your experience writing this PR ! https://app.datadoghq.com/forms/43db4c02-6837-400c-8083-692e141b1b88 !-->
What does this PR do?
Reworks https://github.com/DataDog/datadog-agent/pull/61348 so that both the implementation and the test change from bash to Python.
It also adds tests for a couple more cases, and simplifies the toolchain wiring (no need to pass a
tree_driverexplicitly).Motivation
There was some offline discussion related to https://github.com/DataDog/datadog-agent/pull/61348#discussion_r4709166904 that sparked the attempt to revisit this. There are a few reasons why the change goes in a good direction:
Describe how you validated your changes
Tests pass, and the affected packaging-related bits (i.e. the stripping of elf files in the integrations folder) show no drift.
Additional Notes
There's no significant performance regression at this point that would justify staying with shell (or away from Python in general). A local benchmark around stripping the
integrations_runtimetree shows ~1.22s wall time for the original bash version versus ~1.70s for the new Python version.The drawback of this approach is that it adds a dependency on Python for this step, such that a Python update would require rerunning the action (which as we've seen has a negligible time cost today) and it requires materializing the Python runtime in Bazel's execution root in order to perform the action (extra setup time in a "cold" environment).
Possible followups include extending this approach to the single-file action (allowing reuse of the same exact code to do the stripping in both cases) and to other platforms.