Skip to content

Commit 7160ff7

Browse files
BridgeARpabloerhard
authored andcommitted
fix(config): stop exposing deprecated alias entries as Config properties (#9061)
A deprecated entry that only aliases a canonical option (DD_PROFILING_EXPERIMENTAL_*, DD_TRACE_EXPERIMENTAL_RUNTIME_ID_ENABLED) must not surface as its own Config property. helper.js deletes these from the shared supported-configurations object after registering the deprecation; defaults.js read the same object without the matching skip, so whether they became own properties depended on which module required the JSON first. In v5 the config spec builds defaults before helper, so Config gained DD_PROFILING_EXPERIMENTAL_* keys the property-surface test flagged as unknown; v6 passed only because major-overrides removes the entries outright.
1 parent b054df3 commit 7160ff7

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

packages/dd-trace/src/config/defaults.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,14 @@ for (const [canonicalName, entries] of Object.entries(supportedConfigurations))
216216
)
217217
}
218218
for (const entry of entries) {
219+
// A deprecated entry that only aliases a canonical option must not surface as
220+
// its own Config property/default: the canonical entry already owns the value
221+
// and the alias is resolved by helper.js. helper.js drops these from the shared
222+
// supported-configurations object (after registering the deprecation), but that
223+
// mutation is order-dependent on which module loads first. Skip here too so
224+
// `defaults` is identical regardless of load order (it differed in v5, where
225+
// major-overrides keeps these entries instead of deleting them outright).
226+
if (entry.deprecated && entry.aliases) continue
219227
if (entry.sensitive) {
220228
sensitiveConfigurations.add(canonicalName)
221229
}
@@ -283,7 +291,7 @@ for (const [canonicalName, entries] of Object.entries(supportedConfigurations))
283291

284292
// Replace the alias with the canonical property name.
285293
for (const [fullPropertyName, alias] of fallbackConfigurations) {
286-
if (configurationsTable[alias].property) {
294+
if (configurationsTable[alias]?.property) {
287295
fallbackConfigurations.set(fullPropertyName, configurationsTable[alias].property)
288296
}
289297
}

0 commit comments

Comments
 (0)