dev-sys-do / sealci

A Rust Continuous Integration Framework
Apache License 2.0
10 stars 0 forks source link

fixed proto field numbers #16

Closed theotchlx closed 2 months ago

theotchlx commented 2 months ago

Fixes :

...
message Health {
    int32 cpu_usage = 2;
    int32 memory_usage = 3;
}
...

into:

...
message Health {
    int32 cpu_usage = 1;
    int32 memory_usage = 2;
}
...

This was a mistake caused by a logic error, due to the fact that the Health message is used in the HealthStatus message as its second field. However, as stated in the protobuff documentation, message fields are independant from other messages (and, as a counter-example, Health could also be used as the third field of another message, breaking the logic).

Link to doc : https://protobuf.dev/programming-guides/proto3/#assigning citing:

The given number must be unique among all fields for that message.

Also see the following: https://protobuf.dev/programming-guides/proto3/#other