Skip to content

refactor: build config from user config instead of mutating pre-filled object#2448

Merged
aryamohanan merged 10 commits intofix-config-precedencefrom
fix-config-refact
Apr 8, 2026
Merged

refactor: build config from user config instead of mutating pre-filled object#2448
aryamohanan merged 10 commits intofix-config-precedencefrom
fix-config-refact

Conversation

@aryamohanan
Copy link
Copy Markdown
Contributor

@aryamohanan aryamohanan commented Mar 30, 2026

Normalization functions previously operated on a pre-filled config, making it unclear whether values were resolved or already present. This change separates input and output, making value resolution explicit and easier to reason about.

image

@aryamohanan aryamohanan added the v6 label Mar 30, 2026
@aryamohanan aryamohanan changed the title refactor: build config from userConfig instead of mutating pre-filled object refactor: build config from user config instead of mutating pre-filled object Mar 30, 2026
envVar: 'INSTANA_TRACING_DISABLE_EOL_EVENTS',
configValue: config.tracing.disableEOLEvents,
defaultValue: defaults.tracing.disableEOLEvents,
configValue: userConfig.tracing.disableEOLEvents,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we name this incodeValue or similar?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be we can consider that in a separate PR?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ja sure <3

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you add a todo? Ty

@aryamohanan aryamohanan force-pushed the fix-config-refact branch 2 times, most recently from 8234da0 to d3caf5b Compare April 1, 2026 11:43
@aryamohanan aryamohanan requested a review from kirrg001 April 1, 2026 12:43
@aryamohanan aryamohanan marked this pull request as ready for review April 7, 2026 08:11
@aryamohanan aryamohanan requested a review from a team as a code owner April 7, 2026 08:11
aryamohanan and others added 3 commits April 7, 2026 16:51
Co-authored-by: kirrg001 <katharina.irrgang@ibm.com>
return envVarValue
.split(/[;,]/)
.map(header => header.trim())
.map(header => header.trim().toLowerCase())
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like an unrelated change. Can you explain?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The lowercase conversion was previously handled within the respective function, but it is more appropriate to move it to this helper. I have verified that this change does not impact any existing functionality, and all case-sensitive tests for environment variables and headers are passing.

Copy link
Copy Markdown
Contributor

@kirrg001 kirrg001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pre-approving! Great work

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 7, 2026

@aryamohanan aryamohanan merged commit e093f36 into fix-config-precedence Apr 8, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants