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

fieldmask: consider field behavior for applying updates #135

Conversation

nlachfr
Copy link

@nlachfr nlachfr commented Apr 13, 2022

Rewrite fieldmask.Update function by adding logic for handling field behavior.

func Update(mask *fieldmaskpb.FieldMask, dst, src proto.Message) {

I kept the same logic, with specific handling for OUTPUT_ONLY and IMMUTABLE behaviors :

  • OUTPUT_ONLY fields are excluded from the update
  • IMMUTABLE fields raise an error when the value in dst and src differs

I will try to add new tests regarding these cases.

Fixes #134

@nlachfr nlachfr requested review from odsod and ericwenn as code owners April 13, 2022 22:48
@alethenorio
Copy link
Contributor

@nlachfr Given the merged Pull Request and @DavyJ0nes comment can we close this?

Copy link

This PR has been open for 180 days with no activity. Remove the stale label or add a comment or it will be closed in 14 days.

@github-actions github-actions bot added the Stale label Jun 10, 2024
@github-actions github-actions bot closed this Jul 1, 2024
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.

fieldmask: use field behavior for applying updates
2 participants