[BE] Migrate protobufs to using the new `editions` feature
General
Escalation
General
Escalation
Description
Issue
Following the migration to buf.build tooling in 2024 and after the enforcement of some the protobuf API best practices therefore, we realized that some of the generated code feature excessively long entity names. One particular concern was to have all enums prefixed with the enum name twice (see PMM-12723).
Solution
As we researched the possibility of shortening the enum names by using one of the 3rd-party tools, namely alta/protopatch, we discovered a better, more natural, solution for this issue, which was contributed to by the maintainers of the protobuf library. Given the reasons explained in , we decided to wait until early 2025, when the protobuf edition 2024 is expected to be officially supported by our current proto tools. One it is available, we will migrate to edition 2024, which implements an option for shorter enum names.
For end users, this feature will only be available once: 1. protoc declares support for edition 2024 (expected early 2025). 2. protoc-gen-go declares support for edition 2024.
NOTE: while this task will bring along great maintenance benefits, it should not result in any changes for API users.
How to test
Run a manual sanity check of major components such as:
Metrics dashboards
PMM Settings
Inventory
Alerting
Backups
QAN
Run end-to-end tests to be sure the API endpoints behave as before
Issue
Following the migration to buf.build tooling in 2024 and after the enforcement of some the protobuf API best practices therefore, we realized that some of the generated code feature excessively long entity names. One particular concern was to have all
enums
prefixed with the enum name twice (see PMM-12723).Solution
As we researched the possibility of shortening the enum names by using one of the 3rd-party tools, namely alta/protopatch, we discovered a better, more natural, solution for this issue, which was contributed to by the maintainers of the
protobuf
library. Given the reasons explained in , we decided to wait until early 2025, when theprotobuf
edition2024
is expected to be officially supported by our current proto tools. One it is available, we will migrate toedition 2024
, which implements an option for shorter enum names.NOTE: while this task will bring along great maintenance benefits, it should not result in any changes for API users.