songzhendong commented on PR #139:
URL:
https://github.com/apache/skywalking-nodejs/pull/139#issuecomment-4824727675
Thanks for the Round-4 review.
The stale deprecated alias on `destroy()` / `start()` restart is fixed.
### Fix
- After promoting deprecated aliases in
`normalizeDeprecatedRuntimeMetricOptions()`, delete the deprecated fields so
they are not merged onto the singleton `config`.
- In `applyDeprecatedRuntimeMetricConfig()`, only apply deprecated aliases
when the current `agent.start(options)` call did not explicitly set the
canonical field; then clear deprecated fields from the singleton.
- Pass `options` into `finalizeConfig(config, options)` from `agent.start()`.
### Test
Added a regression test in `tests/config/AgentConfig.test.ts`:
```ts
agent.start({ nvmMetricsReporterActive: false });
agent.destroy();
agent.start({ runtimeMetricsReporterActive: true });
expect(config.runtimeMetricsReporterActive).toBe(true);
Also verifies normalized options do not retain stale alias keys.
Verification
Local:
npm run build
npx jest tests/config/AgentConfig.test.ts --runInBand
Fork CI (Build / License / Test) is green
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]