Skip to content

Conversation

bigbes
Copy link
Collaborator

@bigbes bigbes commented Aug 14, 2025

  • supported optional types are int*, uint*, float*, bytes, string, bool
  • fully redo configuration for golangci-lint
  • simple tests for encoding/decoding roundtrip

Closes TNTP-3729.

@bigbes bigbes force-pushed the bigbes/TNTP-3729-generator-for-builtin-go-types branch from d1b999f to 25d23bb Compare August 14, 2025 15:41
@coveralls
Copy link

coveralls commented Aug 14, 2025

Pull Request Test Coverage Report for Build 17094978647

Details

  • 1112 of 1208 (92.05%) changed or added relevant lines in 19 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+92.1%) to 92.053%

Changes Missing Coverage Covered Lines Changed/Added Lines %
bool_gen.go 60 66 90.91%
byte_gen.go 60 66 90.91%
bytes_gen.go 60 66 90.91%
float32_gen.go 60 66 90.91%
float64_gen.go 60 66 90.91%
int16_gen.go 60 66 90.91%
int32_gen.go 60 66 90.91%
int64_gen.go 60 66 90.91%
int8_gen.go 60 66 90.91%
int_gen.go 60 66 90.91%
Totals Coverage Status
Change from base Build 16726999280: 92.1%
Covered Lines: 1112
Relevant Lines: 1208

💛 - Coveralls

@bigbes bigbes force-pushed the bigbes/TNTP-3729-generator-for-builtin-go-types branch 5 times, most recently from b3efea9 to 9db06ac Compare August 15, 2025 13:06
@bigbes bigbes marked this pull request as ready for review August 15, 2025 13:08
Copilot

This comment was marked as outdated.

@bigbes bigbes force-pushed the bigbes/TNTP-3729-generator-for-builtin-go-types branch from 9db06ac to afaf510 Compare August 18, 2025 15:16
@bigbes bigbes requested review from Copilot and oleg-jukovec August 18, 2025 15:16
@bigbes bigbes force-pushed the bigbes/TNTP-3729-generator-for-builtin-go-types branch from afaf510 to 0241968 Compare August 18, 2025 15:20
Copilot

This comment was marked as outdated.

@bigbes bigbes force-pushed the bigbes/TNTP-3729-generator-for-builtin-go-types branch 2 times, most recently from d2b5880 to 8229f0d Compare August 18, 2025 15:35
@bigbes bigbes requested a review from Copilot August 18, 2025 15:35
Copilot

This comment was marked as outdated.

@bigbes bigbes force-pushed the bigbes/TNTP-3729-generator-for-builtin-go-types branch from 8229f0d to 217f1d6 Compare August 18, 2025 15:42
@bigbes bigbes force-pushed the bigbes/TNTP-3729-generator-for-builtin-go-types branch from 217f1d6 to b25e25f Compare August 18, 2025 15:53
Copy link
Collaborator

@oleg-jukovec oleg-jukovec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, update the commit message:

Closes TNTP-3729. -> Closes TNTP-3729

@bigbes bigbes changed the title TNTP-3729: generator for builtin go types generator: implement generator for builtin go types Aug 18, 2025
@bigbes bigbes force-pushed the bigbes/TNTP-3729-generator-for-builtin-go-types branch from b25e25f to 242d515 Compare August 18, 2025 15:58
@bigbes bigbes requested a review from Copilot August 18, 2025 15:58
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements a generator for builtin Go optional types with MessagePack serialization support. The generator produces optional types for int*, uint*, float*, bytes, string, bool, and byte with comprehensive test coverage for all methods including encoding/decoding roundtrip tests.

  • Introduces a template-based code generator that creates consistent optional type implementations
  • Adds complete MessagePack serialization/deserialization support with proper error handling
  • Provides comprehensive test coverage for all generated optional types

Reviewed Changes

Copilot reviewed 41 out of 42 changed files in this pull request and generated no comments.

Show a summary per file
File Description
go.mod Updated Go version and added dependencies for msgpack, testify, and text processing
generate.go Added go:generate directive for code generation
cmd/generator/generator.go Core generator implementation with templates for optional types and tests
zero.go Helper function for generic zero value initialization
msgpack.go MessagePack encoding/decoding utilities with type checking
errors.go Custom error types for encode/decode operations
*_gen.go Generated optional type implementations (byte, int*, uint*, float*, string, bytes, bool)
*_gen_test.go Generated comprehensive tests for all optional types
errors_test.go Unit tests for error handling functionality

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

@bigbes bigbes force-pushed the bigbes/TNTP-3729-generator-for-builtin-go-types branch 2 times, most recently from 242d515 to 8b695f8 Compare August 19, 2025 14:45
@bigbes bigbes force-pushed the bigbes/TNTP-3729-generator-for-builtin-go-types branch from 8b695f8 to 45b6455 Compare August 19, 2025 15:12
@dmyger
Copy link

dmyger commented Aug 20, 2025

Closes TNTP-3729

Closes #TNTP-3729
Tasks are referenced with the symbol #.

return out
}

var defaultTypes = []generatorDef{
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: Would it make sense to move the contents of this array to a separate json | yaml file and specify it as an argument for the generator?
Perhaps this will allow the generator to be reused in other projects for custom data types?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code will be optimized for client usage, when TNTP-3734 will be implemented.

* supported optional types are int*, uint*, float*, bytes, string, bool
* fully redo configuration for golangci-lint
* simple tests for encoding/decoding roundtrip

Closes #TNTP-3729
@bigbes bigbes force-pushed the bigbes/TNTP-3729-generator-for-builtin-go-types branch from 45b6455 to 36c2684 Compare August 20, 2025 09:55
@bigbes bigbes merged commit b2f62c3 into master Aug 20, 2025
19 of 21 checks passed
@bigbes bigbes deleted the bigbes/TNTP-3729-generator-for-builtin-go-types branch August 20, 2025 10:03
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 this pull request may close these issues.

4 participants