Skip to content

Conversation

@llucax
Copy link
Contributor

@llucax llucax commented Jan 23, 2026

Replace Metric enum values with plain ints.

To make sure we can decouple the clients from the underlying protocol,
we need to make sure we always use explicit conversion between Python
enums and protobuf enums. This is especially important to be able to
support multiple versions of a protobuf message, for example an upcoming
v1alpha9 Metric enum, so downstream project can migrate to new versions
in a backwards-compatible way.

Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
@llucax llucax requested a review from a team as a code owner January 23, 2026 13:09
@llucax llucax requested review from shsms and removed request for a team January 23, 2026 13:09
@github-actions github-actions bot added part:docs Affects the documentation part:tests Affects the unit, integration and performance (benchmarks) tests part:metrics Affects the metrics protobuf definitions labels Jan 23, 2026
@llucax
Copy link
Contributor Author

llucax commented Jan 23, 2026

Based on #140, part of #141.

This ensures that enum values are not accidentally passed to protobuf
functions without conversion.

Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
@llucax llucax force-pushed the no-implicit-conversion branch from 91ab0f0 to a790a8c Compare January 23, 2026 13:29
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:metrics Affects the metrics protobuf definitions part:tests Affects the unit, integration and performance (benchmarks) tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant