Skip to content

Multiple repeated fields are allowed #1921

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

Merged
merged 13 commits into from
Jan 28, 2021
Merged

Multiple repeated fields are allowed #1921

merged 13 commits into from
Jan 28, 2021

Conversation

topherCantrell
Copy link
Contributor

The protobuffer comments have been corrected here:
https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto#L85-L86

The restriction was intended for the path string itself and not the
entire mask. There can be only one repeated field in a path string, and
when we get to it, the path string is done.

We found ourselves using multiple repeated fields in a message.

This fixes:

#1766

The protobuffer comments have been corrected here:
https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto#L85-L86

The restriction was intended for the path string itself and not the
entire mask. There can be only one repeated field in a path string, and
when we get to it, the path string is done.
@google-cla
Copy link

google-cla bot commented Jan 24, 2021

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@topherCantrell
Copy link
Contributor Author

@googlebot I signed it!

@google-cla google-cla bot added cla: yes and removed cla: no labels Jan 24, 2021
@codecov-io
Copy link

codecov-io commented Jan 24, 2021

Codecov Report

Merging #1921 (4b26c3e) into master (c94a79d) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1921      +/-   ##
==========================================
- Coverage   57.96%   57.96%   -0.01%     
==========================================
  Files          34       34              
  Lines        3771     3766       -5     
==========================================
- Hits         2186     2183       -3     
+ Misses       1311     1310       -1     
+ Partials      274      273       -1     
Impacted Files Coverage Δ
runtime/fieldmask.go 85.00% <100.00%> (+1.92%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c94a79d...4b26c3e. Read the comment docs.

@irridia
Copy link
Contributor

irridia commented Jan 24, 2021

Thanks @topherCantrell! This was still on my list, but hadn't yet made it to the top.

Copy link
Collaborator

@johanbrandhorst johanbrandhorst left a comment

Choose a reason for hiding this comment

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

Thanks for this! Could you please add a new test case that exhibits the new behaviour too?

@topherCantrell
Copy link
Contributor Author

There we go. A test for multiple repeats.

Copy link
Collaborator

@johanbrandhorst johanbrandhorst left a comment

Choose a reason for hiding this comment

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

Nice, thanks a lot for this!

@johanbrandhorst johanbrandhorst merged commit 57c8d7b into grpc-ecosystem:master Jan 28, 2021
johanbrandhorst added a commit that referenced this pull request Feb 5, 2021
The repeated paths parsing that was introduced in
#1921 was causing tests to fail sporadically
as the output of the parser was not deterministic.
Sort the paths after parsing for deterministic
output.
johanbrandhorst added a commit that referenced this pull request Feb 5, 2021
The repeated paths parsing that was introduced in
#1921 was causing tests to fail sporadically
as the output of the parser was not deterministic.
Sort the paths after parsing for deterministic
output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants