Skip to content

[dynamic control] add SourceFormat string to enum conversion#2737

Merged
jaydeluca merged 5 commits intoopen-telemetry:mainfrom
jackshirazi:policy18
Apr 2, 2026
Merged

[dynamic control] add SourceFormat string to enum conversion#2737
jaydeluca merged 5 commits intoopen-telemetry:mainfrom
jackshirazi:policy18

Conversation

@jackshirazi
Copy link
Copy Markdown
Contributor

Description:

Just SourceFormat.fromConfigValue() method to convert from string to enum, needed for parsing config

Existing Issue(s):

#2546

Testing:

added

Documentation:

added

Outstanding items:

the rest of the parsing is to come

@jackshirazi jackshirazi requested a review from a team as a code owner April 1, 2026 15:31
Copilot AI review requested due to automatic review settings April 1, 2026 15:31
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a SourceFormat.fromConfigValue() helper to convert config strings into SourceFormat enum values for dynamic-control config parsing.

Changes:

  • Introduced SourceFormat.fromConfigValue(String) with trimming + case-insensitive matching against configValue()
  • Added unit tests covering case-insensitivity, whitespace trimming, and invalid inputs

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/policy/source/SourceFormat.java Adds the string-to-enum conversion helper with normalization and validation.
dynamic-control/src/test/java/io/opentelemetry/contrib/dynamic/policy/source/SourceFormatTest.java Adds tests validating parsing behavior and error handling for the new helper.

…/policy/source/SourceFormat.java

Co-authored-by: Copilot <[email protected]>
@jaydeluca jaydeluca added this pull request to the merge queue Apr 2, 2026
Merged via the queue into open-telemetry:main with commit ae69564 Apr 2, 2026
21 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.

4 participants