Skip to content

[dynamic control] refactor sourceKey to policyId to align to spec#2949

Merged
jaydeluca merged 4 commits into
open-telemetry:mainfrom
jackshirazi:policy-phase2-09
Jul 1, 2026
Merged

[dynamic control] refactor sourceKey to policyId to align to spec#2949
jaydeluca merged 4 commits into
open-telemetry:mainfrom
jackshirazi:policy-phase2-09

Conversation

@jackshirazi

Copy link
Copy Markdown
Contributor

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

@jackshirazi
jackshirazi requested a review from a team as a code owner June 23, 2026 15:31
Copilot AI review requested due to automatic review settings June 23, 2026 15:31
@github-actions
github-actions Bot requested a review from LikeTheSalad June 23, 2026 15:31

Copilot AI left a comment

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.

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 sourceKeypolicyId across 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.

Comment thread dynamic-control/README.md Outdated
Comment thread dynamic-control/README.md Outdated
@jaydeluca
jaydeluca added this pull request to the merge queue Jul 1, 2026
Merged via the queue into open-telemetry:main with commit 3fd5dc2 Jul 1, 2026
24 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