Skip to content

confgen(FieldProp): support sequence in auto-merge map keys, keyed list keys, and normal fields #231

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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

Copy link

codecov bot commented Apr 24, 2025

Codecov Report

Attention: Patch coverage is 80.39216% with 20 lines in your changes missing coverage. Please review.

Project coverage is 71.13%. Comparing base (180291d) to head (5670fdd).

Files with missing lines Patch % Lines
internal/confgen/parser.go 85.96% 6 Missing and 2 partials ⚠️
internal/confgen/table_parser.go 73.33% 5 Missing and 3 partials ⚠️
internal/confgen/document_parser.go 66.66% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #231      +/-   ##
==========================================
+ Coverage   71.00%   71.13%   +0.13%     
==========================================
  Files          80       80              
  Lines       10184    10189       +5     
==========================================
+ Hits         7231     7248      +17     
+ Misses       2388     2376      -12     
  Partials      565      565              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Kybxd Kybxd force-pushed the confgen.sequence-auto-merge branch from a2966d4 to a4b0c43 Compare April 25, 2025 03:20
@Kybxd Kybxd changed the title feat: support sequence in auto-merge map keys feat: support sequence in auto-merge map keys, keyed list keys, and normal fields Apr 28, 2025
@wenchy wenchy changed the title feat: support sequence in auto-merge map keys, keyed list keys, and normal fields confgen(FieldProp): support sequence in auto-merge map keys, keyed list keys, and normal fields May 6, 2025
Comment on lines 560 to 562
func (sp *sheetParser) checkListKeyUnique(field *Field, reflectList protoreflect.List, keyData string) error {
// TODO: we need to cache key field descriptor for reuse, to avoid each loop to find it when parse table rows or document nodes.
md := reflectList.NewElement().Message().Descriptor()
Copy link
Member

@wenchy wenchy May 6, 2025

Choose a reason for hiding this comment

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

For higher performance, we'd better NOT create new element for getting MessageDescriptor, it is costy. Just use the provided parameter md ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

}
seq := keyField.opts.Prop.GetSequence()
len := int64(reflectMap.Len())
val, err := strconv.ParseInt(keyData, 10, 64)
Copy link
Member

Choose a reason for hiding this comment

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

  1. Too many same code lines in the two func: checkMapKeySequence and checkListKeySequence, please encaplulate the same code lines to one func.
  2. strconv.ParseInt(keyData, 10, 64) only support int64, but will not support uint64 when its value is out-bound-of int64.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

  1. done
  2. no need to support since values > max int64 is hardly used. tableau.proto also declares sequence as int64

@Kybxd Kybxd force-pushed the confgen.sequence-auto-merge branch from 0ac88bc to 1e899a2 Compare May 8, 2025 11:44
@Kybxd Kybxd force-pushed the confgen.sequence-auto-merge branch from 1e899a2 to 5670fdd Compare May 14, 2025 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants