Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restrict characters in environment variable names #10183

Merged
merged 23 commits into from
May 24, 2024

Conversation

ankitpatel96
Copy link
Contributor

@ankitpatel96 ankitpatel96 commented May 21, 2024

Description

Restricts Environment Variable names according to the restrictions published by the OpenTelemetry Configuration Working Group. Changes both the expand converter and the env provider. Defines one regex to be used for both of these.

Link to tracking issue

Fixes #9531

Testing

Unit tests

Copy link

codecov bot commented May 21, 2024

Codecov Report

Attention: Patch coverage is 96.15385% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 92.01%. Comparing base (ecdbb53) to head (34409ed).
Report is 15 commits behind head on main.

Current head 34409ed differs from pull request most recent head 63f3d44

Please upload reports for the commit 63f3d44 to get more accurate results.

Files Patch % Lines
confmap/converter/expandconverter/expand.go 95.83% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10183      +/-   ##
==========================================
+ Coverage   91.87%   92.01%   +0.13%     
==========================================
  Files         356      361       +5     
  Lines       16865    16981     +116     
==========================================
+ Hits        15495    15625     +130     
+ Misses       1031     1018      -13     
+ Partials      339      338       -1     

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

@ankitpatel96 ankitpatel96 marked this pull request as ready for review May 21, 2024 18:47
@ankitpatel96 ankitpatel96 requested review from a team and TylerHelmuth May 21, 2024 18:47
Copy link
Member

@TylerHelmuth TylerHelmuth left a comment

Choose a reason for hiding this comment

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

Excellent!

.chloggen/env-var-name-verify.yaml Outdated Show resolved Hide resolved
confmap/confmap.go Outdated Show resolved Hide resolved
@mx-psi mx-psi merged commit 38e1bad into open-telemetry:main May 24, 2024
47 checks passed
@github-actions github-actions bot added this to the next release milestone May 24, 2024
andrzej-stencel pushed a commit to andrzej-stencel/opentelemetry-collector that referenced this pull request May 27, 2024
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Restricts Environment Variable names according to the
[restrictions](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/file-configuration.md#environment-variable-substitution)
published by the OpenTelemetry Configuration Working Group. Changes both
the expand converter and the env provider. Defines one regex to be used
for both of these.

<!-- Issue number if applicable -->
#### Link to tracking issue
Fixes
open-telemetry#9531

<!--Describe what testing was performed and which tests were added.-->
#### Testing
Unit tests

<!--Please delete paragraphs that you did not use before submitting.-->

---------

Co-authored-by: Pablo Baeyens <[email protected]>
steves-canva pushed a commit to Canva/opentelemetry-collector that referenced this pull request Jun 14, 2024
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Restricts Environment Variable names according to the
[restrictions](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/file-configuration.md#environment-variable-substitution)
published by the OpenTelemetry Configuration Working Group. Changes both
the expand converter and the env provider. Defines one regex to be used
for both of these.

<!-- Issue number if applicable -->
#### Link to tracking issue
Fixes
open-telemetry#9531

<!--Describe what testing was performed and which tests were added.-->
#### Testing
Unit tests

<!--Please delete paragraphs that you did not use before submitting.-->

---------

Co-authored-by: Pablo Baeyens <[email protected]>
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.

[confmap] Restrict characters in environment variable URIs even more!
3 participants