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

[AIP-203] Clarify behavior when updating immutable fields. #516

Merged
merged 4 commits into from Jun 5, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions aip/0203.md
Expand Up @@ -119,10 +119,18 @@ field on a request message (a message that is an argument to an RPC, usually
ending in `Request`), or a field of a message included within a request
message.

When a service receives an immutable field in an update request (or similar),
even if included in the update mask, the service **should** ignore the field if
the value matches, but **should** error with `INVALID_ARGUMENT` if a change is
requested.

Potential use cases for immutable fields (this is not an exhaustive list) are:

- Names or IDs which are set on creation and then used as a primary key.

**Note:** Fields which are "conditionally immutable" **must not** be given the

Choose a reason for hiding this comment

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

Is "conditionally immutable" defined elsewhere? Does that mean things like "GCE instance size", which is immutable while the instance is powered on, but mutable if the instance is powered off?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes.

immutable annotation.

### Optional

The use of `OPTIONAL` indicates that a field is not required, nor covered by
Expand All @@ -143,5 +151,7 @@ either all optional fields should be indicated, or none of them should be.

## Changelog

- **2020-05-27**: Clarify behavior when receiving an immutable field in an
update.
- **2019-12-05**: Added guidance on output only fields in field masks.
- **2019-06-18**: Use the machine-readable annotation, not comments.