Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

let's add side-by-side with "official" protobuf marshaling #2

Closed
6 tasks done
DmitriyMV opened this issue Jul 22, 2022 · 0 comments · Fixed by #3
Closed
6 tasks done

let's add side-by-side with "official" protobuf marshaling #2

DmitriyMV opened this issue Jul 22, 2022 · 0 comments · Fixed by #3
Assignees

Comments

@DmitriyMV
Copy link
Member

DmitriyMV commented Jul 22, 2022

let's add side-by-side with "official" protobuf marshaling
Originally posted by @smira in #1 (review)

Task

We should ensure that our encoder/decoder works with binary data and structs produced by official protobuf compiler. For that each test should basically contain the following.

  1. Marshal Go structs to binary form using our own Marshaller
  2. Unmarshal binary form into generated Go structs compiled by protobuf from proto messages using proto.Unmarshal
  3. Ensure that fields in two structs match.
  4. Encode resulting generated Go structs back to binary form using proto.Marshal
  5. Unmarshal binary form into original Go structs using our own Unmarshaller.
  6. Ensure that resulting struct match the original one from the stage 1.

The following test cases should be implemented:

  • Messages with simple fields.
  • Messages with repeated simple fields.
  • Messages with maps of simple fields.
  • Messages containing a map where the key is a simple type and the value is a message that contains variations of the above.
  • Complex messages with inner messages which contain either maps or repeated fields or both in various forms.

anyof and to lesser extent enum are not supported for now.

Questions

  • Does kres support code generation for protobuf messages that are not attached to GRPC methods?
@DmitriyMV DmitriyMV self-assigned this Jul 25, 2022
DmitriyMV added a commit that referenced this issue Jul 26, 2022
This tests ensures that our encoding is compatible with official proto modules.

Closes #2
DmitriyMV added a commit that referenced this issue Jul 26, 2022
This tests ensures that our encoding is compatible with official proto modules.

Closes #2

Signed-off-by: Dmitriy Matrenichev <dmitry.matrenichev@siderolabs.com>
DmitriyMV added a commit that referenced this issue Jul 26, 2022
This tests ensures that our encoding is compatible with official proto modules.

Closes #2

Signed-off-by: Dmitriy Matrenichev <dmitry.matrenichev@siderolabs.com>
DmitriyMV added a commit that referenced this issue Jul 26, 2022
This tests ensures that our encoding is compatible with official proto modules.

Closes #2

Signed-off-by: Dmitriy Matrenichev <dmitry.matrenichev@siderolabs.com>
DmitriyMV added a commit that referenced this issue Jul 26, 2022
This test ensures that our encoding is compatible with official proto modules. It doesn't verify that binary form is equivalent because we do encode zero values, unlike official encoder.

Also add simple fuzzing.

Closes #2

Signed-off-by: Dmitriy Matrenichev <dmitry.matrenichev@siderolabs.com>
DmitriyMV added a commit that referenced this issue Jul 26, 2022
This test ensures that our encoding is compatible with official proto modules. It doesn't verify that binary form is equivalent because we do encode zero values, unlike official encoder.

Also add simple fuzzing.

Closes #2

Signed-off-by: Dmitriy Matrenichev <dmitry.matrenichev@siderolabs.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant