Skip to content

Conversation

@watson
Copy link
Collaborator

@watson watson commented Dec 16, 2025

What Does This Do?

Resolves the TODO in remote_config/index.js by moving all appsec-specific remote configuration logic into the appsec folder, improving separation of concerns and module independence.

Motivation

The remote_config module contained appsec-specific code including:

  • WAF update capabilities and subscriptions
  • ASM_FEATURES product handlers
  • User tracking configuration
  • Appsec enable/disable logic via remote config

This created tight coupling between core remote config and appsec, making both modules harder to understand and maintain. The remote_config module should focus on core APM tracing capabilities and be agnostic to appsec.

Benefits

  • Clear ownership: All appsec functionality lives in the appsec folder
  • Reduced coupling: remote_config has zero knowledge of appsec
  • Better testability: Each module tested independently with proper mocks
  • Improved maintainability: Easier to understand each module's scope
  • Preserved optimizations: Lazy loading still works for serverless cold starts

Copy link
Collaborator Author

watson commented Dec 16, 2025

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions
Copy link

github-actions bot commented Dec 16, 2025

Overall package size

Self size: 4.36 MB
Deduped: 5.19 MB
No deduping: 5.19 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

@codecov
Copy link

codecov bot commented Dec 16, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.82%. Comparing base (c18a9fe) to head (69d7527).

Additional details and impacted files
@@                  Coverage Diff                   @@
##           watson/refactor-rc    #7122      +/-   ##
======================================================
+ Coverage               84.81%   84.82%   +0.01%     
======================================================
  Files                     522      523       +1     
  Lines                   22207    22213       +6     
======================================================
+ Hits                    18834    18842       +8     
+ Misses                   3373     3371       -2     

☔ 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.

@datadog-datadog-prod-us1

This comment has been minimized.

@pr-commenter
Copy link

pr-commenter bot commented Dec 16, 2025

Benchmarks

Benchmark execution time: 2025-12-19 19:11:44

Comparing candidate commit 69d7527 in PR branch watson/DEBUG-4402/split-rc-and-appsec with baseline commit c18a9fe in branch watson/refactor-rc.

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

@watson watson force-pushed the watson/DEBUG-4402/split-rc-and-appsec branch 2 times, most recently from 42b32af to 8023afd Compare December 17, 2025 11:53
@watson watson force-pushed the watson/refactor-rc branch from eec9001 to 3efdc4c Compare December 18, 2025 08:36
@watson watson force-pushed the watson/DEBUG-4402/split-rc-and-appsec branch from 8023afd to 05e2209 Compare December 18, 2025 08:36
@watson watson force-pushed the watson/refactor-rc branch from 3efdc4c to b49c683 Compare December 19, 2025 17:38
@watson watson force-pushed the watson/DEBUG-4402/split-rc-and-appsec branch from 05e2209 to 6b3bd2e Compare December 19, 2025 17:38
Resolves TODO by decoupling the remote_config module from appsec,
improving separation of concerns and module independence.

Problem:
The remote_config module contained appsec-specific code including
WAF update capabilities, ASM_FEATURES handlers, and user tracking
configuration. This created tight coupling between core remote config
and appsec, making the remote_config module difficult to understand
and maintain in isolation.

Solution:
Extract all appsec-specific remote config logic into a new
appsec/remote_config.js module. The core remote_config module now
focuses solely on APM tracing capabilities, while appsec manages
its own remote config integration. The proxy.js orchestrator wires
them together at initialization.

Benefits:
- Clear ownership: appsec folder contains all appsec functionality
- Reduced coupling: remote_config has no knowledge of appsec
- Better testability: each module tested independently
- Improved maintainability: easier to understand each module's scope
- Startup optimization: lazy loading preserved for serverless

The appsec module now stores its own RC instance internally and
manages its lifecycle independently, eliminating cross-module
dependencies.
@watson watson force-pushed the watson/refactor-rc branch from b49c683 to c18a9fe Compare December 19, 2025 19:02
@watson watson force-pushed the watson/DEBUG-4402/split-rc-and-appsec branch from 6b3bd2e to 69d7527 Compare December 19, 2025 19:02
@watson watson requested review from a team, BridgeAR and simon-id December 19, 2025 20:32
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.

2 participants