NUbots / NUbots/NUbots

Protobuf optional fields support

Open
#556 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

-New-Feature D-Not-Too-Hard G-DevOps-QA L-C++ L-CMake L-Protobuf
Dominant language
C++
Stars
41
Forks
22
Avg merge
1h 48m
Merged PRs (30d)
1

Description

Because we use custom headers for protobuf messages *.hpp instead of the ones generated by protoc i.e. *.pb.h, we are missing the functions has_<fieldname>() which allow you to check if an optional field was part of the message.

For our existing use cases, we can check against default value to see if an optional field was included in the message or not. There might be a problem if the default value is actually a valid value for that field...

It might be worth considering if we should add explicit support for checking if an optional field was part of a protobuf message.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Inspect the custom protobuf message headers (*.hpp) and compare them with protoc-generated *.pb.h files, focusing on the missing has_() behavior. Review how optional fields are currently represented and identify the message-generation or header entry point involved. Done should include an agreed scope for explicit optional-field presence checks and verification of the affected message use cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend-api-design, robotics
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.