Skip to content

feat: AIP-151 – Long-running operations#17

Merged
lukesneeringer merged 12 commits intomasterfrom
aip-151
Feb 10, 2021
Merged

feat: AIP-151 – Long-running operations#17
lukesneeringer merged 12 commits intomasterfrom
aip-151

Conversation

@lukesneeringer
Copy link
Copy Markdown
Contributor

This AIP presented some interesting issues around wording: At @mkistler's request, we were using the term "operation" where AIPs previously used "method".

I think we might need to use the term "endpoint" for that purpose so that we can use "operation" for this one. Initially, I tried to use "execution" for the concept needed here, but it did not work well.

This AIP presented some interesting issues around wording:
At @mkistler's request, we were using the term operation where
AIPs previously used method.

I think we might need to use the term endpoint for that purpose
so that we can use operation for this one.
@lukesneeringer lukesneeringer requested a review from a team as a code owner November 21, 2020 00:46
@lukesneeringer
Copy link
Copy Markdown
Contributor Author

Note to self: Fleshed out sample still needed.

}
```

- If the `done` field is `true`, then one and exactly one of the `response` and
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

(forgot to submit) Should we care about partial responses? Meaning the operation partially succeeded and returned some of the data with an error.
In that case, should we specify that StatusMonitor.error should only encompass errors that aborted the entire operation?

Comment thread aip/general/0151/aip.md.j2 Outdated
error response (AIP-193), similar to any other method.

Errors that occur over the course of an request **may** be placed in the
metadata message. The errors themselves **must** still be represented with a
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

In what cases should the error be placed in StatusMonitor.metadata but not on StatusMonitor.error?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Partial failures, for sure.

_never_ be needed. If response data might be added in the future, define an
empty message for the RPC response and use that.
- The metadata type is used to provide information such as progress, partial
failures, and similar information on each `GetOperation` call. The metadata
Copy link
Copy Markdown

@tinnou tinnou Jan 12, 2021

Choose a reason for hiding this comment

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

oh I see I should have read until the end, so the guidance if I understand correctly:

A. Errors preventing the operation to start -> (AIP-193)
B. Error making the entire request unsuccessful, (e.g a 500 on a downstream service) -> StatusMonitor.error populated, with optionally error metadata in StatusMonitor.metadata. StatusMonitor.response must not be populated.
C. Any partial failures -> StatusMonitor.response populated, and error metadata in StatusMonitor.metadata. StatusMonitor.error must not be populated.
D. Successful request no errors -> StatusMonitor.response populated, and optionally metadata in StatusMonitor.metadata. StatusMonitor.error must not be populated.

@google-cla
Copy link
Copy Markdown

google-cla Bot commented Jan 18, 2021

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@google-cla
Copy link
Copy Markdown

google-cla Bot commented Jan 19, 2021

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@google-cla
Copy link
Copy Markdown

google-cla Bot commented Jan 19, 2021

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@mkistler
Copy link
Copy Markdown

A couple of points to discuss on this one:

  • The description of the result field does not jive with the TypeScript rendering, at least for me. I would have rendered result as an actual property whose value is an object containing either a response property or a error property.

  • Rather than define a field called “metadata”, it will be more natural in a OpenAPI definition to allow StatusMonitor to have “additionalProperties”. You can represent this in Typescript with

interface StatusMonitor {
  < other fields >

  // Additional properties associated with the request.
  // Populated throughout the life of the request, including after
  // it completes.
  [x: string]: any 
}

@google-cla
Copy link
Copy Markdown

google-cla Bot commented Jan 25, 2021

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@lukesneeringer
Copy link
Copy Markdown
Contributor Author

Rather than define a field called “metadata”, it will be more natural in a OpenAPI definition to allow StatusMonitor to have “additionalProperties”.

This might be my own pre-conceived biases, but this feels worse to me than a clear structure where all the "additional properties" go. It also ensures that the "base" structure can have new properties added to the main struct in a backwards-compatible way.

@google-cla
Copy link
Copy Markdown

google-cla Bot commented Feb 2, 2021

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@google-cla
Copy link
Copy Markdown

google-cla Bot commented Feb 9, 2021

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

Copy link
Copy Markdown

@mkistler mkistler left a comment

Choose a reason for hiding this comment

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

Looks good! 👍

@lukesneeringer lukesneeringer merged commit edbc2cc into master Feb 10, 2021
@lukesneeringer lukesneeringer deleted the aip-151 branch February 10, 2021 22:06
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.

3 participants