Deprecate DispatchInfo.components in favor of target#194
Merged
Marenz merged 1 commit intofrequenz-floss:v0.x.xfrom Sep 29, 2025
Merged
Deprecate DispatchInfo.components in favor of target#194Marenz merged 1 commit intofrequenz-floss:v0.x.xfrom
Marenz merged 1 commit intofrequenz-floss:v0.x.xfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR deprecates the components property in DispatchInfo in favor of a new target property while maintaining backward compatibility through a deprecated property alias.
- Replaces direct
componentsfield withtargetfield and adds deprecatedcomponentsproperty - Updates all references from
componentstotargetin tests and implementation code - Documents the deprecation in release notes
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/frequenz/dispatch/_actor_dispatcher.py | Adds deprecated components property, introduces target field, and updates constructor call |
| tests/test_managing_actor.py | Updates test assertions to use target instead of components |
| RELEASE_NOTES.md | Documents the deprecation of components property |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
llucax
reviewed
Sep 26, 2025
| components: TargetComponents | ||
| """Components to be used.""" | ||
| @property | ||
| @deprecated("Use 'target' instead of 'components'.") |
Contributor
There was a problem hiding this comment.
Nitpick. I've been using X is deprecated, use Y instead, in case you want to follow the same pattern for consistency. I was also considering adding versioning info to deprecations, like:
@property
@deprecated("Use 'target' instead of 'components'.")
llucaxAdd a comment on line R42
Add diff comment
Markdown input: edit mode selected.
Nitpick. I've been using `X is deprecated, use Y instead`, in case you want to follow the same pattern for consistency. I was also considering adding versioning info to deprecations, like:
```py
def components(self) -> TargetComponents:
"""Get the target components.
Deprecation: Deprecated in vX.Y.Z
Use [`target`][frequenz....target] instead.
"""
return self.target
llucax
previously approved these changes
Sep 26, 2025
in a backwards compatible way with deprecation warning. Signed-off-by: Mathias L. Baumann <mathias.baumann@frequenz.com>
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.
Summary
DispatchInfo'scomponentsproperty totargetin a backwards compatible way with deprecation warningThis change maintains backward compatibility by keeping the
componentsproperty as a deprecated alias fortarget.