Skip to content

Conversation

@dol
Copy link
Contributor

@dol dol commented Jun 19, 2025

Fixes #7429 - Environment variable substitution no longer breaks parsing of YAML values containing both single and double quotes. Values that are not intended for substitution are now parsed correctly as literal strings.

The big difference to the initial environment variable substitution approach is, that it's performing the substitution during the compose stage, rathen then the object construction stage. This give better control of the scalar type and quoting handling.

bLTxRziu4lzVduBr0MsSYttNNelWYY1ecjZTxgOF9Da52km_Z3YMkQ58bQISTdVxtPSSol94fOB60MAPyvZVF3WpUkKyjxwjLV58m4fgO1UBqwkJzs_E5wnKtBcYyD8hO9UQty2datVdRA6ho3TZ7xbrO0_OgQaR4vxOOtR5g_1JEs_RqXlhs5APsw9mDr8ttFAQNVFofhAcrUBKA6FPlvOdyO(1)

@dol dol requested a review from a team as a code owner June 19, 2025 06:13
@dol dol marked this pull request as draft June 19, 2025 07:04
@dol dol force-pushed the fix/7429-env-var-substitution-mixed-quotes branch from 8891732 to 2cbd9a7 Compare June 19, 2025 11:04
@codecov
Copy link

codecov bot commented Jun 19, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.79%. Comparing base (ada5af6) to head (bbf0de1).
Report is 16 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #7433      +/-   ##
============================================
+ Coverage     89.75%   89.79%   +0.04%     
  Complexity     6980     6980              
============================================
  Files           797      797              
  Lines         21165    21160       -5     
  Branches       2057     2054       -3     
============================================
+ Hits          18996    19000       +4     
+ Misses         1505     1498       -7     
+ Partials        664      662       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dol dol force-pushed the fix/7429-env-var-substitution-mixed-quotes branch 3 times, most recently from cc0f6d5 to 6abb41d Compare June 19, 2025 14:35
@dol dol marked this pull request as ready for review June 19, 2025 14:52
@dol dol force-pushed the fix/7429-env-var-substitution-mixed-quotes branch from 6abb41d to e787cc3 Compare June 19, 2025 20:13
Fixes open-telemetry#7429 - Environment variable substitution no longer breaks parsing
of YAML values containing both single and double quotes. Values that are
not intended for substitution are now parsed correctly as literal strings.
@dol dol force-pushed the fix/7429-env-var-substitution-mixed-quotes branch from e787cc3 to bbf0de1 Compare June 21, 2025 19:51
Copy link
Member

@jack-berg jack-berg left a comment

Choose a reason for hiding this comment

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

Very nice. Thanks!

Arguments.of("key1: ${EMPTY_STR}\n", mapOf(entry("key1", null))),
Arguments.of("key1: ${STR_3}\n", mapOf(entry("key1", null))),
Arguments.of("key1: ${STR_1} ${STR_3}\n", mapOf(entry("key1", "value1"))),
Arguments.of("key1: ${STR_1} ${STR_3}\n", mapOf(entry("key1", "value1 "))),
Copy link
Member

Choose a reason for hiding this comment

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

Nice fix

@jack-berg jack-berg merged commit 2c0ee00 into open-telemetry:main Jun 27, 2025
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Declarative Config: Environment variable substitution breaks parsing of YAML values with mixed single and double quotes

2 participants