Skip to content

Conversation

@tiyash-basu-frequenz
Copy link
Contributor

closes #253
closes #254

This commit removes the unnecessary gap in numbering in the
`ElectricalComponentCategory` enum in the `electrical_components.proto`
file.

Signed-off-by: Tiyash Basu <[email protected]>
This commit fixes gaps in the metric enum numbers in the
`metric_sample.proto` file.

Signed-off-by: Tiyash Basu <[email protected]>
Copilot AI review requested due to automatic review settings May 19, 2025 11:13
@tiyash-basu-frequenz tiyash-basu-frequenz requested a review from a team as a code owner May 19, 2025 11:13
@github-actions github-actions bot added part:docs Affects the documentation part:protobuf Affects the protocol buffer definition files labels May 19, 2025
Copy link
Contributor

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 removes gaps in the numeric values of two protobuf enums to create contiguous value ranges.

  • Renumbered variants in ElectricalComponentCategory to eliminate an unused value.
  • Renumbered variants in Metric to eliminate gaps in the sequence.
  • Updated release notes to document the enum renumbering.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
proto/frequenz/api/common/v1/microgrid/electrical_components/electrical_components.proto Shifted enum values down by one for several categories to close a numbering gap.
proto/frequenz/api/common/v1/metrics/metric_sample.proto Adjusted enum values for reactive energy, battery, and sensor metrics to remove gaps.
RELEASE_NOTES.md Noted the removal of enum gaps for ElectricalComponentCategory and Metric.
Comments suppressed due to low confidence (2)

proto/frequenz/api/common/v1/microgrid/electrical_components/electrical_components.proto:51

  • Renumbering existing enum values is a breaking change for any stored or transmitted data. Consider reserving the old value (8) or adding a new enum version to maintain backward compatibility.
ELECTRICAL_COMPONENT_CATEGORY_CRYPTO_MINER = 7;

proto/frequenz/api/common/v1/metrics/metric_sample.proto:142

  • Changing the numeric identifiers of existing metrics can break clients that rely on these values. It’s safer to reserve the old numbers (69/70) or bump to a new enum version rather than renumber in place.
METRIC_AC_REACTIVE_ENERGY_PHASE_2 = 68;

Copy link

@nhatcher-frequenz nhatcher-frequenz left a comment

Choose a reason for hiding this comment

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

LGTM!

@tiyash-basu-frequenz tiyash-basu-frequenz added this pull request to the merge queue May 19, 2025
Merged via the queue into frequenz-floss:v0.x.x with commit 997959c May 19, 2025
6 checks passed
@tiyash-basu-frequenz tiyash-basu-frequenz deleted the 253_254_enum_numbering branch May 19, 2025 12:21
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.

Gap in COMPONENT_CATEGORY_XXX tags Minor inconcistencies in METRIC_XXX tags

2 participants