Skip to content

Conversation

@Marenz
Copy link
Contributor

@Marenz Marenz commented Sep 25, 2025

Summary

  • Rename DispatchInfo's components property to target in a backwards compatible way with deprecation warning
  • Update release notes to document the deprecation

This change maintains backward compatibility by keeping the components property as a deprecated alias for target.

@Marenz Marenz requested a review from a team as a code owner September 25, 2025 15:58
@Marenz Marenz requested review from Copilot and llucax September 25, 2025 15:58
@github-actions github-actions bot added part:docs Affects the documentation part:tests Affects the unit, integration and performance (benchmarks) tests part:dispatcher Affects the high-level dispatcher interface labels Sep 25, 2025
Copy link

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

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 components field with target field and adds deprecated components property
  • Updates all references from components to target in 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.

components: TargetComponents
"""Components to be used."""
@property
@deprecated("Use 'target' instead of 'components'.")
Copy link
Contributor

Choose a reason for hiding this comment

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

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
llucax previously approved these changes Sep 26, 2025
in a backwards compatible way with deprecation warning.

Signed-off-by: Mathias L. Baumann <[email protected]>
@Marenz Marenz merged commit 519ae09 into frequenz-floss:v0.x.x Sep 29, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

part:dispatcher Affects the high-level dispatcher interface part:docs Affects the documentation part:tests Affects the unit, integration and performance (benchmarks) tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants