test(appsec): add products payload tests for service activation telemetry#7124
test(appsec): add products payload tests for service activation telemetry#7124Julio-Guerra wants to merge 2 commits into
Conversation
…etry - Add find_products() helper to extract products dicts from app-started, app-product-change, and app-client-configuration-change telemetry events - Add TestServiceActivationRemoteConfigProductsPayload and TestServiceActivationEnvVarProductsPayload test classes to verify that products.appsec.enabled=true is reported in telemetry, which feeds service_instance.asm_enabled in the backend for fleet-api AAP detection Rationale: Ensure the telemetry payload that signals AAP as an enabled product is correctly emitted for both env-var and remote-config activation paths This commit made by [/dd:git:commit:quick](https://github.com/DataDog/claude-marketplace/tree/main/dd/commands/git/commit/quick.md)
|
|
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f505f6d0f0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| None, | ||
| ) | ||
| if appsec_entry: | ||
| yield {"appsec": {"enabled": True}} |
There was a problem hiding this comment.
Stop synthesizing the products payload
In the APPSEC_RUNTIME_ACTIVATION scenario, setup_service_activation_metric sends the ASM RC config, and the existing configuration test already expects an app-client-configuration-change containing DD_APPSEC_ENABLED. This branch turns that configuration event into {"appsec": {"enabled": True}}, so TestServiceActivationRemoteConfigProductsPayload can pass even when the tracer never emits an actual products.appsec.enabled payload on app-started/app-product-change, which is the regression this new test is meant to catch.
Useful? React with 👍 / 👎.
|
|
||
| @scenarios.appsec_runtime_activation | ||
| @features.appsec_service_activation_origin_metric | ||
| class TestServiceActivationRemoteConfigProductsPayload(BaseServiceActivationProductsPayload): |
There was a problem hiding this comment.
Add manifest coverage for the new test classes
These new service-activation tests have no manifest entries, and per docs/edit/manifest.md an unspecified test is enabled by default. I checked the existing manifests: Java and PHP mark all neighboring service activation metric/configuration classes as missing_feature (manifests/java.yml:2443-2446, manifests/php.yml:461-464), Ruby marks the remote-config variants as missing_feature (manifests/ruby.yml:1505-1507), and .NET still disables the metric variants (manifests/dotnet.yml:514-515). Without corresponding entries for the two new classes, those libraries will start running these tests in scenarios where the prerequisite service-activation telemetry is already declared unsupported.
Useful? React with 👍 / 👎.
nccatoni
left a comment
There was a problem hiding this comment.
LGTM (for @DataDog/system-tests-core) but you should get a review from someone familiar with the feature
…m find_products - Remove synthesis of products dict from app-client-configuration-change events - Simplify find_products() to only yield from app-started/app-product-change payloads Rationale: callers should handle RC-triggered enablement events separately rather than through a synthesised products dict in find_products This commit made by [/dd:git:commit:quick](https://github.com/DataDog/claude-marketplace/tree/main/dd/commands/git/commit/quick.md)
Summary
find_products()helper intests/appsec/utils.pythat yieldsproductsdicts fromapp-started,app-product-change, andapp-client-configuration-changetelemetry payloadsTestServiceActivationEnvVarProductsPayload(default scenario) andTestServiceActivationRemoteConfigProductsPayload(APPSEC_RUNTIME_ACTIVATION) to verify thatproducts.appsec.enabled=trueis reported in telemetry when AppSec is enabled via env var or remote configservice_instance.asm_enabledin the backend, used by fleet-api to surface AAP as an enabled productTest plan
TestServiceActivationEnvVarProductsPayload(default scenario, all languages)TestServiceActivationRemoteConfigProductsPayload(APPSEC_RUNTIME_ACTIVATION, all languages)🤖 Generated with Claude Code