-
Notifications
You must be signed in to change notification settings - Fork 513
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
Restructure AIP-193 #1426
Restructure AIP-193 #1426
Conversation
aip/general/0193.md
Outdated
The `message` field is a a developer-facing, human-readable "debug message" | ||
which **should** be in English. (Localized messages are expressed using | ||
a `LocalizedMessage` within the `details` field.) Any dynamic aspects of | ||
the message **must** be included as metadata within the `ErrorInfo` message |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the message **must** be included as metadata within the `ErrorInfo` message | |
the `message` **must** be included as metadata within the `ErrorInfo` message |
Nit: consistently format as code when referring to the field
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's talk about this a bit more - I tend to find that it's worth keeping things not in code font when they're not explicitly talking about the field (which this isn't - it's talking about the semantic meaning). I'm happy to be persuaded, and I suspect there will be some areas where I'm inconsistent already... but to my eyes, a page where a huge proportion of the text is in code font ends up being hard to read.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with your position 100%. I think I was getting confused with semantic meaning vs. concrete reference reading the document top to bottom.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That said, my personal tendency is to explicitly state "message
value" or "the value of message
" or "the content of message
" rather than depend on context clues (like code formatting) to do that "comprehension lifting". I'm not too fussed about it though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. I'd only put the word "message" in quotes when you're referring directly to the field.
This practice is critical so that machine actors do not need to parse error | ||
messages to extract information. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: similar to earlier, this reasoning would be best in a Rationale section but I'm not going to be picky
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's leave this open so we can move it and link.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't found a good way of doing this. I'm tempted to suggest we get this PR in but raise an issue to review the new text carefully for rationale-like text - I suspect there's a fair amount of it here. Personally I'm not hugely against it in this particular case, mind you...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's fine with me (punting)
aip/general/0193.md
Outdated
- "zone": "us-east1-a", | ||
- "vmType": "e2-medium", | ||
- "attachment": "local-ssd=3,nvidia-t4=2", | ||
- "zonesWithCapacity": "us-central1-f,us-central1-c" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these be formatted as code? I guess wondering why it was switched to bulleted list even though it is a "code examle"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure... it's not really code - they're name/value pairs. (I replaced the example entirely, as I thought it was unrealistic - if we're going to use books, I wouldn't expect a title, but a resource name... I figured using the same example that we have for the complete error would be better.)
The commas were a mistake though.
I've reformatted each entry in the map as code - we could reformat it all as a JSON object if you'd like?
aip/general/0193.md
Outdated
map for the error payload to be backwards compatible, even if the value | ||
for a particular key is empty. Keys **must** be expressed as lower | ||
camel-case. | ||
In other words, once a user has observed a given key for a (reason, domain) pair they should be |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In other words, once a user has observed a given key for a (reason, domain) pair they should be | |
In other words, once a user has observed a given key for a (reason, domain) pair they **must** be |
stronger guidance? If not, perhaps just bold the should
...or change to something else if you want to just make an assertion e.g. the need to be able to rely...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rewritten - I tend to think that every "must" and "should" ought to be aimed at the target audience of the AIP - usually the service owner, rather than the user. (Client library AIPs are slightly different.) Each should/must ought to be effectively an instruction - whereas saying "the user must be able to do something" isn't really an instruction to the subject of the verb... see what you think of this rewrite :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've made the changes within the existing commit structure (I hope).
It's possible that will lose the comments - but I hope not. (If it does, I'll abandon that approach for the rest of the commits.)
aip/general/0193.md
Outdated
The `message` field is a a developer-facing, human-readable "debug message" | ||
which **should** be in English. (Localized messages are expressed using | ||
a `LocalizedMessage` within the `details` field.) Any dynamic aspects of | ||
the message **must** be included as metadata within the `ErrorInfo` message |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's talk about this a bit more - I tend to find that it's worth keeping things not in code font when they're not explicitly talking about the field (which this isn't - it's talking about the semantic meaning). I'm happy to be persuaded, and I suspect there will be some areas where I'm inconsistent already... but to my eyes, a page where a huge proportion of the text is in code font ends up being hard to read.
This practice is critical so that machine actors do not need to parse error | ||
messages to extract information. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's leave this open so we can move it and link.
aip/general/0193.md
Outdated
- "zone": "us-east1-a", | ||
- "vmType": "e2-medium", | ||
- "attachment": "local-ssd=3,nvidia-t4=2", | ||
- "zonesWithCapacity": "us-central1-f,us-central1-c" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure... it's not really code - they're name/value pairs. (I replaced the example entirely, as I thought it was unrealistic - if we're going to use books, I wouldn't expect a title, but a resource name... I figured using the same example that we have for the complete error would be better.)
The commas were a mistake though.
I've reformatted each entry in the map as code - we could reformat it all as a JSON object if you'd like?
aip/general/0193.md
Outdated
map for the error payload to be backwards compatible, even if the value | ||
for a particular key is empty. Keys **must** be expressed as lower | ||
camel-case. | ||
In other words, once a user has observed a given key for a (reason, domain) pair they should be |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rewritten - I tend to think that every "must" and "should" ought to be aimed at the target audience of the AIP - usually the service owner, rather than the user. (Client library AIPs are slightly different.) Each should/must ought to be effectively an instruction - whereas saying "the user must be able to do something" isn't really an instruction to the subject of the verb... see what you think of this rewrite :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your responses to my review and the following two commits lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the reviews so far - I'll ping again when I've added the commits for the final sections. (We may also want to separate out "everything to do with Status" from "how to decide which error codes to use, but that can be a later PR.)
This is now "finished" (other than adding a dated update line to the bottom) in that I've been through it all. There are quite a few changes which will need further discussion though - and no doubt nits here and there. I would propose that from now on, changes are made as new commits instead of updating the existing ones, if that's okay with everyone. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM
For posterity, we want a few more reviews, specific @shwoodard and @jschneider11
aip/general/0193.md
Outdated
RPCs which have **always** included `ErrorInfo` are in a better position: | ||
the contract is then more about the stability of `ErrorInfo` for any given | ||
error: the reason and domain need to be consistent over time, and the | ||
metadata provided for any given (reason,domain) can only be expanded. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Is it OK to have multiple colons in the same sentence?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it's horrible - sorry about that. I think changing the second colon to a period would be better. Will do that locally, but not create a commit just for that. (I'll wait until we get more feedback to avoid a storm of tiny commits.)
aip/general/0193.md
Outdated
|
||
Each type of detail payload **must** be included at most once. For | ||
example, there **must not** be more than one [`BadRequest`][BadRequest] | ||
message in the `details`, but there **may** be a `BadRequest` and a | ||
[`PreconditionFailure`][PreconditionFailure]. | ||
|
||
##### ErrorInfo payload | ||
Structured details with machine-readable identifiers **must** be used so |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm now considering removing this paragraph entirely. It's already covered later on, and the currnet "if an error message does not have a machine-readable identifier in addition to the message" effectively contradicts the requirement that we always provide an ErrorInfo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I'm a little unsure of the value this paragraph is now providing. Agreed that it adds some confusion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tacked just "This provides machine-readable identifiers so that that users can write code against specific aspects of the error" onto the next paragraph (which was otherwise very short anyway). I think that captures the important bit.
aip/general/0193.md
Outdated
|
||
Each type of detail payload **must** be included at most once. For | ||
example, there **must not** be more than one [`BadRequest`][BadRequest] | ||
message in the `details`, but there **may** be a `BadRequest` and a | ||
[`PreconditionFailure`][PreconditionFailure]. | ||
|
||
##### ErrorInfo payload | ||
Structured details with machine-readable identifiers **must** be used so |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I'm a little unsure of the value this paragraph is now providing. Agreed that it adds some confusion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been requested to review, but can't approve this PR.
LGTM, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've now left a "potentially last commit" - I had to force push, due to (I suspect) some local modifications, but it's only the last commit that should require re-review.
aip/general/0193.md
Outdated
remain the same for any given error, as developers have previously had no | ||
option but to use this for error handling. For more information, see | ||
[Changing Error Messages](#changing-error-messages). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done exactly as stated.
aip/general/0193.md
Outdated
|
||
Each type of detail payload **must** be included at most once. For | ||
example, there **must not** be more than one [`BadRequest`][BadRequest] | ||
message in the `details`, but there **may** be a `BadRequest` and a | ||
[`PreconditionFailure`][PreconditionFailure]. | ||
|
||
##### ErrorInfo payload | ||
Structured details with machine-readable identifiers **must** be used so |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tacked just "This provides machine-readable identifiers so that that users can write code against specific aspects of the error" onto the next paragraph (which was otherwise very short anyway). I think that captures the important bit.
This practice is critical so that machine actors do not need to parse error | ||
messages to extract information. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't found a good way of doing this. I'm tempted to suggest we get this PR in but raise an issue to review the new text carefully for rationale-like text - I suspect there's a fair amount of it here. Personally I'm not hugely against it in this particular case, mind you...
aip/general/0193.md
Outdated
library: "Garfield East" | ||
expectedReturnDate: "2199-05-13" | ||
``` | ||
The reason should be terse, but meaningful enough for a human reader to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason should be terse, but meaningful enough for a human reader to | |
The reason **should** be terse, but meaningful enough for a human reader to |
Nit: Is this a requirement word or should we use a different one (or should we not fuss about use of requirement wrods in a non-requirement context?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine for it to be a requirement word. Added a new comment for this and the other example.
This practice is critical so that machine actors do not need to parse error | ||
messages to extract information. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's fine with me (punting)
aip/general/0193.md
Outdated
- However, the `Status.message` *string* **must** not be changed, as | ||
this change is backward-incompatible. | ||
Textual error messages can be present in both `Status.message` and | ||
`LocalizedMessage.message` fields. Messages should be succinct but |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`LocalizedMessage.message` fields. Messages should be succinct but | |
`LocalizedMessage.message` fields. Messages **should** be succinct but |
ditto re:requirement word or not
This is more of an informative section than anything else - API designers only need to know about it in order to understand the JSON response they might see from curl etc.
(This doesn't include anything about the details "payloads" yet.)
Note: this has removed the term "dynamic variables" in favor of only referring to it as "metadata". It's handy to have a single well-defined term, and given that the field name is `metatadata`, I've kept that.
Note that we don't currently (as far as I'm aware) have a good standardized way of letting users specify a locale. (Can they use Accept-Language, for example? What about in gRPC?) We can tackle that separately. This commit changes the guidance in a couple of important ways: - It says that the locale should be a user-specified one rather than a "service's native language" - It calls out the ability to use LocalizedMessage even when we don't have a user-specified language, when Status.message can't be changed for compatibility reasons This commit *doesn't* address the issue of the target audience of LocalizedMessage; later text claims this is aimed at end-users whereas Status.message is more aimed at developers. I'm not convinced by that at the moment.
Significant changes here (all up for discussion): - Explicitly include Status.message as well as LocalizedMessage.message - Remove the standardized https://cloud.google.com/PRODUCT/docs/ERROR-REASON format requirement - Require the description to be suitable as text for a link - Require the description to be plain text - Require the URL to be absolute and include a scheme - Add authentication requirements
Note: this removes the "message alignment" section which I found confusing. We could restore and edit it should we wish.
Note: this removes the idea that LocalizedMessage is for "end users" as a distinction between that and Status.message being for developers. If we still want that distinction, we should talk about it more and clarify it - in particular, if we're using LocalizedMessage as an alternative for Status.message where the latter can't be changed, they can't really cater for different audiences.
Pushed one extra commit and rebased. Will merge on green. |
No description provided.