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

Adopt AEP 231 - Batch Get #177

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open

Conversation

mkistler
Copy link
Contributor

Adopt AEP 231 - Batch Get

🍱 Types of changes

What types of changes does your code introduce to AEP? Put an x in the boxes
that apply

  • Enhancement
  • New proposal
  • Migrated from google.aip.dev
  • Chore / Quick Fix

📋 Your checklist for this pull request

Please review the AEP Style and Guidance for
contributing to this repository.

General

Additional checklist for a new AEP

  • A new AEP should be no more than two pages if printed out.
  • Ensure that the PR is editable by maintainers.
  • Ensure that File structure
    guidelines are met.
  • Ensure that
    Document structure
    guidelines are met.

💝 Thank you!

@mkistler mkistler requested a review from a team as a code owner April 22, 2024 14:26
@mkistler mkistler linked an issue Apr 26, 2024 that may be closed by this pull request
aep/general/0231/aep.md.j2 Show resolved Hide resolved
aep/general/0231/aep.md.j2 Outdated Show resolved Hide resolved
aep/general/0231/aep.md.j2 Outdated Show resolved Hide resolved
aep/general/0231/aep.md.j2 Outdated Show resolved Hide resolved
aep/general/0231/aep.md.j2 Outdated Show resolved Hide resolved
aep/general/0231/aep.md.j2 Outdated Show resolved Hide resolved
aep/general/0231/aep.md.j2 Show resolved Hide resolved
aep/general/0231/aep.md.j2 Outdated Show resolved Hide resolved
aep/general/0231/aep.md.j2 Outdated Show resolved Hide resolved
aep/general/0231/aep.md.j2 Show resolved Hide resolved
@mkistler mkistler requested a review from rofrankel April 27, 2024 14:33
@mkistler
Copy link
Contributor Author

@rofrankel Please re-review.

aep/general/0231/aep.md.j2 Outdated Show resolved Hide resolved
aep/general/0231/aep.md.j2 Outdated Show resolved Hide resolved
aep/general/0231/aep.md.j2 Outdated Show resolved Hide resolved
aep/general/0231/aep.md.j2 Outdated Show resolved Hide resolved
aep/general/0231/aep.md.j2 Outdated Show resolved Hide resolved
aep/general/0231/aep.md.j2 Outdated Show resolved Hide resolved
aep/general/0231/aep.md.j2 Outdated Show resolved Hide resolved
@mkistler
Copy link
Contributor Author

@rofrankel Thanks for the re-review. I addressed your comments and asked for a new review.

@mkistler
Copy link
Contributor Author

I made the updates we discussed three weeks ago. Please re-review and let me know if there is any additional feedback.

aep/general/0231/aep.md.j2 Outdated Show resolved Hide resolved
aep/general/0231/aep.md.j2 Outdated Show resolved Hide resolved
aep/general/0231/aep.md.j2 Outdated Show resolved Hide resolved
- If no resource paths are provided, the API **should** error with
`INVALID_ARGUMENT`.
- The parameter **should** be required.
- The parameter **should** identify the [resource type](./paths) that it
Copy link
Collaborator

Choose a reason for hiding this comment

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

What does "identify" mean in this context?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This language is exactly the same as the AIP.

Copy link
Member

Choose a reason for hiding this comment

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

It is a little vague as to what this term means - I think it means "document" here.

Suggested change
- The parameter **should** identify the [resource type](./paths) that it
- The documentation for the parameter **should** include the [resource type](./paths) that it

But either way we can follow-up on this, I don't think it's a blocker.

- The parameter **should** be required.
- The parameter **should** identify the [resource type](./paths) that it
references.
- The parameter should define the pattern of the resource path values.
Copy link
Collaborator

Choose a reason for hiding this comment

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

What does this mean, concretely?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This comes from the statement in the original AIP:

The comment for the field should document the resource pattern.

So this could mean in the description for the parameter or it could be more formal like a "pattern" keyword in the schema of the parameter.

Copy link
Member

Choose a reason for hiding this comment

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

I think there's two options here:

  1. leave it as is, since it's a generic description of the operation.
  2. remove this guidance and move it into protocol-specific descriptions, so we can tie it with precise recommendations.

I'm comfortable with either.

Comment on lines 125 to 126
- The response schema **must** be `type: object` with a single array property
with each item containing one of the requested resources.
Copy link
Collaborator

Choose a reason for hiding this comment

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

This seems substantially different from the proto guidance:

  1. OAS responses only have an array, where proto responses just have to include the repeated field.
  2. The OAS array just has the requested resource; the proto repeated field has either the resource or an error object.

These both seem like they should be the same across IDLs - no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They should be the same. I think the OAS description is what we want. I'll gladly fix the proto description if someone can tell me what it should be.

