Skip to content

Conversation

@Marenz
Copy link
Contributor

@Marenz Marenz commented Nov 5, 2025

Summary

Synchronize naming conventions for component target selectors with the monitoring API to maintain consistency across Frequenz APIs.

Changes

  • Rename message types to follow *Selector suffix pattern
  • Add ElectricalComponent prefix to selector types for clarity
  • Rename component_categories_typescomponent_categories (remove redundant _types suffix)
  • Rename deprecated component_categoriescomponent_categories_deprecated (add explicit suffix)

This aligns with the naming patterns introduced in frequenz-io/frequenz-api-monitoring-common@e26eeb0.

Related

  • frequenz-io/frequenz-api-monitoring-common#e26eeb0b332d41714aa391897efcd3613aad1b8e

@Marenz Marenz requested a review from a team as a code owner November 5, 2025 12:04
@github-actions github-actions bot added the part:protobuf Affects the protocol buffer definition files label Nov 5, 2025
@github-actions github-actions bot added the part:docs Affects the documentation label Nov 5, 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 refactors message type names in the dispatch API to use more descriptive and consistent naming. The changes rename internal message types to better reflect their purpose as electrical component selectors, and updates the deprecated field to use a clearer naming convention.

  • Renamed message types from generic names (IdSet, CategorySet, etc.) to more descriptive names (ElectricalComponentIdSelector, ElectricalComponentCategorySelector, etc.)
  • Updated the deprecated field name from component_categories to component_categories_deprecated to clearly indicate its deprecated status
  • Renamed the active field from component_categories_types to component_categories for better API consistency
Comments suppressed due to low confidence (2)

proto/frequenz/api/dispatch/v1/dispatch.proto:381

  • The example comment references the old field name component_categories. This should be updated to component_categories which now refers to field 3 (the renamed component_categories_types), or the structure of the example should be verified to match the current API.
//     component_categories {

proto/frequenz/api/dispatch/v1/dispatch.proto:384

  • Corrected spelling of 'cateogry' to 'category'.
//         {cateogry: COMPONENT_CRYPTO_MINER}

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Add 'deprecated' suffix to old component_categories field and remove
redundant '_types' suffix from component_categories_types field.

Signed-off-by: Mathias L. Baumann <mathias.baumann@frequenz.com>
@Marenz
Copy link
Contributor Author

Marenz commented Nov 5, 2025

@thomas-nicolai-frequenz fyi

Copy link
Contributor

@llucax llucax left a comment

Choose a reason for hiding this comment

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

Other than that, and not having a lot of context on why the name changes, LGTM.

* `CategorySet``ElectricalComponentCategorySelectorDeprecated`
* `CategoryTypeSet``ElectricalComponentCategorySelector`
* `CategoryAndType``ComponentCategory`
* `component_categories``component_categories_deprecated` (deprecated field)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why the renaming here, just to make it more explicit that it is deprecated? This will make it a breaking change in the generated code (even if the wire format stays compatible).

I guess since we are introducing many breaking changes to the generated code it is not a big deal, but I still wonder...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I mean, all changes of this PR will break the generated code-dependent projects, unfortunately, yes.
And All changes are only for syncing/better understandability.

Choose a reason for hiding this comment

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

I don't think we should worry much about breaking changes at this point in time. Better now than later.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, not a big issue, we can also deal with the breaking change at other level of the python abstraction.

Still for me it sounds weird to document a field is deprecated in the field name, there is even a protobuf way to do it: int32 old_field = 6 [deprecated = true]; (not sure what the effect is on generated code though.

Choose a reason for hiding this comment

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

Still for me it sounds weird to document a field is deprecated in the field name, there is even a protobuf way to do it: int32 old_field = 6 [deprecated = true]; (not sure what the effect is on generated code though.

Yeah agreed. We could also release a new version if required. Otherwise I'd suggest to just remove the field after all.

@Marenz
Copy link
Contributor Author

Marenz commented Nov 20, 2025

The context is this comment, not much more other than that and kyle poking me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

part:docs Affects the documentation part:protobuf Affects the protocol buffer definition files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants