dd-trace 6.24.0 → 6.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ci/init.js +2 -22
- package/ext/exporters.js +0 -1
- package/index.d.ts +105 -5
- package/initialize.mjs +5 -2
- package/lambda.d.ts +39 -0
- package/lambda.js +3 -0
- package/package.json +11 -9
- package/packages/datadog-esbuild/index.js +8 -55
- package/packages/datadog-instrumentations/src/aws-lambda.js +88 -0
- package/packages/datadog-instrumentations/src/cucumber.js +5 -2
- package/packages/datadog-instrumentations/src/elevenlabs/activity.js +114 -0
- package/packages/datadog-instrumentations/src/elevenlabs/audio.js +104 -0
- package/packages/datadog-instrumentations/src/elevenlabs/index.js +288 -0
- package/packages/datadog-instrumentations/src/elevenlabs/session.js +444 -0
- package/packages/datadog-instrumentations/src/graphql.js +20 -17
- package/packages/{datadog-esbuild/src/utils.js → datadog-instrumentations/src/helpers/bundler-esm-exports.js} +282 -40
- package/packages/datadog-instrumentations/src/helpers/bundler-transform.js +573 -0
- package/packages/datadog-instrumentations/src/helpers/bundler-utils.js +104 -0
- package/packages/datadog-instrumentations/src/helpers/hook.js +29 -1
- package/packages/datadog-instrumentations/src/helpers/hooks.js +3 -7
- package/packages/datadog-instrumentations/src/helpers/lambda-handler.js +189 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/index.js +2 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentation-registry.js +18 -1
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/async-mutex.js +41 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/elevenlabs.js +25 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/graphql.js +0 -36
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/next.js +40 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/openai-agents-realtime.js +23 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/trpc.js +148 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/target-patterns.json +50 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/targets.json +17 -3
- package/packages/datadog-instrumentations/src/helpers/rewriter/transforms.js +59 -2
- package/packages/datadog-instrumentations/src/ioredis.js +101 -3
- package/packages/datadog-instrumentations/src/next.js +19 -6
- package/packages/datadog-instrumentations/src/openai-agents-realtime.js +149 -0
- package/packages/datadog-instrumentations/src/openai-realtime/audio-accumulator.js +27 -0
- package/packages/datadog-instrumentations/src/openai-realtime/index.js +17 -6
- package/packages/datadog-instrumentations/src/openai-realtime/server-playback.js +887 -0
- package/packages/datadog-instrumentations/src/openai-realtime/session.js +150 -25
- package/packages/datadog-instrumentations/src/openai-realtime/turns.js +29 -2
- package/packages/datadog-instrumentations/src/otel-sdk-trace.js +11 -9
- package/packages/datadog-instrumentations/src/webdriverio.js +12 -12
- package/packages/datadog-plugin-async-mutex/src/index.js +50 -0
- package/packages/datadog-plugin-aws-lambda/src/index.js +106 -0
- package/packages/datadog-plugin-cypress/src/cypress-plugin.js +22 -11
- package/packages/datadog-plugin-elevenlabs/src/index.js +69 -0
- package/packages/datadog-plugin-google-cloud-pubsub/src/consumer.js +10 -7
- package/packages/datadog-plugin-google-cloud-pubsub/src/producer.js +19 -52
- package/packages/datadog-plugin-google-cloud-pubsub/src/pubsub-push-subscription.js +4 -2
- package/packages/datadog-plugin-google-cloud-pubsub/src/pubsub-request-context.js +25 -4
- package/packages/datadog-plugin-http/src/client.js +32 -9
- package/packages/datadog-plugin-http2/src/client.js +38 -13
- package/packages/datadog-plugin-next/src/index.js +112 -14
- package/packages/datadog-plugin-prisma/src/datadog-tracing-helper.js +5 -3
- package/packages/datadog-plugin-trpc/src/index.js +15 -0
- package/packages/datadog-plugin-trpc/src/procedure.js +48 -0
- package/packages/datadog-plugin-trpc/src/request.js +81 -0
- package/packages/datadog-plugin-undici/src/index.js +22 -7
- package/packages/datadog-turbopack/index.js +4 -28
- package/packages/datadog-turbopack/src/loader.js +14 -452
- package/packages/datadog-webpack/index.js +3 -55
- package/packages/dd-trace/src/aiguard/evaluation.js +62 -1
- package/packages/dd-trace/src/aiguard/sdk.js +8 -2
- package/packages/dd-trace/src/aiguard/tags.js +2 -0
- package/packages/dd-trace/src/appsec/blocking/index.js +4 -0
- package/packages/dd-trace/src/appsec/graphql.js +91 -6
- package/packages/dd-trace/src/appsec/recommended.json +1287 -90
- package/packages/dd-trace/src/before-exit.js +32 -0
- package/packages/dd-trace/src/bootstrap.js +5 -3
- package/packages/dd-trace/src/ci-visibility/early-flake-detection/get-known-tests.js +15 -2
- package/packages/dd-trace/src/ci-visibility/exporters/ci-visibility-exporter.js +12 -34
- package/packages/dd-trace/src/ci-visibility/exporters/git/git_metadata.js +41 -13
- package/packages/dd-trace/src/ci-visibility/exporters/request.js +2 -3
- package/packages/dd-trace/src/ci-visibility/intelligent-test-runner/get-skippable-suites.js +1 -2
- package/packages/dd-trace/src/ci-visibility/requests/get-library-configuration.js +1 -1
- package/packages/dd-trace/src/ci-visibility/telemetry.js +6 -0
- package/packages/dd-trace/src/ci-visibility/test-management/get-test-management-tests.js +1 -1
- package/packages/dd-trace/src/ci-visibility/test-optimization-http-cache-schema.js +9 -134
- package/packages/dd-trace/src/ci-visibility/test-optimization-http-cache.js +11 -156
- package/packages/dd-trace/src/config/config-types.d.ts +3 -0
- package/packages/dd-trace/src/config/defaults.js +5 -0
- package/packages/dd-trace/src/config/generated-config-types.d.ts +42 -2
- package/packages/dd-trace/src/config/index.js +17 -5
- package/packages/dd-trace/src/config/parsers.js +9 -0
- package/packages/dd-trace/src/config/supported-configurations.json +158 -4
- package/packages/dd-trace/src/constants.js +1 -0
- package/packages/dd-trace/src/debugger/pause-duration-histogram.js +2 -1
- package/packages/dd-trace/src/exporter.js +0 -11
- package/packages/dd-trace/src/exporters/common/request.js +81 -48
- package/packages/dd-trace/src/exporters/common/retry.js +12 -7
- package/packages/dd-trace/src/exporters/common/url.js +1 -1
- package/packages/dd-trace/src/id.js +1 -1
- package/packages/dd-trace/src/lambda/facade.js +74 -0
- package/packages/dd-trace/src/lambda/handler.js +3 -41
- package/packages/dd-trace/src/lambda/index.js +38 -15
- package/packages/dd-trace/src/lambda/runtime/patch.js +19 -3
- package/packages/dd-trace/src/lambda/wrap.js +44 -0
- package/packages/dd-trace/src/llmobs/constants/tags.js +2 -0
- package/packages/dd-trace/src/llmobs/experiments/experiment.js +10 -5
- package/packages/dd-trace/src/llmobs/plugins/elevenlabs.js +96 -0
- package/packages/dd-trace/src/llmobs/plugins/genai/util.js +19 -6
- package/packages/dd-trace/src/llmobs/plugins/openai/realtime.js +38 -11
- package/packages/dd-trace/src/llmobs/plugins/vertexai.js +10 -2
- package/packages/dd-trace/src/llmobs/sdk.js +19 -0
- package/packages/dd-trace/src/llmobs/span_processor.js +9 -0
- package/packages/dd-trace/src/llmobs/tagger.js +22 -0
- package/packages/dd-trace/src/log/channels.js +4 -0
- package/packages/dd-trace/src/log/writer.js +6 -1
- package/packages/dd-trace/src/openfeature/agentless_configuration_source.js +4 -0
- package/packages/dd-trace/src/openfeature/configuration_source.js +35 -27
- package/packages/dd-trace/src/openfeature/flag-selection.js +152 -0
- package/packages/dd-trace/src/openfeature/flagging_provider.js +19 -1
- package/packages/dd-trace/src/openfeature/writers/base.js +1 -3
- package/packages/dd-trace/src/opentelemetry/logs/index.js +11 -0
- package/packages/dd-trace/src/opentelemetry/logs/otlp_http_log_exporter.js +1 -1
- package/packages/dd-trace/src/opentelemetry/metrics/index.js +7 -1
- package/packages/dd-trace/src/opentelemetry/metrics/otlp_http_metric_exporter.js +1 -1
- package/packages/dd-trace/src/opentelemetry/metrics/otlp_span_stats_exporter.js +4 -1
- package/packages/dd-trace/src/opentelemetry/otlp/otlp_http_exporter_base.js +19 -1
- package/packages/dd-trace/src/opentelemetry/span-ending-hook.js +5 -1
- package/packages/dd-trace/src/opentelemetry/span-helpers.js +6 -1
- package/packages/dd-trace/src/opentelemetry/span.js +2 -2
- package/packages/dd-trace/src/opentelemetry/startup-config.js +174 -0
- package/packages/dd-trace/src/opentelemetry/trace/otlp_http_trace_exporter.js +1 -1
- package/packages/dd-trace/src/opentelemetry/trace/otlp_transformer.js +7 -1
- package/packages/dd-trace/src/opentracing/propagation/tracestate.js +77 -23
- package/packages/dd-trace/src/opentracing/tracer.js +24 -0
- package/packages/dd-trace/src/otel-thread-ctx.js +28 -31
- package/packages/dd-trace/src/plugin_manager.js +34 -7
- package/packages/dd-trace/src/plugins/ci_plugin.js +41 -10
- package/packages/dd-trace/src/plugins/index.js +6 -0
- package/packages/dd-trace/src/plugins/plugin.js +4 -2
- package/packages/dd-trace/src/plugins/tracing.js +1 -1
- package/packages/dd-trace/src/plugins/util/ci.js +18 -1
- package/packages/dd-trace/src/plugins/util/git-cache.js +4 -4
- package/packages/dd-trace/src/plugins/util/git.js +263 -82
- package/packages/dd-trace/src/plugins/util/http-otel-semantics.js +75 -46
- package/packages/dd-trace/src/plugins/util/inferred_proxy.js +12 -4
- package/packages/dd-trace/src/plugins/util/status-validator.js +23 -10
- package/packages/dd-trace/src/plugins/util/tags.js +6 -0
- package/packages/dd-trace/src/plugins/util/test.js +64 -39
- package/packages/dd-trace/src/plugins/util/url.js +10 -2
- package/packages/dd-trace/src/plugins/util/user-provided-git.js +2 -2
- package/packages/dd-trace/src/plugins/util/web.js +65 -10
- package/packages/dd-trace/src/profiling/webspan-utils.js +6 -5
- package/packages/dd-trace/src/proxy.js +33 -53
- package/packages/dd-trace/src/span_processor.js +20 -0
- package/packages/dd-trace/src/startup-log.js +8 -6
- package/packages/dd-trace/src/telemetry/metrics.js +2 -1
- package/packages/dd-trace/src/tracer.js +0 -2
- package/packages/dd-trace/src/web-tags-cache.js +8 -9
- package/register.js +2 -1
- package/vendor/dist/@apm-js-collab/code-transformer/LICENSE +489 -0
- package/vendor/dist/@datadog/flagging-core/LICENSE +221 -0
- package/vendor/dist/@datadog/flagging-core/index.js +1 -0
- package/vendor/dist/@datadog/openfeature-node-server/LICENSE +21 -1
- package/vendor/dist/@datadog/openfeature-node-server/rules-based/LICENSE +3 -1
- package/vendor/dist/@datadog/sketches-js/LICENSE +263 -0
- package/vendor/dist/@datadog/source-map/LICENSE +1 -0
- package/vendor/dist/@isaacs/ttlcache/LICENSE +13 -0
- package/vendor/dist/@opentelemetry/core/LICENSE +209 -1
- package/vendor/dist/crypto-randomuuid/LICENSE +3 -0
- package/vendor/dist/escape-string-regexp/LICENSE +13 -0
- package/vendor/dist/esquery/LICENSE +2 -0
- package/vendor/dist/https-proxy-agent/LICENSE +80 -1
- package/vendor/dist/istanbul-lib-coverage/LICENSE +2 -0
- package/vendor/dist/jest-docblock/LICENSE +16 -0
- package/vendor/dist/jsonpath-plus/LICENSE +13 -0
- package/vendor/dist/limiter/LICENSE +2 -0
- package/vendor/dist/lodash.sortby/LICENSE +2 -0
- package/vendor/dist/lru-cache/LICENSE +13 -0
- package/vendor/dist/meriyah/LICENSE +13 -0
- package/vendor/dist/module-details-from-path/LICENSE +2 -0
- package/vendor/dist/mutexify/promise/LICENSE +28 -0
- package/vendor/dist/pprof-format/LICENSE +13 -0
- package/vendor/dist/pprof-format/index.js +1 -1
- package/vendor/dist/protobufjs/LICENSE +219 -0
- package/vendor/dist/protobufjs/minimal/LICENSE +219 -0
- package/vendor/dist/proxy-from-env/LICENSE +13 -0
- package/vendor/dist/retry/LICENSE +2 -0
- package/vendor/dist/rfdc/LICENSE +2 -0
- package/vendor/dist/semifies/LICENSE +3 -1
- package/vendor/dist/shell-quote/LICENSE +3 -1
- package/vendor/dist/source-map/LICENSE +1 -0
- package/vendor/dist/source-map/lib/util/LICENSE +1 -0
- package/vendor/dist/tlhunter-sorted-set/LICENSE +2 -0
- package/vendor/dist/ttl-set/LICENSE +28 -0
- package/ci/diagnose.js +0 -2215
- package/ci/runbook.md +0 -299
- package/ci/test-optimization-validation/approval-artifacts.js +0 -175
- package/ci/test-optimization-validation/approval.js +0 -386
- package/ci/test-optimization-validation/artifact-id.js +0 -18
- package/ci/test-optimization-validation/blocker-category.js +0 -24
- package/ci/test-optimization-validation/bounded-json.js +0 -120
- package/ci/test-optimization-validation/ci-command-candidate.js +0 -77
- package/ci/test-optimization-validation/ci-discovery.js +0 -192
- package/ci/test-optimization-validation/ci-package-scripts.js +0 -169
- package/ci/test-optimization-validation/ci-remediation.js +0 -283
- package/ci/test-optimization-validation/cli.js +0 -954
- package/ci/test-optimization-validation/command-blocker.js +0 -377
- package/ci/test-optimization-validation/command-output-policy.js +0 -188
- package/ci/test-optimization-validation/command-runner.js +0 -649
- package/ci/test-optimization-validation/environment.js +0 -88
- package/ci/test-optimization-validation/executable-approval.js +0 -47
- package/ci/test-optimization-validation/executable.js +0 -244
- package/ci/test-optimization-validation/execution-lock.js +0 -70
- package/ci/test-optimization-validation/framework-adapters/cucumber-validation.json +0 -3
- package/ci/test-optimization-validation/framework-adapters/cucumber.js +0 -767
- package/ci/test-optimization-validation/framework-adapters/cypress.js +0 -99
- package/ci/test-optimization-validation/framework-adapters/playwright.js +0 -175
- package/ci/test-optimization-validation/framework-adapters/vitest.js +0 -513
- package/ci/test-optimization-validation/generated-file-policy.js +0 -63
- package/ci/test-optimization-validation/generated-files.js +0 -425
- package/ci/test-optimization-validation/generated-test-contract.js +0 -284
- package/ci/test-optimization-validation/generated-verifier.js +0 -235
- package/ci/test-optimization-validation/literal-environment.js +0 -56
- package/ci/test-optimization-validation/literal-glob.js +0 -52
- package/ci/test-optimization-validation/manifest-loader.js +0 -116
- package/ci/test-optimization-validation/manifest-scaffold.js +0 -1276
- package/ci/test-optimization-validation/manifest-schema.js +0 -695
- package/ci/test-optimization-validation/offline-fixtures.js +0 -335
- package/ci/test-optimization-validation/offline-output.js +0 -406
- package/ci/test-optimization-validation/package-check.js +0 -97
- package/ci/test-optimization-validation/payload-normalizer.js +0 -72
- package/ci/test-optimization-validation/plan-writer.js +0 -541
- package/ci/test-optimization-validation/preflight-runner.js +0 -186
- package/ci/test-optimization-validation/project-build-artifact.js +0 -31
- package/ci/test-optimization-validation/redaction.js +0 -319
- package/ci/test-optimization-validation/report-writer.js +0 -666
- package/ci/test-optimization-validation/result-semantics.js +0 -103
- package/ci/test-optimization-validation/runner-command.js +0 -264
- package/ci/test-optimization-validation/runner-contract.js +0 -695
- package/ci/test-optimization-validation/safe-files.js +0 -202
- package/ci/test-optimization-validation/scenarios/auto-test-retries.js +0 -171
- package/ci/test-optimization-validation/scenarios/basic-reporting.js +0 -407
- package/ci/test-optimization-validation/scenarios/ci-wiring.js +0 -666
- package/ci/test-optimization-validation/scenarios/early-flake-detection.js +0 -142
- package/ci/test-optimization-validation/scenarios/helpers.js +0 -621
- package/ci/test-optimization-validation/scenarios/test-management.js +0 -219
- package/ci/test-optimization-validation/source-text.js +0 -84
- package/ci/test-optimization-validation/static-diagnosis.js +0 -166
- package/ci/test-optimization-validation/test-output.js +0 -120
- package/ci/test-optimization-validation/validation-blocker.js +0 -21
- package/ci/validate-test-optimization.js +0 -3
- package/packages/datadog-esbuild/src/resolver.js +0 -284
- package/packages/dd-trace/src/ci-visibility/exporters/ci-validation/index.js +0 -156
- package/packages/dd-trace/src/ci-visibility/exporters/ci-validation/msgpack-to-json.js +0 -287
- package/packages/dd-trace/src/ci-visibility/exporters/ci-validation/payload-projection.js +0 -84
- package/packages/dd-trace/src/ci-visibility/exporters/ci-validation/sink.js +0 -368
- package/packages/dd-trace/src/ci-visibility/exporters/ci-validation/writer.js +0 -59
|
@@ -13,25 +13,7 @@ const REQUIRED_SETTINGS_KEYS = [
|
|
|
13
13
|
'impacted_tests_enabled',
|
|
14
14
|
'coverage_report_upload_enabled',
|
|
15
15
|
]
|
|
16
|
-
const SETTINGS_BOOLEAN_KEYS = [
|
|
17
|
-
'code_coverage',
|
|
18
|
-
'tests_skipping',
|
|
19
|
-
'itr_enabled',
|
|
20
|
-
'require_git',
|
|
21
|
-
'flaky_test_retries_enabled',
|
|
22
|
-
'di_enabled',
|
|
23
|
-
'known_tests_enabled',
|
|
24
|
-
'impacted_tests_enabled',
|
|
25
|
-
'coverage_report_upload_enabled',
|
|
26
|
-
]
|
|
27
|
-
const EARLY_FLAKE_DETECTION_KEYS = ['enabled', 'faulty_session_threshold', 'slow_test_retries']
|
|
28
|
-
const TEST_MANAGEMENT_KEYS = ['attempt_to_fix_retries', 'enabled']
|
|
29
|
-
const RETRY_THRESHOLD_PATTERN = /^\d+(?:ms|[smh])$/
|
|
30
|
-
const MAX_VALIDATION_MODULES = 1000
|
|
31
|
-
const MAX_VALIDATION_SUITES = 10_000
|
|
32
|
-
const MAX_VALIDATION_TESTS = 100_000
|
|
33
16
|
const MAX_RETRIES = 100
|
|
34
|
-
const MAX_VALIDATION_STRING_BYTES = 4096
|
|
35
17
|
|
|
36
18
|
function isObject (value) {
|
|
37
19
|
return value !== null && typeof value === 'object' && !Array.isArray(value)
|
|
@@ -57,7 +39,7 @@ function getAttributes (response, endpoint) {
|
|
|
57
39
|
return attributes
|
|
58
40
|
}
|
|
59
41
|
|
|
60
|
-
function validateSettingsResponse (response
|
|
42
|
+
function validateSettingsResponse (response) {
|
|
61
43
|
const attributes = response?.data?.attributes ?? response
|
|
62
44
|
assertObject(attributes, 'Invalid settings response: attributes must be an object')
|
|
63
45
|
assertHasKeys(attributes, REQUIRED_SETTINGS_KEYS, 'settings')
|
|
@@ -65,26 +47,9 @@ function validateSettingsResponse (response, options = {}) {
|
|
|
65
47
|
assertObject(attributes.test_management, 'Invalid settings response: test_management must be an object')
|
|
66
48
|
assertHasKeys(attributes.early_flake_detection, ['enabled'], 'settings early_flake_detection')
|
|
67
49
|
assertHasKeys(attributes.test_management, ['enabled'], 'settings test_management')
|
|
68
|
-
if (!options.validationMode) return
|
|
69
|
-
|
|
70
|
-
assertOnlyKeys(attributes, REQUIRED_SETTINGS_KEYS, 'settings')
|
|
71
|
-
assertOnlyKeys(attributes.early_flake_detection, EARLY_FLAKE_DETECTION_KEYS, 'settings early_flake_detection')
|
|
72
|
-
assertOnlyKeys(attributes.test_management, TEST_MANAGEMENT_KEYS, 'settings test_management')
|
|
73
|
-
assertBooleanFields(attributes, SETTINGS_BOOLEAN_KEYS, 'settings')
|
|
74
|
-
assertBooleanFields(attributes.early_flake_detection, ['enabled'], 'settings early_flake_detection')
|
|
75
|
-
assertBooleanFields(attributes.test_management, ['enabled'], 'settings test_management')
|
|
76
|
-
assertOptionalBoundedNumber(
|
|
77
|
-
attributes.early_flake_detection.faulty_session_threshold,
|
|
78
|
-
'settings early_flake_detection faulty_session_threshold'
|
|
79
|
-
)
|
|
80
|
-
assertRetryMap(attributes.early_flake_detection.slow_test_retries)
|
|
81
|
-
assertOptionalBoundedNumber(
|
|
82
|
-
attributes.test_management.attempt_to_fix_retries,
|
|
83
|
-
'settings test_management attempt_to_fix_retries'
|
|
84
|
-
)
|
|
85
50
|
}
|
|
86
51
|
|
|
87
|
-
function validateKnownTestsResponse (response
|
|
52
|
+
function validateKnownTestsResponse (response) {
|
|
88
53
|
const attributes = getAttributes(response, 'known tests')
|
|
89
54
|
assertHasKeys(attributes, ['tests'], 'known tests')
|
|
90
55
|
|
|
@@ -92,46 +57,26 @@ function validateKnownTestsResponse (response, options = {}) {
|
|
|
92
57
|
if (tests === null) return
|
|
93
58
|
assertObject(tests, 'Invalid known tests response: tests must be an object or null')
|
|
94
59
|
|
|
95
|
-
|
|
96
|
-
let testCount = 0
|
|
97
|
-
const modules = Object.entries(tests)
|
|
98
|
-
if (options.validationMode && modules.length > MAX_VALIDATION_MODULES) {
|
|
99
|
-
throw new Error('Invalid known tests response: too many modules')
|
|
100
|
-
}
|
|
101
|
-
for (const [moduleName, suites] of modules) {
|
|
102
|
-
if (options.validationMode) assertValidationString(moduleName, 'known tests module')
|
|
60
|
+
for (const suites of Object.values(tests)) {
|
|
103
61
|
assertObject(suites, 'Invalid known tests response: module suites must be objects')
|
|
104
|
-
for (const
|
|
105
|
-
suiteCount++
|
|
106
|
-
if (options.validationMode) {
|
|
107
|
-
if (suiteCount > MAX_VALIDATION_SUITES) throw new Error('Invalid known tests response: too many suites')
|
|
108
|
-
assertValidationString(suiteName, 'known tests suite')
|
|
109
|
-
}
|
|
62
|
+
for (const testNames of Object.values(suites)) {
|
|
110
63
|
if (!Array.isArray(testNames)) {
|
|
111
64
|
throw new TypeError('Invalid known tests response: suite tests must be arrays')
|
|
112
65
|
}
|
|
113
66
|
for (const testName of testNames) {
|
|
114
|
-
testCount++
|
|
115
67
|
if (typeof testName !== 'string') {
|
|
116
68
|
throw new TypeError('Invalid known tests response: test names must be strings')
|
|
117
69
|
}
|
|
118
|
-
if (options.validationMode) {
|
|
119
|
-
if (testCount > MAX_VALIDATION_TESTS) throw new Error('Invalid known tests response: too many tests')
|
|
120
|
-
assertValidationString(testName, 'known test name')
|
|
121
|
-
}
|
|
122
70
|
}
|
|
123
71
|
}
|
|
124
72
|
}
|
|
125
73
|
}
|
|
126
74
|
|
|
127
|
-
function validateSkippableTestsResponse (response
|
|
75
|
+
function validateSkippableTestsResponse (response) {
|
|
128
76
|
assertObject(response, 'Invalid skippable tests response: response must be an object')
|
|
129
77
|
if (!Array.isArray(response.data)) {
|
|
130
78
|
throw new TypeError('Invalid skippable tests response: data must be an array')
|
|
131
79
|
}
|
|
132
|
-
if (options.validationMode && response.data.length > MAX_VALIDATION_TESTS) {
|
|
133
|
-
throw new Error('Invalid skippable tests response: too many items')
|
|
134
|
-
}
|
|
135
80
|
if (response.meta !== undefined) {
|
|
136
81
|
assertObject(response.meta, 'Invalid skippable tests response: meta must be an object')
|
|
137
82
|
}
|
|
@@ -147,56 +92,28 @@ function validateSkippableTestsResponse (response, options = {}) {
|
|
|
147
92
|
if (typeof item.type !== 'string') {
|
|
148
93
|
throw new TypeError('Invalid skippable tests response: data entry type must be a string')
|
|
149
94
|
}
|
|
150
|
-
if (options.validationMode) assertValidationString(item.type, 'skippable test type')
|
|
151
95
|
assertObject(item.attributes, 'Invalid skippable tests response: data entry attributes must be an object')
|
|
152
96
|
if ((item.type === 'suite' || item.type === 'test') && typeof item.attributes.suite !== 'string') {
|
|
153
97
|
throw new Error('Invalid skippable tests response: data entry suite must be a string')
|
|
154
98
|
}
|
|
155
|
-
if (options.validationMode && item.attributes.suite !== undefined) {
|
|
156
|
-
assertValidationString(item.attributes.suite, 'skippable test suite')
|
|
157
|
-
}
|
|
158
99
|
if (item.type === 'test' && typeof item.attributes.name !== 'string') {
|
|
159
100
|
throw new Error('Invalid skippable tests response: data entry name must be a string')
|
|
160
101
|
}
|
|
161
|
-
if (options.validationMode && item.attributes.name !== undefined) {
|
|
162
|
-
assertValidationString(item.attributes.name, 'skippable test name')
|
|
163
|
-
}
|
|
164
102
|
}
|
|
165
103
|
}
|
|
166
104
|
|
|
167
|
-
function validateTestManagementTestsResponse (response
|
|
105
|
+
function validateTestManagementTestsResponse (response) {
|
|
168
106
|
const attributes = getAttributes(response, 'test management tests')
|
|
169
107
|
assertHasKeys(attributes, ['modules'], 'test management tests')
|
|
170
108
|
assertObject(attributes.modules, 'Invalid test management tests response: modules must be an object')
|
|
171
109
|
|
|
172
|
-
|
|
173
|
-
let testCount = 0
|
|
174
|
-
const modules = Object.entries(attributes.modules)
|
|
175
|
-
if (options.validationMode && modules.length > MAX_VALIDATION_MODULES) {
|
|
176
|
-
throw new Error('Invalid test management tests response: too many modules')
|
|
177
|
-
}
|
|
178
|
-
for (const [moduleName, testModule] of modules) {
|
|
179
|
-
if (options.validationMode) assertValidationString(moduleName, 'test management module')
|
|
110
|
+
for (const testModule of Object.values(attributes.modules)) {
|
|
180
111
|
assertObject(testModule, 'Invalid test management tests response: modules entries must be objects')
|
|
181
112
|
assertObject(testModule.suites, 'Invalid test management tests response: module suites must be objects')
|
|
182
|
-
for (const
|
|
183
|
-
suiteCount++
|
|
184
|
-
if (options.validationMode) {
|
|
185
|
-
if (suiteCount > MAX_VALIDATION_SUITES) {
|
|
186
|
-
throw new Error('Invalid test management tests response: too many suites')
|
|
187
|
-
}
|
|
188
|
-
assertValidationString(suiteName, 'test management suite')
|
|
189
|
-
}
|
|
113
|
+
for (const suite of Object.values(testModule.suites)) {
|
|
190
114
|
assertObject(suite, 'Invalid test management tests response: suites entries must be objects')
|
|
191
115
|
assertObject(suite.tests, 'Invalid test management tests response: suite tests must be objects')
|
|
192
|
-
for (const
|
|
193
|
-
testCount++
|
|
194
|
-
if (options.validationMode) {
|
|
195
|
-
if (testCount > MAX_VALIDATION_TESTS) {
|
|
196
|
-
throw new Error('Invalid test management tests response: too many tests')
|
|
197
|
-
}
|
|
198
|
-
assertValidationString(testName, 'test management test')
|
|
199
|
-
}
|
|
116
|
+
for (const test of Object.values(suite.tests)) {
|
|
200
117
|
assertObject(test, 'Invalid test management tests response: tests entries must be objects')
|
|
201
118
|
assertObject(test.properties, 'Invalid test management tests response: test properties must be objects')
|
|
202
119
|
}
|
|
@@ -204,48 +121,6 @@ function validateTestManagementTestsResponse (response, options = {}) {
|
|
|
204
121
|
}
|
|
205
122
|
}
|
|
206
123
|
|
|
207
|
-
function assertBooleanFields (object, keys, endpoint) {
|
|
208
|
-
for (const key of keys) {
|
|
209
|
-
if (typeof object[key] !== 'boolean') {
|
|
210
|
-
throw new TypeError(`Invalid ${endpoint} response: ${key} must be a boolean`)
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
function assertOptionalBoundedNumber (value, endpoint) {
|
|
216
|
-
if (value === undefined) return
|
|
217
|
-
if (!Number.isFinite(value) || !Number.isInteger(value) || value < 0 || value > MAX_RETRIES) {
|
|
218
|
-
throw new TypeError(`Invalid ${endpoint}: value must be between 0 and ${MAX_RETRIES}`)
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
function assertRetryMap (retries) {
|
|
223
|
-
if (retries === undefined) return
|
|
224
|
-
assertObject(retries, 'Invalid settings response: early_flake_detection slow_test_retries must be an object')
|
|
225
|
-
for (const [threshold, count] of Object.entries(retries)) {
|
|
226
|
-
assertValidationString(threshold, 'early flake detection retry threshold')
|
|
227
|
-
if (!RETRY_THRESHOLD_PATTERN.test(threshold)) {
|
|
228
|
-
throw new TypeError('Invalid early flake detection retry threshold: expected a duration such as 5s')
|
|
229
|
-
}
|
|
230
|
-
assertOptionalBoundedNumber(count, `early flake detection retry count ${threshold}`)
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
function assertOnlyKeys (object, keys, endpoint) {
|
|
235
|
-
const allowed = new Set(keys)
|
|
236
|
-
for (const key of Object.keys(object)) {
|
|
237
|
-
if (!allowed.has(key)) {
|
|
238
|
-
throw new Error(`Invalid ${endpoint} response: unexpected ${key}`)
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
function assertValidationString (value, field) {
|
|
244
|
-
if (typeof value !== 'string' || Buffer.byteLength(value) > MAX_VALIDATION_STRING_BYTES) {
|
|
245
|
-
throw new TypeError(`Invalid ${field}: value must be a bounded string`)
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
|
|
249
124
|
module.exports = {
|
|
250
125
|
MAX_RETRIES,
|
|
251
126
|
validateKnownTestsResponse,
|
|
@@ -45,11 +45,6 @@ const KNOWN_TESTS_FILE_NAME = 'known_tests.json'
|
|
|
45
45
|
const SKIPPABLE_TESTS_FILE_NAME = 'skippable_tests.json'
|
|
46
46
|
const TEST_MANAGEMENT_FILE_NAME = 'test_management.json'
|
|
47
47
|
|
|
48
|
-
const DEFAULT_VALIDATION_MAX_FILE_BYTES = 1024 * 1024
|
|
49
|
-
const DEFAULT_VALIDATION_MAX_ENTRIES = 100_000
|
|
50
|
-
const DEFAULT_VALIDATION_MAX_NESTING_DEPTH = 32
|
|
51
|
-
const DEFAULT_VALIDATION_MAX_STRING_BYTES = 4096
|
|
52
|
-
|
|
53
48
|
function parseManifestVersion (content) {
|
|
54
49
|
// Supported just the number version or 'version=x'
|
|
55
50
|
const version = content.replace(/^\uFEFF/, '').trim()
|
|
@@ -58,22 +53,12 @@ function parseManifestVersion (content) {
|
|
|
58
53
|
}
|
|
59
54
|
|
|
60
55
|
class TestOptimizationHttpCache {
|
|
61
|
-
constructor ({
|
|
62
|
-
cwd = process.cwd(),
|
|
63
|
-
env,
|
|
64
|
-
validationManifestPath,
|
|
65
|
-
maxFileBytes = DEFAULT_VALIDATION_MAX_FILE_BYTES,
|
|
66
|
-
} = {}) {
|
|
56
|
+
constructor ({ cwd = process.cwd(), env } = {}) {
|
|
67
57
|
this._cwd = cwd
|
|
68
58
|
// This cache intentionally consumes env vars that are not tracer config keys. (??)
|
|
69
59
|
// eslint-disable-next-line eslint-rules/eslint-process-env
|
|
70
60
|
this._env = env ?? process.env
|
|
71
|
-
this.
|
|
72
|
-
this._maxFileBytes = maxFileBytes
|
|
73
|
-
this._lastError = undefined
|
|
74
|
-
this._manifestPath = validationManifestPath
|
|
75
|
-
? this._resolveValidationManifestPath(validationManifestPath)
|
|
76
|
-
: this._resolveManifestPath()
|
|
61
|
+
this._manifestPath = this._resolveManifestPath()
|
|
77
62
|
this._testOptimizationPath = undefined
|
|
78
63
|
this._httpCachePath = undefined
|
|
79
64
|
this._available = false
|
|
@@ -85,10 +70,6 @@ class TestOptimizationHttpCache {
|
|
|
85
70
|
return this._available
|
|
86
71
|
}
|
|
87
72
|
|
|
88
|
-
getLastError () {
|
|
89
|
-
return this._lastError
|
|
90
|
-
}
|
|
91
|
-
|
|
92
73
|
readSettings () {
|
|
93
74
|
const payload = this._readFile(SETTINGS_FILE_NAME)
|
|
94
75
|
if (payload === CACHE_MISS) {
|
|
@@ -98,9 +79,9 @@ class TestOptimizationHttpCache {
|
|
|
98
79
|
|
|
99
80
|
try {
|
|
100
81
|
const settings = parseLibraryConfigurationResponse(
|
|
101
|
-
|
|
82
|
+
payload,
|
|
102
83
|
undefined,
|
|
103
|
-
{ validateRequiredFields: true
|
|
84
|
+
{ validateRequiredFields: true }
|
|
104
85
|
)
|
|
105
86
|
incrementCountMetric(TELEMETRY_GIT_REQUESTS_SETTINGS_RESPONSE, settings)
|
|
106
87
|
return settings
|
|
@@ -117,8 +98,8 @@ class TestOptimizationHttpCache {
|
|
|
117
98
|
|
|
118
99
|
try {
|
|
119
100
|
const knownTests = parseKnownTestsResponse(
|
|
120
|
-
|
|
121
|
-
{ validateRequiredFields: true
|
|
101
|
+
payload,
|
|
102
|
+
{ validateRequiredFields: true }
|
|
122
103
|
)
|
|
123
104
|
distributionMetric(TELEMETRY_KNOWN_TESTS_RESPONSE_TESTS, {}, getNumFromKnownTests(knownTests))
|
|
124
105
|
distributionMetric(TELEMETRY_KNOWN_TESTS_RESPONSE_BYTES, {}, payload.length)
|
|
@@ -134,12 +115,10 @@ class TestOptimizationHttpCache {
|
|
|
134
115
|
if (payload === CACHE_MISS) return CACHE_MISS
|
|
135
116
|
|
|
136
117
|
try {
|
|
137
|
-
const
|
|
138
|
-
const parsedResponse = typeof boundedPayload === 'string' ? JSON.parse(boundedPayload) : boundedPayload
|
|
118
|
+
const parsedResponse = JSON.parse(payload)
|
|
139
119
|
const result = parseSkippableSuitesResponse(parsedResponse, {
|
|
140
120
|
...options,
|
|
141
121
|
validateRequiredFields: true,
|
|
142
|
-
validationMode: Boolean(this._validationManifestPath),
|
|
143
122
|
})
|
|
144
123
|
const testLevel = options.testLevel || 'suite'
|
|
145
124
|
logSkippableSuitesResponse(
|
|
@@ -169,8 +148,8 @@ class TestOptimizationHttpCache {
|
|
|
169
148
|
|
|
170
149
|
try {
|
|
171
150
|
parseSkippableSuitesResponse(
|
|
172
|
-
|
|
173
|
-
{ ...options, validateRequiredFields: true
|
|
151
|
+
payload,
|
|
152
|
+
{ ...options, validateRequiredFields: true }
|
|
174
153
|
)
|
|
175
154
|
return true
|
|
176
155
|
} catch {
|
|
@@ -184,8 +163,8 @@ class TestOptimizationHttpCache {
|
|
|
184
163
|
|
|
185
164
|
try {
|
|
186
165
|
const testManagementTests = parseTestManagementTestsResponse(
|
|
187
|
-
|
|
188
|
-
{ validateRequiredFields: true
|
|
166
|
+
payload,
|
|
167
|
+
{ validateRequiredFields: true }
|
|
189
168
|
)
|
|
190
169
|
distributionMetric(
|
|
191
170
|
TELEMETRY_TEST_MANAGEMENT_TESTS_RESPONSE_TESTS,
|
|
@@ -202,18 +181,12 @@ class TestOptimizationHttpCache {
|
|
|
202
181
|
|
|
203
182
|
_buildReader () {
|
|
204
183
|
if (!this._manifestPath) {
|
|
205
|
-
if (this._validationManifestPath && !this._lastError) {
|
|
206
|
-
this._setError('Offline Test Optimization validation manifest was not found.')
|
|
207
|
-
}
|
|
208
184
|
log.debug('Test Optimization HTTP cache manifest not found')
|
|
209
185
|
return
|
|
210
186
|
}
|
|
211
187
|
|
|
212
188
|
const version = this._readManifestVersion(this._manifestPath)
|
|
213
189
|
if (version !== SUPPORTED_MANIFEST_VERSION) {
|
|
214
|
-
if (this._validationManifestPath) {
|
|
215
|
-
this._setError(`Unsupported offline Test Optimization validation manifest version: ${version || 'missing'}.`)
|
|
216
|
-
}
|
|
217
190
|
log.debug('Unsupported Test Optimization HTTP cache manifest version %j at %s', version, this._manifestPath)
|
|
218
191
|
return
|
|
219
192
|
}
|
|
@@ -227,9 +200,6 @@ class TestOptimizationHttpCache {
|
|
|
227
200
|
|
|
228
201
|
const settingsPath = path.join(this._httpCachePath, SETTINGS_FILE_NAME)
|
|
229
202
|
if (!fs.existsSync(settingsPath)) {
|
|
230
|
-
if (this._validationManifestPath) {
|
|
231
|
-
this._setError('Offline Test Optimization validation settings fixture is missing.')
|
|
232
|
-
}
|
|
233
203
|
log.debug('Test Optimization HTTP cache settings file not found at %s', settingsPath)
|
|
234
204
|
return
|
|
235
205
|
}
|
|
@@ -253,36 +223,10 @@ class TestOptimizationHttpCache {
|
|
|
253
223
|
}
|
|
254
224
|
}
|
|
255
225
|
|
|
256
|
-
_resolveValidationManifestPath (manifestPath) {
|
|
257
|
-
if (!path.isAbsolute(manifestPath)) {
|
|
258
|
-
this._setError('Offline Test Optimization validation manifest path must be absolute.')
|
|
259
|
-
return
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
const resolvedManifestPath = path.resolve(manifestPath)
|
|
263
|
-
const testOptimizationPath = path.dirname(resolvedManifestPath)
|
|
264
|
-
const fixtureRoot = path.dirname(testOptimizationPath)
|
|
265
|
-
if (path.basename(resolvedManifestPath) !== MANIFEST_FILE_NAME ||
|
|
266
|
-
path.basename(testOptimizationPath) !== PLAN_FOLDER) {
|
|
267
|
-
this._setError('Offline Test Optimization validation manifest must use the fixed .testoptimization layout.')
|
|
268
|
-
return
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
try {
|
|
272
|
-
assertPathComponentsAreNotSymlinks(fixtureRoot, resolvedManifestPath)
|
|
273
|
-
assertRegularFixtureFile(resolvedManifestPath)
|
|
274
|
-
return resolvedManifestPath
|
|
275
|
-
} catch (err) {
|
|
276
|
-
this._setError(err.message)
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
|
|
280
226
|
_readManifestVersion (manifestPath) {
|
|
281
227
|
try {
|
|
282
|
-
this._assertValidationFixtureFile(manifestPath)
|
|
283
228
|
return parseManifestVersion(fs.readFileSync(manifestPath, 'utf8'))
|
|
284
229
|
} catch (err) {
|
|
285
|
-
if (this._validationManifestPath) this._setError(err.message)
|
|
286
230
|
log.debug('Failed to read Test Optimization HTTP cache manifest %s: %s', manifestPath, err.message)
|
|
287
231
|
}
|
|
288
232
|
}
|
|
@@ -292,113 +236,24 @@ class TestOptimizationHttpCache {
|
|
|
292
236
|
|
|
293
237
|
const filePath = path.join(this._httpCachePath, fileName)
|
|
294
238
|
try {
|
|
295
|
-
this._assertValidationFixtureFile(filePath)
|
|
296
239
|
log.debug('Reading Test Optimization HTTP cache file %s', filePath)
|
|
297
240
|
return fs.readFileSync(filePath, 'utf8')
|
|
298
241
|
} catch (err) {
|
|
299
|
-
if (this._validationManifestPath) this._setError(err.message)
|
|
300
242
|
log.debug('Test Optimization HTTP cache file %s could not be read: %s', filePath, err.message)
|
|
301
243
|
return CACHE_MISS
|
|
302
244
|
}
|
|
303
245
|
}
|
|
304
246
|
|
|
305
247
|
_logInvalidCacheFile (fileName, err) {
|
|
306
|
-
if (this._validationManifestPath) {
|
|
307
|
-
this._setError(`Invalid offline Test Optimization ${fileName} fixture: ${err.message}`)
|
|
308
|
-
}
|
|
309
248
|
log.debug('Test Optimization HTTP cache file %s could not be parsed: %s', fileName, err.message)
|
|
310
249
|
}
|
|
311
250
|
|
|
312
|
-
_assertValidationFixtureFile (filePath) {
|
|
313
|
-
if (!this._validationManifestPath) return
|
|
314
|
-
const fixtureRoot = path.dirname(path.dirname(this._manifestPath))
|
|
315
|
-
assertPathComponentsAreNotSymlinks(fixtureRoot, filePath)
|
|
316
|
-
const stat = assertRegularFixtureFile(filePath)
|
|
317
|
-
if (stat.size > this._maxFileBytes) {
|
|
318
|
-
throw new Error(
|
|
319
|
-
`Offline Test Optimization fixture ${path.basename(filePath)} exceeds ${this._maxFileBytes} bytes.`
|
|
320
|
-
)
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
_parsePayload (payload, fileName) {
|
|
325
|
-
if (!this._validationManifestPath) return payload
|
|
326
|
-
|
|
327
|
-
const parsed = JSON.parse(payload)
|
|
328
|
-
assertBoundedValidationValue(parsed, fileName)
|
|
329
|
-
return parsed
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
_setError (message) {
|
|
333
|
-
this._lastError = new Error(message)
|
|
334
|
-
}
|
|
335
|
-
|
|
336
251
|
_disable () {
|
|
337
252
|
this._available = false
|
|
338
253
|
}
|
|
339
254
|
}
|
|
340
255
|
|
|
341
|
-
function assertPathComponentsAreNotSymlinks (root, filename) {
|
|
342
|
-
const resolvedRoot = path.resolve(root)
|
|
343
|
-
const resolvedFilename = path.resolve(filename)
|
|
344
|
-
const rootStat = fs.lstatSync(resolvedRoot)
|
|
345
|
-
if (!rootStat.isDirectory() || rootStat.isSymbolicLink()) {
|
|
346
|
-
throw new Error(`Offline Test Optimization fixture root must be a regular directory: ${resolvedRoot}`)
|
|
347
|
-
}
|
|
348
|
-
const relative = path.relative(resolvedRoot, resolvedFilename)
|
|
349
|
-
if (relative.startsWith('..') || path.isAbsolute(relative)) {
|
|
350
|
-
throw new Error('Offline Test Optimization fixture path escapes its validation root.')
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
let current = resolvedRoot
|
|
354
|
-
for (const segment of relative ? relative.split(path.sep) : []) {
|
|
355
|
-
current = path.join(current, segment)
|
|
356
|
-
const stat = fs.lstatSync(current)
|
|
357
|
-
if (stat.isSymbolicLink()) {
|
|
358
|
-
throw new Error(`Offline Test Optimization fixture path contains a symbolic link: ${current}`)
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
function assertRegularFixtureFile (filename) {
|
|
364
|
-
const stat = fs.lstatSync(filename)
|
|
365
|
-
if (!stat.isFile()) {
|
|
366
|
-
throw new Error(`Offline Test Optimization fixture is not a regular file: ${filename}`)
|
|
367
|
-
}
|
|
368
|
-
if (stat.nlink > 1) {
|
|
369
|
-
throw new Error(`Offline Test Optimization fixture must not be hard-linked: ${filename}`)
|
|
370
|
-
}
|
|
371
|
-
return stat
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
function assertBoundedValidationValue (value, fileName) {
|
|
375
|
-
const pending = [{ depth: 0, value }]
|
|
376
|
-
let entries = 0
|
|
377
|
-
|
|
378
|
-
while (pending.length > 0) {
|
|
379
|
-
const current = pending.pop()
|
|
380
|
-
if (current.depth > DEFAULT_VALIDATION_MAX_NESTING_DEPTH) {
|
|
381
|
-
throw new Error(`${fileName} exceeds the validation nesting limit.`)
|
|
382
|
-
}
|
|
383
|
-
if (typeof current.value === 'string' &&
|
|
384
|
-
Buffer.byteLength(current.value) > DEFAULT_VALIDATION_MAX_STRING_BYTES) {
|
|
385
|
-
throw new Error(`${fileName} contains a string that exceeds the validation limit.`)
|
|
386
|
-
}
|
|
387
|
-
if (!current.value || typeof current.value !== 'object') continue
|
|
388
|
-
|
|
389
|
-
const values = Array.isArray(current.value) ? current.value : Object.values(current.value)
|
|
390
|
-
entries += values.length
|
|
391
|
-
if (entries > DEFAULT_VALIDATION_MAX_ENTRIES) {
|
|
392
|
-
throw new Error(`${fileName} exceeds the validation collection-entry limit.`)
|
|
393
|
-
}
|
|
394
|
-
for (const nestedValue of values) {
|
|
395
|
-
pending.push({ depth: current.depth + 1, value: nestedValue })
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
|
|
400
256
|
module.exports = {
|
|
401
257
|
CACHE_MISS,
|
|
402
|
-
DEFAULT_VALIDATION_MAX_FILE_BYTES,
|
|
403
258
|
TestOptimizationHttpCache,
|
|
404
259
|
}
|
|
@@ -9,6 +9,9 @@ export interface ConfigProperties extends GeneratedConfig {
|
|
|
9
9
|
rules: PayloadTaggingRules
|
|
10
10
|
}
|
|
11
11
|
debug: boolean
|
|
12
|
+
featureFlags: GeneratedConfig['featureFlags'] & {
|
|
13
|
+
flagSelection: unknown
|
|
14
|
+
}
|
|
12
15
|
instrumentationSource: 'manual' | 'ssi'
|
|
13
16
|
isCiVisibility: boolean
|
|
14
17
|
isServiceNameInferred: boolean
|
|
@@ -303,6 +303,11 @@ for (const [canonicalName, entries] of Object.entries(supportedConfigurations))
|
|
|
303
303
|
}
|
|
304
304
|
}
|
|
305
305
|
|
|
306
|
+
// Programmatic only. The Feature Flagging provider validates the raw value, and it is redacted because
|
|
307
|
+
// a wrong-shaped selection would otherwise be printed or sent as is in configuration telemetry.
|
|
308
|
+
addOption({ property: 'featureFlags.flagSelection', type: 'PASSTHROUGH' }, ['featureFlags.flagSelection'])
|
|
309
|
+
sensitiveConfigurations.add('featureFlags.flagSelection')
|
|
310
|
+
|
|
306
311
|
// Replace the alias with the canonical property name.
|
|
307
312
|
for (const [fullPropertyName, alias] of fallbackConfigurations) {
|
|
308
313
|
if (configurationsTable[alias]?.property) {
|