Strip docstrings from large dependency wheels (~8 MB) #26094
All Vouch review confidence checks passed
Residual risk 0.20 = Change Risk (0.50) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.50 · 587 lines diff across 7 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.382
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #26094"
general
weight: 0.35
aiuto
<!-- dd-meta {"pullId":"1c4bffc7-d3a6-4d0a-bf59-060decaba34f","source":"chat","resourceId":"fdf897f8-0a91-46e7-ab63-5474025decc4","workflowId":"7a6f0c35-1723-4cf9-a60b-c478f6c213fb","codeChangeId":"7a6f0c35-1723-4cf9-a60b-c478f6c213fb","sourceType":"code_channel"} -->
What does this PR do?
<!-- Give a minimal but complete description of the change and how it works. -->
Adds
strip_docstrings = truerules to.builders/scripts/lines_to_remove.toml, soclean_wheel()empties the docstrings of these dependencies when building the Agent's wheels (installed size saved):kubernetes/client/models/.pyonly: 2.81 MBAbout 8.2 MB installed (1.6 MB compressed) per platform, measured with
clean_wheel()on the pinned linux-x86_64 releases against the current rules.kubernetes keeps its API docstrings:
kubernetes.watch.Watchreads them withpydoc.getdoc(:return:picks the event model,:param bool follow:picksfollowoverwatch). Strippingkubernetes/client/apiwould save 6.8 MB more but breakWatch.stream()for custom checks, though no integration here usesWatch.The new rules omit
line_patterns, which_load_line_removal_rules()already defaults to an empty list, so no code change is needed. Patterns end in-(ddtrace-*) so they don't matchddtrace_internal.Tests check that kubernetes API docstrings survive while model docstrings are emptied, and that each rule matches its real wheel filename. The resolution workflow regenerates
.deps/resolved.Motivation
<!--
Briefly explain why this change is needed and how it fits in: is it part of a bigger project, and
how does it fit into it? Are there related or follow-up PRs? Link only the references a reviewer
needs (e.g. Jira ticket, design doc, upstream docs or changelog, related PRs).-->
Shrinks the Agent's embedded Python dependencies by extending the pymongo docstring rule from #25517 to the next largest pure-Python packages.
How I checked that stripping is safe:
__doc__,inspect.getdoc,pydoc, and docstring-driven CLIs or parsers. The only hits were kubernetesWatch(described above), the ddtrace Google ADK integration reading__doc__on user-defined tools, and hazelcast assigning one__doc__.Watchand model decoding, cm-client deserialization, openstacksdk config loader, redis command packing, hazelcast serialization, ddtrace spans).Checklist before requesting review
<!--
The
pr-descriptionvalidation (Run Validations) fails until every item below is ticked andthe visible description (excluding HTML comments) is at most 3,000 characters. CI, the changelog,
and the QA label have their own checks. Request review only once all checks pass:
gh pr checks <PR> --repo DataDog/integrations-core --watch.--><!--
How to verify: run
gh pr diff <PR> --repo DataDog/integrations-core, review every changed line,and compare the final diff with the description above.-->
<!--
How to verify: check the diff for relevant tests and run them as described in
AGENTS.md.--><!--
How to verify: run
gh api repos/DataDog/integrations-core/pulls/<PR>/commentsandgh pr view <PR> --repo DataDog/integrations-core --json reviews,comments, then fix eachfinding or reply with the reason no change is needed.-->
<!-- Coding agents: never tick this item. Only the human author may tick it. -->
<!--
QA label: PRs that only change code owned exclusively by @DataDog/agent-integrations (see
.github/CODEOWNERS) always useqa/skip-qa, neverqa/required.-->🤖 Generated with <span>Claude Code</span> (<span>https://claude.com/claude-code</span>)
---
PR by Bits - View session in Datadog • Open in Slack
Comment @datadog to request changes