[dynamic control] refactor sourceKey to policyId to align to spec#2949
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors the dynamic-control “policy init” configuration schema and related code/docs to rename the mapping field sourceKey to policyId, aligning terminology with the dynamic control specification.
Changes:
- Renamed init-config mapping field from
sourceKey→policyIdacross JSON/YAML parsers, models, and runtime wiring. - Updated unit tests and test fixtures to use
policyId. - Updated README examples and explanations to reflect the new field name (and related guidance text).
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| dynamic-control/src/test/resources/io/opentelemetry/contrib/dynamic/policy/registry/yaml/policy-init-example.yaml | Updates YAML fixture mappings to use policyId. |
| dynamic-control/src/test/resources/io/opentelemetry/contrib/dynamic/policy/registry/json/policy-init-example.json | Updates JSON fixture mappings to use policyId. |
| dynamic-control/src/test/java/io/opentelemetry/contrib/dynamic/policy/registry/yaml/YamlPolicyInitConfigReaderTest.java | Updates YAML reader tests to assert getPolicyId() and updated error text. |
| dynamic-control/src/test/java/io/opentelemetry/contrib/dynamic/policy/registry/PolicyInitTest.java | Updates declarative + JSON init test strings/constants for policyId. |
| dynamic-control/src/test/java/io/opentelemetry/contrib/dynamic/policy/registry/PolicyInitConfigTest.java | Updates init-config tests (JSON/YAML + declarative) to use policyId. |
| dynamic-control/src/test/java/io/opentelemetry/contrib/dynamic/policy/registry/json/JsonPolicyInitConfigReaderTest.java | Updates JSON reader tests to assert getPolicyId() and updated error text. |
| dynamic-control/src/test/java/io/opentelemetry/contrib/dynamic/DynamicControlAutoConfigurationTest.java | Updates YAML init config snippet to use policyId. |
| dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/policy/registry/PolicySourceMappingConfig.java | Renames the model field/getter/ctor param from sourceKey to policyId. |
| dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/policy/registry/PolicyInitConfig.java | Renames declarative key constant and updates declarative mapping parsing + javadoc examples. |
| dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/policy/registry/PolicyInit.java | Updates error message context to print mapping.getPolicyId(). |
| dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/policy/registry/json/JsonNodePolicyInitConfigParser.java | Updates JSON mapping parsing to read policyId. |
| dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/policy/OpampPolicyProvider.java | Renames mapping map to policyIdToPolicyType and wires lookup accordingly. |
| dynamic-control/README.md | Updates configuration documentation/examples from sourceKey to policyId and related explanatory text. |
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
25 tasks
LikeTheSalad
approved these changes
Jun 25, 2026
jaydeluca
approved these changes
Jul 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
Just a name change, nothing else. The spec "policy ID" is what I've been naming as "source key", so this refactors all usages (including variants).
Existing Issue(s):
#2868
Testing:
Full test suite ran with new refactored values
Documentation:
Also refactored to be consistent
Outstanding items:
#2868