Skip to content

Comments

Protolib#3808

Merged
roman-khimov merged 4 commits intomasterfrom
protolib
Feb 24, 2026
Merged

Protolib#3808
roman-khimov merged 4 commits intomasterfrom
protolib

Conversation

@cthulhu-rider
Copy link
Contributor

@cthulhu-rider cthulhu-rider commented Feb 10, 2026

extracted from #3792

@codecov
Copy link

codecov bot commented Feb 10, 2026

Codecov Report

❌ Patch coverage is 85.76642% with 39 lines in your changes missing coverage. Please review.
✅ Project coverage is 25.91%. Comparing base (f353ecb) to head (ca6ce19).
⚠️ Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
internal/object/wire.go 57.95% 21 Missing and 16 partials ⚠️
internal/protobuf/errors.go 50.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3808      +/-   ##
==========================================
+ Coverage   25.57%   25.91%   +0.34%     
==========================================
  Files         667      671       +4     
  Lines       42967    43219     +252     
==========================================
+ Hits        10988    11202     +214     
- Misses      30968    30990      +22     
- Partials     1011     1027      +16     

☔ 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.

@cthulhu-rider cthulhu-rider marked this pull request as ready for review February 10, 2026 20:46
var prevNum protowire.Number
loop:
for {
num, typ, n, err := iprotobuf.ParseTag(buf[off:])
Copy link
Contributor

Choose a reason for hiding this comment

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

If len(buf)==0, here we have an error? Maybe we can do a check at the beginning of the function?

Copy link
Contributor Author

@cthulhu-rider cthulhu-rider Feb 13, 2026

Choose a reason for hiding this comment

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

i dont expect this to be called with empty buffer. If so, this is an error to me

Copy link
Member

Choose a reason for hiding this comment

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

This depends on use, if used by FSTree directly it can be problematic, empty buffer can appear as a result of a file read (touch fstree/a/b/c/dobj), erroring out is better than panic in this case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added check

@cthulhu-rider cthulhu-rider force-pushed the protolib branch 2 times, most recently from ac5c79e to 525df92 Compare February 16, 2026 07:36
var prevNum protowire.Number
loop:
for {
num, typ, n, err := iprotobuf.ParseTag(buf[off:])
Copy link
Member

Choose a reason for hiding this comment

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

This depends on use, if used by FSTree directly it can be problematic, empty buffer can appear as a result of a file read (touch fstree/a/b/c/dobj), erroring out is better than panic in this case.

@cthulhu-rider cthulhu-rider force-pushed the protolib branch 2 times, most recently from e0fa335 to 1935f0b Compare February 20, 2026 11:31
cthulhu-rider added a commit to nspcc-dev/neofs-sdk-go that referenced this pull request Feb 20, 2026
It turned out that field numbers are needed for flexible protobuf'ing,
as in nspcc-dev/neofs-node#3808.

Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
cthulhu-rider added a commit to nspcc-dev/neofs-sdk-go that referenced this pull request Feb 20, 2026
It turned out that field numbers are needed for flexible protobuf'ing,
as in nspcc-dev/neofs-node#3808.

Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
cthulhu-rider added a commit to nspcc-dev/neofs-sdk-go that referenced this pull request Feb 20, 2026
It turned out that field numbers are needed for flexible protobuf'ing,
as in nspcc-dev/neofs-node#3808.

Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
cthulhu-rider added a commit to nspcc-dev/neofs-sdk-go that referenced this pull request Feb 20, 2026
It turned out that field numbers are needed for flexible protobuf'ing,
as in nspcc-dev/neofs-node#3808.

Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
@cthulhu-rider cthulhu-rider force-pushed the protolib branch 2 times, most recently from 19b8087 to c97c332 Compare February 24, 2026 14:07
Provide functionality which is going to be used for convenient protobuf
parsing. In particular, for #3783.

Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
nspcc-dev/neofs-sdk-go@99622c8...64e3fc2.

Motivation for importing constants with protocol field numbers.

Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
There is no longer and will be no need to declare such constants on site.

Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
Allows to work with object binary w/o full unmarshalling. Going to be
used in #3783.

Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
@roman-khimov roman-khimov merged commit c130f14 into master Feb 24, 2026
20 of 21 checks passed
@roman-khimov roman-khimov deleted the protolib branch February 24, 2026 16:00
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.

3 participants