Skip to content

Conversation

@watson
Copy link
Collaborator

@watson watson commented Dec 16, 2025

What does this PR do?

  • Removes the leaky kPreUpdate hook from RemoteConfigManager and replaces it with a first-class batch handler API (setBatchHandler/removeBatchHandler) that receives an explicit transaction (ack/error/markHandled).
  • Introduces explicit RC product subscription via subscribeProducts(...products) / unsubscribeProducts(...products) and makes setProductHandler / removeProductHandler subscribe/unsubscribe for clarity.
  • Wires AppSec/WAF RC updates to the new batch transaction API and centralizes ASM/WAF RC product names in appsec/rc-products.js.

Motivation

kPreUpdate exposed internal mutable state and blurred responsibility between RC internals and consumers. WAF needs to reconcile multiple products in one logical update, so the new batch API provides a safer and clearer surface.

@watson watson self-assigned this Dec 16, 2025
Copy link
Collaborator Author

watson commented Dec 16, 2025

@pr-commenter
Copy link

pr-commenter bot commented Dec 16, 2025

Benchmarks

Benchmark execution time: 2026-01-06 19:18:40

Comparing candidate commit 0bc9468 in PR branch watson/refactor-rc with baseline commit 2681a5e in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 287 metrics, 33 unstable metrics.

@watson watson force-pushed the watson/refactor-rc branch 3 times, most recently from b704693 to eec9001 Compare December 16, 2025 20:46
@codecov
Copy link

codecov bot commented Dec 16, 2025

Codecov Report

❌ Patch coverage is 93.33333% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.52%. Comparing base (2681a5e) to head (0bc9468).
⚠️ Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
packages/dd-trace/src/remote_config/manager.js 90.47% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7121      +/-   ##
==========================================
+ Coverage   84.51%   84.52%   +0.01%     
==========================================
  Files         525      526       +1     
  Lines       22492    22537      +45     
==========================================
+ Hits        19008    19049      +41     
- Misses       3484     3488       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link

github-actions bot commented Dec 16, 2025

Overall package size

Self size: 4.4 MB
Deduped: 5.22 MB
No deduping: 5.22 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 2.0.0 | 68.46 kB | 797.03 kB | | dc-polyfill | 0.1.10 | 26.73 kB | 26.73 kB |

🤖 This report was automatically generated by heaviest-objects-in-the-universe

@watson watson changed the title refactor(remote-config): replace kPreUpdate with batch handler API refactor(remote-config): replace kPreUpdate with batch handler API (DEBUG-4402) Dec 16, 2025
@watson watson marked this pull request as ready for review December 16, 2025 20:47
@watson watson requested review from a team as code owners December 16, 2025 20:47
@watson watson requested review from khanayan123 and simon-id and removed request for a team December 16, 2025 20:47
@watson watson force-pushed the watson/refactor-rc branch from eec9001 to 3efdc4c Compare December 18, 2025 08:36
@watson watson requested a review from BridgeAR December 18, 2025 18:36
@watson watson force-pushed the watson/refactor-rc branch from 3efdc4c to b49c683 Compare December 19, 2025 17:38
@datadog-datadog-prod-us1

This comment has been minimized.

@watson watson force-pushed the watson/refactor-rc branch from b49c683 to c18a9fe Compare December 19, 2025 19:02
Copy link
Collaborator

@BridgeAR BridgeAR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like a good improvement to separate things by product. Just left a few minor suggestions

@bm1549 bm1549 removed the request for review from khanayan123 December 31, 2025 16:27
@watson watson force-pushed the watson/refactor-rc branch from c18a9fe to e65d976 Compare January 6, 2026 10:28
@watson watson requested a review from BridgeAR January 6, 2026 11:20
- Remove the leaky kPreUpdate hook and introduce a first-class batch API:
  setBatchHandler()/removeBatchHandler()
- Introduce explicit product subscription via subscribeProducts()/
  unsubscribeProducts(), and have setProductHandler()/
  removeProductHandler() subscribe/unsubscribe for clarity
- Centralize ASM/WAF RC product names in appsec/rc-products.js
- Update AppSec WAF RC integration to use batched tx
  (ack/error/markHandled) instead of mutating configs
- Improve JSDoc/TS inference for batch transaction/descriptors and
  WAF manager typing
@watson watson force-pushed the watson/refactor-rc branch from 4d55361 to 16ebc4a Compare January 6, 2026 17:50
@watson watson force-pushed the watson/refactor-rc branch from 16ebc4a to 0bc9468 Compare January 6, 2026 19:07
Copy link
Collaborator

@BridgeAR BridgeAR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just left a question

@watson watson merged commit 28b054c into master Jan 7, 2026
794 checks passed
@watson watson deleted the watson/refactor-rc branch January 7, 2026 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants