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

fix(AIP-121): ignore standard method lookalikes #1250

Merged
merged 1 commit into from
Sep 12, 2023

Conversation

noahdietz
Copy link
Collaborator

Ignore methods that look like standard methods but don't actually operate on a resource as a standard method would. This prevents false positive findings related for messages that aren't actually resources but have some standard method lookalikes. Similar to #1235

@noahdietz noahdietz requested a review from a team as a code owner September 11, 2023 23:33
@@ -33,16 +33,16 @@ var resourceMustSupportGet = &lint.ServiceRule{
// Iterate all RPCs and try to find resources. Mark the
// resources which have a Get method, and which ones do not.
for _, m := range s.GetMethods() {
if utils.IsGetMethod(m) {
if utils.IsGetMethod(m) && utils.IsResource(utils.GetResponseType(m)) {
Copy link

Choose a reason for hiding this comment

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

This presumably won't don't oddities like streaming requests or responses, but it's tighter than it was.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That's a good point, it won't. I might come back for that though, same goes for the Must have List rule as well.

@noahdietz noahdietz merged commit 34aa3c8 into googleapis:main Sep 12, 2023
@noahdietz noahdietz deleted the fix-get-enforcement branch September 12, 2023 15:16
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.

2 participants