aep/general/0231/aep.md.j2 Outdated Show resolved Hide resolved
aep/general/0231/aep.md.j2 Outdated Show resolved Hide resolved
aep/general/0231/aep.md.j2 Outdated Show resolved Hide resolved
aep/general/0231/aep.md.j2 Outdated Show resolved Hide resolved
@mkistler
Copy link
Contributor Author

@rofrankel Thanks for the comments. I've addressed or answered all that I could. I will need help on the proto definition of the response.

I will tag you for re-review.

Copy link
Member

@toumorokoshi toumorokoshi left a comment

Choose a reason for hiding this comment

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

Thank you for all the work! The page doesn't seem to render for me today, so I think that change should be made at least.

The rest are pretty minor, and I'll watch this PR closely on replies so we can resolve them quickly. Thank you!


{% tab oas %}

{% sample 'batchget.oas.yaml', 'paths./publishers/{publisherId}/books:BatchGet.get.responses.200.content.application/json' %}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
{% sample 'batchget.oas.yaml', 'paths./publishers/{publisherId}/books:BatchGet.get.responses.200.content.application/json' %}
{% sample 'batchget.oas.yaml', 'paths./publishers/{publisherId}/books:BatchGet' %}

This is broken for me - I get a template syntax error. The site-generator matching is pretty rudimentary, I think it only does a substring match of some kind. Something to look into CC @rambleraptor, but the only blocker is the breaking of rendering.

20241018_10h40m15s_grim

pattern:

- The request **must** include an array field which accepts the resource paths
specifying the resources to retrieve. The field **should** be named `paths`.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
specifying the resources to retrieve. The field **should** be named `paths`.
specifying the resources to retrieve. The field **must** be named `paths`.

Is there a good reason to not require it be named paths?

- If no resource paths are provided, the API **should** error with
`INVALID_ARGUMENT`.
- The parameter **should** be required.
- The parameter **should** identify the [resource type](./paths) that it
Copy link
Member

Choose a reason for hiding this comment

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

It is a little vague as to what this term means - I think it means "document" here.

Suggested change
- The parameter **should** identify the [resource type](./paths) that it
- The documentation for the parameter **should** include the [resource type](./paths) that it

But either way we can follow-up on this, I don't think it's a blocker.

Comment on lines +36 to +37
- Other parameters besides `paths` **may** be "hoisted" from the [standard Get
request][get-request].
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- Other parameters besides `paths` **may** be "hoisted" from the [standard Get
request][get-request].

I don't think this is explained very well - and I think removing unclear guidance is better than including it? we can re-add with a clearer description.

I don't see any documented additional parameters in the Get, so not sure if the guidance is even relevant: https://aep.dev/131/

Comment on lines +91 to +93
- The `paths` parameter **must** be a query parameter which accepts an array of
resource paths specifying the resources to retrieve. The parameter **should**
be named `paths`.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- The `paths` parameter **must** be a query parameter which accepts an array of
resource paths specifying the resources to retrieve. The parameter **should**
be named `paths`.
- The `paths` parameter **must** be a query parameter which accepts an array of
resource paths specifying the resources to retrieve.

The guidance around the naming of the field already exists above - so remove the redundant one for conciseness?


### Response

The response for a batch get method **should** be specified with the following
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
The response for a batch get method **should** be specified with the following
The response for a batch get method **must** be specified with the following

Feels weird to have a should that includes multiple musts. Why not enforce the pattern?

the paths in the request.
- The array of resources **must** be named `results` and contain resources with
no additional wrapping.
- There must not be a `nextPageToken` field as batch get operations are not
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- There must not be a `nextPageToken` field as batch get operations are not
- There **must not** be a `nextPageToken` field as batch get operations are not


The batch get method may support a transactional form of operation where the
get either succeeds for all requested resources or fails. When supported, the
method should define a boolean parameter `transactional` that the user must
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
method should define a boolean parameter `transactional` that the user must
method must define a boolean parameter `transactional` that the user must

If we don't require that - it might be difficult for clients to understand the purpose of the value and use it.

Or we could require an annotation to specify this is the "transactional" parameter?

Comment on lines +33 to +36
- The parameter **should** identify the [resource type](./paths) that it
references.
- The parameter should define the pattern of the resource path values.
- The parameter should define the maximum number of paths allowed.
Copy link
Member

Choose a reason for hiding this comment

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

could we just update it to specify documentation? we could even qualify it in the way you described - if the protocol / description supports a way to describe it, use that. Otherwise use documentation.

- The parameter **should** be required.
- The parameter **should** identify the [resource type](./paths) that it
references.
- The parameter should define the pattern of the resource path values.
Copy link
Member

Choose a reason for hiding this comment

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

I think there's two options here:

  1. leave it as is, since it's a generic description of the operation.
  2. remove this guidance and move it into protocol-specific descriptions, so we can tie it with precise recommendations.

I'm comfortable with either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adopt AIP-0231 Batch methods: Get
4 participants