profile
viewpoint
Andrew Paseltiner apasel422 Google

apasel422/eclectic 23

Experimental collection traits for Rust

apasel422/tree 4

An ordered map and set based on a binary search tree.

apasel422/pairing-heap 2

A priority queue based on a pairing heap

apasel422/binomial-heap 1

A priority queue based on a binomial heap

apasel422/skew-heap 1

A priority queue based on a skew heap

apasel422/api-linter 0

A linter for APIs defined in protocol buffers.

apasel422/google.aip.dev 0

API Improvement Proposals. https://aip.dev/

apasel422/googleapis 0

Public interface definitions of Google APIs.

create barnchapasel422/google.aip.dev

branch : required-links

created branch time in 5 minutes

issue openedaip-dev/google.aip.dev

Inconsistent use of URI vs. URL

#223 suggests that "URI" should be used everywhere, but a number of AIPs use "URL" or even both options, e.g. https://github.com/aip-dev/google.aip.dev/blob/b573d47e3eb6dee89e12f2d6d9ef6f8dd3dde656/aip/general/0133.md#L49-L53

created time in 3 hours

PR opened aip-dev/google.aip.dev

Fix example create URI in AIP-127

Fixes #649.

+1 -1

0 comment

1 changed file

pr created time in 3 hours

push eventapasel422/google.aip.dev

Andrew Paseltiner

commit sha 31af3777a9bf056182d1a8548263935db6227de7

Fix example create URI in AIP-127 Fixes #649.

view details

push time in 3 hours

issue commentaip-dev/google.aip.dev

AIP-127 possibly incorrect example

I think there's just a typo in the post URI, and it should instead be:

rpc CreateBook(CreateBookRequest) returns (Book) {
  option (google.api.http) = {
    post: "/v1/{parent=publishers/*/books/*}"
    body: "book"
  };
}

with the } after the *.

jskeet

comment created time in 3 hours

PR opened aip-dev/google.aip.dev

Expand on guidance for AIP-144 Add and Remove methods

Part of #646.

+61 -6

0 comment

1 changed file

pr created time in 2 days

push eventapasel422/google.aip.dev

Andrew Paseltiner

commit sha 205b79ca563c3b30e7ef27869e54109ae5897e9f

Expand on guidance for AIP-144 Add and Remove methods

view details

push time in 2 days

create barnchapasel422/google.aip.dev

branch : aip-144

created branch time in 2 days

PullRequestReviewEvent

Pull request review commentgoogleapis/api-linter

feat: Declarative-friendly resources should avoid custom methods.

+// Copyright 2020 Google LLC+//+// Licensed under the Apache License, Version 2.0 (the "License");+// you may not use this file except in compliance with the License.+// You may obtain a copy of the License at+//+//     https://www.apache.org/licenses/LICENSE-2.0+//+// Unless required by applicable law or agreed to in writing, software+// distributed under the License is distributed on an "AS IS" BASIS,+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+// See the License for the specific language governing permissions and+// limitations under the License.++package aip0136++import (+	"testing"++	"github.com/googleapis/api-linter/rules/internal/testutils"+)++func TestDeclarativeFriendly(t *testing.T) {+	for _, test := range []struct {+		name       string+		MethodName string+		ImpOnly    string+		problems   testutils.Problems+	}{+		{"ValidGet", "GetBook", "", nil},+		{"ValidList", "ListBooks", "", nil},+		{"ValidCreate", "CreateBook", "", nil},+		{"ValidUpdate", "UpdateBook", "", nil},+		{"ValidDelete", "DeleteBook", "", nil},+		{"ValidUndelete", "UndeleteBook", "", nil},
		{"ValidUndelete", "UndeleteBook", "", nil},
		{"ValidBatch", "BatchGetBooks", "", nil},
lukesneeringer

comment created time in 2 days

PullRequestReviewEvent

Pull request review commentgoogleapis/api-linter

feat: Declarative-friendly resources should avoid custom methods.

+// Copyright 2020 Google LLC+//+// Licensed under the Apache License, Version 2.0 (the "License");+// you may not use this file except in compliance with the License.+// You may obtain a copy of the License at+//+//     https://www.apache.org/licenses/LICENSE-2.0+//+// Unless required by applicable law or agreed to in writing, software+// distributed under the License is distributed on an "AS IS" BASIS,+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+// See the License for the specific language governing permissions and+// limitations under the License.++package aip0136++import (+	"strings"++	"bitbucket.org/creachadair/stringset"+	"github.com/googleapis/api-linter/lint"+	"github.com/googleapis/api-linter/rules/internal/utils"+	"github.com/jhump/protoreflect/desc"+)++var standardMethodsOnly = &lint.MethodRule{+	Name:   lint.NewRuleName(136, "declarative-standard-methods-only"),+	OnlyIf: utils.IsDeclarativeFriendlyMethod,+	LintMethod: func(m *desc.MethodDescriptor) []lint.Problem {+		// Standard methods are fine.+		standard := stringset.New("Get", "List", "Create", "Update", "Delete", "Undelete")

Should the batch methods be included here?

lukesneeringer

comment created time in 3 days

PullRequestReviewEvent
PullRequestReviewEvent

Pull request review commentaip-dev/google.aip.dev

AIP-144: Declarative-friendly resources should avoid Add/Remove.

 fine for many situations, particularly when the repeated field is expected to have a small size (fewer than 10 or so) and race conditions are not an issue, or can be guarded against with [ETags][aip-154]. +**Note:** Declarative-friendly resources **must** use the standard `Update`+method, and not introduce `Add` and `Remove` method.
method, and not introduce `Add` and `Remove` methods.
lukesneeringer

comment created time in 3 days

PullRequestReviewEvent

delete branch apasel422/google.aip.dev

delete branch : undelete-typos

delete time in 3 days

delete branch apasel422/google.aip.dev

delete branch : patch-1

delete time in 3 days

issue openedgoogleapis/api-linter

Missing rules for AIP-144

https://google.aip.dev/144#update-strategies

But see also https://github.com/aip-dev/google.aip.dev/issues/646.

created time in 3 days

issue openedaip-dev/google.aip.dev

AIP-144 section on add/remove methods is vague

https://google.aip.dev/144#update-strategies

  1. It doesn't demonstrate the request and response messages.
  2. There should be a requirement that the book field in the request is a string with the appropriate google.api.resource_reference and (google.api.field_behavior) = REQUIRED annotations.
  3. Should there be guidance on a (google.api.method_signature) annotation on the two methods?
  4. Should there even be an AddBookResponse or RemoveBookResponse, as opposed to returning Book itself?

created time in 3 days

delete branch apasel422/api-linter

delete branch : revert-631

delete time in 3 days

delete branch apasel422/api-linter

delete branch : parent-presence-and-type

delete time in 3 days

push eventapasel422/api-linter

Andrew Paseltiner

commit sha 1083c2a1b08c682fb4e3bacc63ee6bd47187b640

Use utils.FindMessage in request-parent checks to account for fully-qualified message names

view details

push time in 3 days

push eventapasel422/api-linter

Andrew Paseltiner

commit sha dd15441fb8c37be237ad41667b925c9b888ce51c

Use utils.FindMessage in request-parent checks to account for fully-qualified message names

view details

push time in 3 days

issue commentgoogleapis/api-linter

AIP-132. False detection

I've confirmed that this is an issue. Looking into a fix now.

valery-barysok

comment created time in 3 days

fork apasel422/googleapis

Public interface definitions of Google APIs.

fork in 3 days

PR opened googleapis/api-linter

fix: Revert "Fix erroneous logic for batch request-parent-field rules"

This reverts commit 04d68971f51c68363ce75c5bf441a5c3d72b59dc.

In #631 I mistakenly thought this was looking at the HTTP pattern, not the resource pattern.

+23 -23

0 comment

6 changed files

pr created time in 3 days

create barnchapasel422/api-linter

branch : revert-631

created branch time in 3 days

create barnchapasel422/api-linter

branch : parent-presence-and-type

created branch time in 4 days

delete branch apasel422/api-linter

delete branch : aip-128-reconciling

delete time in 4 days

push eventapasel422/api-linter

Benjamin E. Coe

commit sha bb3d9bfd7acfedb5c918a06ee767337b68501574

chore: Add config to turn off label-sync (#635)

view details

Andrew Paseltiner

commit sha fb0d87743ccc8bb45c63edb49e0522a3424f79bd

fix: Fix typos in batch AIPs (#632) Co-authored-by: Luke Sneeringer <lukesneeringer@google.com>

view details

Andrew Paseltiner

commit sha 2cf091260c715413d3fe7b2651016d009b68aae7

fix: Fix erroneous logic for batch request-parent-field rules (#631) Batch URIs reference a collection, not an individual resource, so a parent field should be required when there is at least one resource in the URI. The parent field should be absent when there are no resources in the URI, but these rules don't yet enforce that. Co-authored-by: Luke Sneeringer <lukesneeringer@google.com>

view details

Andrew Paseltiner

commit sha 882a6f9bed8c6a5a13340fbdbb9986f99310cce3

feat: Add request-parent-field rule for AIP-235 (#636) Co-authored-by: Luke Sneeringer <lukesneeringer@google.com>

view details

Andrew Paseltiner

commit sha ca8bb903e5abbb5ec4849f4283a0293bff617ac4

feat: Add rules for batch-request names-field annotations (#637) These annotations were added in https://github.com/aip-dev/google.aip.dev/pull/612. Co-authored-by: Luke Sneeringer <lukesneeringer@google.com>

view details

Andrew Paseltiner

commit sha e1fe734f0fdf63d8d7ed1a1ebe10104a104b7e85

feat: Add rule for AIP-235 request-names-field (#638) Co-authored-by: Luke Sneeringer <lukesneeringer@google.com>

view details

Andrew Paseltiner

commit sha c50d6c1318e14b0a27ef8cb77137e0d9ad680272

feat: Add rules for batch-method requests field behavior (#644)

view details

Luke Sneeringer

commit sha b9364d857b13f5029a09681a3c06130bae1b2676

fix: Permit two-word top-level collections in the URI suffix. (#642) Another tweak to the perpetually-difficult `http-uri-suffix` rule from AIP-136. Fixes #622.

view details

Andrew Paseltiner

commit sha d7f33f46c611275f9a857e7686698ac7a05901bd

Add rules for batch-method parent resource reference (#643) Co-authored-by: Luke Sneeringer <lukesneeringer@google.com>

view details

Xiao Chen

commit sha d243c9dce10e226d6e19ca0ecadc5e07c4806f76

docs: fix AIP-158 disablement example (#645)

view details

Andrew Paseltiner

commit sha 12e500e4455accae6bc899dd3a692cd61f1d6e61

feat: Add rules for unknown fields in batch requests (#646)

view details

Luke Sneeringer

commit sha a869e76ee0ccbae9ce786be36e5fd184c07346e9

feat: Add IsDeclarativeFriendly utility method. (#647)

view details

Andrew Paseltiner

commit sha ea04da6f31978006a6fec6b9279c4ee9a07fde2e

feat: Add rule for AIP-235 soft-delete response resource field (#649) Co-authored-by: Luke Sneeringer <lukesneeringer@google.com>

view details

Andrew Paseltiner

commit sha c7abce41f7242e15b2942b92b2f4716f4b9fb21c

feat: Add rule for AIP-235 response message name (#648) Co-authored-by: Luke Sneeringer <lukesneeringer@google.com>

view details

Luke Sneeringer

commit sha ddc47f24a019b71ed731bf21ff1198eef665a329

refactor: Make separate IsDeclarativeFriendly methods for message and method. (#650) * refactor: Make separate IsDeclarativeFriendly methods for message and method. Otherwise they can not be sent to OnlyIf. Additionally, support request messages. * Incorporate golint feedback.

view details

Luke Sneeringer

commit sha c644cf4f3b8de619caa7c32eea27d92dc97a824e

fix: Loosen warnings around REQUIRED and OPTIONAL. (#652) This removes some false positive warnings.

view details

Luke Sneeringer

commit sha ffa93dfb98c1a6ce7eaf50a5b7852823e8e36248

fix: Permit ListRevisions methods to include their resource field. (#653)

view details

Luke Sneeringer

commit sha d598c1b90dbc6b0892c6d37e05e6ab9ff2cb0653

feat: Add `allow_missing` rule to AIP-134. (#651)

view details

Luke Sneeringer

commit sha 2530b952abbbdb35435af06530dbe769f1cb8ef4

feat: Add rule to prevent optional and required together. (#654) Fixes #641.

view details

Luke Sneeringer

commit sha 98aa656253b011c55a2720b0516656fa386b4081

feat: Add three rules for AIP-154. (#655)

view details

push time in 4 days

delete branch apasel422/api-linter

delete branch : missing-tests

delete time in 4 days

delete branch apasel422/api-linter

delete branch : aip-164-undelete

delete time in 4 days

delete branch apasel422/api-linter

delete branch : common

delete time in 4 days

issue commentgoogleapis/api-linter

AIP-144: Declarative-friendly resources should not have Add/Remove methods for repeated fields.

Where is this guidance documented? I don't see any mention of it in AIP-144.

lukesneeringer

comment created time in 4 days

push eventapasel422/api-linter

Andrew Paseltiner

commit sha 4ba3b8c0c0336c773868ef0a1b52370e62b5c112

Add rule to require Undelete methods for declarative-friendly resources

view details

push time in 4 days

create barnchapasel422/api-linter

branch : aip-164-undelete

created branch time in 4 days

create barnchapasel422/api-linter

branch : missing-tests

created branch time in 4 days

push eventapasel422/api-linter

Andrew Paseltiner

commit sha 07446fa7706bb9ebe90d57e6d214d7f472da7048

Add tests for common lints

view details

push time in 5 days

Pull request review commentgoogleapis/api-linter

refactor: Extract common lints into the util package to eliminate redundancy

+// Copyright 2020 Google LLC+//+// Licensed under the Apache License, Version 2.0 (the "License");+// you may not use this file except in compliance with the License.+// You may obtain a copy of the License at+//+//     https://www.apache.org/licenses/LICENSE-2.0+//+// Unless required by applicable law or agreed to in writing, software+// distributed under the License is distributed on an "AS IS" BASIS,+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+// See the License for the specific language governing permissions and+// limitations under the License.++package utils++import (+	"fmt"++	"github.com/googleapis/api-linter/lint"+	"github.com/googleapis/api-linter/locations"+	"github.com/jhump/protoreflect/desc"+	"github.com/jhump/protoreflect/desc/builder"+)++// LintStringField returns a problem if the field is not a string.+func LintStringField(f *desc.FieldDescriptor) []lint.Problem {+	if f.GetType() != builder.FieldTypeString().GetType() {+		return []lint.Problem{{+			Message:    fmt.Sprintf("The `%s` field must be a string.", f.GetType()),+			Suggestion: "string",+			Descriptor: f,+			Location:   locations.FieldType(f),+		}}+	}+	return nil+}++// LintRequiredField returns a problem if the field's behavior is not REQUIRED.+func LintRequiredField(f *desc.FieldDescriptor) []lint.Problem {+	if !GetFieldBehavior(f).Contains("REQUIRED") {+		return []lint.Problem{{+			Message:    fmt.Sprintf("The `%s` field should include `(google.api.field_behavior) = REQUIRED`.", f.GetName()),+			Descriptor: f,+		}}+	}+	return nil+}++// LintFieldResourceReference returns a problem if the field does not have a resource reference annotation.+func LintFieldResourceReference(f *desc.FieldDescriptor) []lint.Problem {+	if ref := GetResourceReference(f); ref == nil {+		return []lint.Problem{{+			Message:    fmt.Sprintf("The `%s` field should include a `google.api.resource_reference` annotation.", f.GetName()),+			Descriptor: f,+		}}+	}+	return nil+}++func lintHTTPBody(m *desc.MethodDescriptor, want, msg string) []lint.Problem {

I like the explicitness of the separate functions, which also helps with message-generation simplicity, but I defer to you.

apasel422

comment created time in 5 days

PullRequestReviewEvent

Pull request review commentgoogleapis/api-linter

refactor: Extract common lints into the util package to eliminate redundancy

+// Copyright 2020 Google LLC+//+// Licensed under the Apache License, Version 2.0 (the "License");+// you may not use this file except in compliance with the License.+// You may obtain a copy of the License at+//+//     https://www.apache.org/licenses/LICENSE-2.0+//+// Unless required by applicable law or agreed to in writing, software+// distributed under the License is distributed on an "AS IS" BASIS,+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+// See the License for the specific language governing permissions and+// limitations under the License.++package utils++import (+	"fmt"++	"github.com/googleapis/api-linter/lint"+	"github.com/googleapis/api-linter/locations"+	"github.com/jhump/protoreflect/desc"+	"github.com/jhump/protoreflect/desc/builder"+)++// LintStringField returns a problem if the field is not a string.+func LintStringField(f *desc.FieldDescriptor) []lint.Problem {

I'd rather wait until it's needed, as it will make the message-generation more complicated.

apasel422

comment created time in 5 days

PullRequestReviewEvent

push eventapasel422/api-linter

Andrew Paseltiner

commit sha 9849b65eb0546d2e1bf06840745bbbec8c6a861a

Extract common lints into the util package to eliminate redundancy

view details

push time in 5 days

push eventapasel422/api-linter

Andrew Paseltiner

commit sha 3e5401ed4cb6f97152c6ddecbd1396d6858d8e5c

Extract common lints into the util package to eliminate redundancy

view details

push time in 5 days

push eventapasel422/api-linter

Andrew Paseltiner

commit sha 5efa62f0fd5dd3ab86a892d5b090bb5768cf9c3d

Extract common lints into the util package to eliminate redundancy

view details

push time in 5 days

create barnchapasel422/api-linter

branch : common

created branch time in 5 days

delete branch apasel422/api-linter

delete branch : test-setup

delete time in 5 days

create barnchapasel422/api-linter

branch : test-setup

created branch time in 5 days

PR opened googleapis/api-linter

feat: Add rule for AIP-128 reconciling field

Fixes #660.

+212 -0

0 comment

4 changed files

pr created time in 5 days

push eventapasel422/api-linter

Andrew Paseltiner

commit sha 7a721f656d6af6859f9dc53ec2a3b624f3541e5e

Add rule for AIP-128 reconciling field

view details

push time in 5 days

create barnchapasel422/api-linter

branch : aip-128-reconciling

created branch time in 5 days

delete branch apasel422/api-linter

delete branch : aip-128-annotations

delete time in 5 days

delete branch apasel422/api-linter

delete branch : undelete

delete time in 5 days

PullRequestReviewEvent

Pull request review commentgoogleapis/api-linter

feat: Add rules for AIP-164 Undelete

+// Copyright 2020 Google LLC+//+// Licensed under the Apache License, Version 2.0 (the "License");+// you may not use this file except in compliance with the License.+// You may obtain a copy of the License at+//+//     https://www.apache.org/licenses/LICENSE-2.0+//+// Unless required by applicable law or agreed to in writing, software+// distributed under the License is distributed on an "AS IS" BASIS,+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+// See the License for the specific language governing permissions and+// limitations under the License.++package aip0164++import (+	"strings"+	"testing"++	dpb "github.com/golang/protobuf/protoc-gen-go/descriptor"+	"github.com/jhump/protoreflect/desc/builder"+	"google.golang.org/genproto/googleapis/api/annotations"+	"google.golang.org/protobuf/proto"+)++func TestHttpBody(t *testing.T) {+	tests := []struct {+		testName   string+		body       string+		methodName string+		msg        string+	}{+		{"Valid", "*", "UndeleteBook", ""},+		{"Invalid", "", "UndeleteBook", "HTTP body"},+		{"Irrelevant", "", "AcquireBook", ""},+	}++	for _, test := range tests {+		t.Run(test.testName, func(t *testing.T) {+			// Create a MethodOptions with the annotation set.+			opts := &dpb.MethodOptions{}

I really miss g4 cp in GitHub's PR UI, to make these changes more obvious.

apasel422

comment created time in 5 days

Pull request review commentgoogleapis/api-linter

feat: Add rules for AIP-164 Undelete

+// Copyright 2020 Google LLC+//+// Licensed under the Apache License, Version 2.0 (the "License");+// you may not use this file except in compliance with the License.+// You may obtain a copy of the License at+//+//     https://www.apache.org/licenses/LICENSE-2.0+//+// Unless required by applicable law or agreed to in writing, software+// distributed under the License is distributed on an "AS IS" BASIS,+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+// See the License for the specific language governing permissions and+// limitations under the License.++package aip0164++import (+	"strings"+	"testing"++	dpb "github.com/golang/protobuf/protoc-gen-go/descriptor"+	"github.com/jhump/protoreflect/desc/builder"+	"google.golang.org/genproto/googleapis/api/annotations"+	"google.golang.org/protobuf/proto"+)++func TestHttpBody(t *testing.T) {+	tests := []struct {+		testName   string+		body       string+		methodName string+		msg        string+	}{+		{"Valid", "*", "UndeleteBook", ""},+		{"Invalid", "", "UndeleteBook", "HTTP body"},+		{"Irrelevant", "", "AcquireBook", ""},+	}++	for _, test := range tests {+		t.Run(test.testName, func(t *testing.T) {+			// Create a MethodOptions with the annotation set.+			opts := &dpb.MethodOptions{}

I just copied it from one of the other tests that was similar. It'd be good at some point to upgrade all the tests to use ParseProto3Tmpl.

apasel422

comment created time in 5 days

PullRequestReviewEvent

PR opened googleapis/api-linter

Add rule for AIP-128 annotations field

Fixes #670.

+255 -2

0 comment

7 changed files

pr created time in 5 days

push eventapasel422/api-linter

Andrew Paseltiner

commit sha 0179fe6b4fc062125d73d2d8172113b5486d7deb

Add rule for AIP-128 annotations field

view details

push time in 5 days

create barnchapasel422/api-linter

branch : aip-128-annotations

created branch time in 5 days

issue commentgoogleapis/api-linter

AIP-164: Declarative-friendly resources should include an Undelete method.

What's the canonical way to ensure that a resource has an associated method?

lukesneeringer

comment created time in 5 days

push eventapasel422/api-linter

Andrew Paseltiner

commit sha 66dcf5d1af0e901bfc943c6023ece8d8ed6285e4

Add lint for long-running AIP-164 Undelete

view details

push time in 5 days

Pull request review commentgoogleapis/api-linter

feat: Add LRO rule for Delete methods (declarative-friendly).

+---+rule:+  aip: 135+  name: [core, '0135', response-lro]+  summary: |+    Declarative-friendly delete methods should use long-running operations.+permalink: /135/response-lro+redirect_from:+  - /0135/response-lro+---++# Long-running Delete++This rule enforces that declarative-friendly delete methods use long-running+operations, as mandated in [AIP-135][].++## Details++This rule looks at any `Delete` method connected to a resource with a+`google.api.resource` annotation that includes `style: DECLARATIVE_FRIENDLY`,+and complains if it does not use long-running operations.++## Examples++**Incorrect** code for this rule:++```proto+// Incorrect.+// Assuming that Book is styled declarative-friendly, DeleteBook should+// return a long-running operation.+rpc DeleteBook(DeleteBookRequest) returns (Book) {+  option (google.api.http) = {+    delete: "/v1/{name=publishers/*/books/*}"+  };+}+```++**Correct** code for this rule:++```proto+// Correct.+// Assuming that Book is styled declarative-friendly...+rpc DeleteBook(DeleteBookRequest) returns (google.longrunning.Operation) {+  option (google.api.http) = {+    delete: "/v1/{name=publishers/*/books/*}"+  };+  option (google.longrunning.operation_info) = {+    response_type: "Book"+    metadata_type: "OperationMetadata"+  }+}+```++## Disabling++If you need to violate this rule, use a leading comment above the message.+Remember to also include an [aip.dev/not-precedent][] comment explaining why.++```proto+// (-- api-linter: core::0135::response-lro=disabled+//     aip.dev/not-precedent: We need to do this because reasons. --)+rpc DeleteBook(DeleteBookRequest) returns (Book) {+  option (google.api.http) = {+    delete: "/v1/{name=publishers/*/books/*}"+    body: "book"
lukesneeringer

comment created time in 5 days

PullRequestReviewEvent

Pull request review commentgoogleapis/api-linter

feat: Add declarative-friendly logic to the Delete response check.

 var responseMessageName = &lint.MethodRule{ 		// The AIP-151 rule will whine about that, and this rule should not as it 		// would be confusing. 		if !want.Contains(got) && got != "" {-			return []lint.Problem{{-				Message: fmt.Sprintf(-					"Delete RPCs should have response message type of Empty or the resource, not %q.",-					got,-				),-				Suggestion: "google.protobuf.Empty",+			// Customize the error message (by including Empty iff the resource is+			// not marked declarative-friendly).)
			// not marked declarative-friendly)
lukesneeringer

comment created time in 5 days

PullRequestReviewEvent
PullRequestReviewEvent

Pull request review commentgoogleapis/api-linter

feat: Add LRO rule for Update methods (declarative-friendly).

+---+rule:+  aip: 134+  name: [core, '0134', response-lro]+  summary: |+    Declarative-friendly Update methods should use long-running operations.+permalink: /134/response-lro+redirect_from:+  - /0134/response-lro+---++# Long-running Update++This rule enforces that declarative-friendly update methods use long-running+operations, as mandated in [AIP-134][].++## Details++This rule looks at any `Update` method connected to a resource with a+`google.api.resource` annotation that includes `style: DECLARATIVE_FRIENDLY`,+and complains if it does not use long-running operations.++## Examples++**Incorrect** code for this rule:++```proto+// Incorrect.+// Assuming that Book is styled declarative-friendly, UpdateBook should+// return a long-running operation.+rpc UpdateBook(UpdateBookRequest) returns (Book) {+  option (google.api.http) = {+    patch: "/v1/{book.name=publishers/*/books/*}"+    body: "book"+  };+}+```++**Correct** code for this rule:++```proto+// Correct.+// Assuming that Book is styled declarative-friendly...+rpc UpdateBook(UpdateBookRequest) returns (google.longrunning.Operation) {+  option (google.api.http) = {+    patch: "/v1/{book.name=publishers/*/books/*}"+    body: "book"+  };+  option (google.longrunning.operation_info) = {+    response_type: "Book"+    metadata_type: "OperationMetadata"+  }
  };
lukesneeringer

comment created time in 5 days

PullRequestReviewEvent
PullRequestReviewEvent

Pull request review commentgoogleapis/api-linter

feat: Add LRO rule for Delete methods (declarative-friendly).

+---+rule:+  aip: 135+  name: [core, '0135', response-lro]+  summary: |+    Declarative-friendly delete methods should use long-running operations.+permalink: /135/response-lro+redirect_from:+  - /0135/response-lro+---++# Long-running Delete++This rule enforces that declarative-friendly delete methods use long-running+operations, as mandated in [AIP-135][].++## Details++This rule looks at any `Delete` method connected to a resource with a+`google.api.resource` annotation that includes `style: DECLARATIVE_FRIENDLY`,+and complains if it does not use long-running operations.++## Examples++**Incorrect** code for this rule:++```proto+// Incorrect.+// Assuming that Book is styled declarative-friendly, DeleteBook should+// return a long-running operation.+rpc DeleteBook(DeleteBookRequest) returns (Book) {+  option (google.api.http) = {+    delete: "/v1/{name=publishers/*/books/*}"+  };+}+```++**Correct** code for this rule:++```proto+// Correct.+// Assuming that Book is styled declarative-friendly...+rpc DeleteBook(DeleteBookRequest) returns (google.longrunning.Operation) {+  option (google.api.http) = {+    delete: "/v1/{name=publishers/*/books/*}"+  };+  option (google.longrunning.operation_info) = {+    response_type: "Book"+    metadata_type: "OperationMetadata"+  }
  };
lukesneeringer

comment created time in 5 days

PullRequestReviewEvent
PullRequestReviewEvent

issue openedaip-dev/google.aip.dev

AIP-164: Should Undelete method have a method-signature annotation?

To mirror that of https://google.aip.dev/135.

created time in 6 days

delete branch apasel422/api-linter

delete branch : delete-unknown-fields

delete time in 6 days

PR opened aip-dev/google.aip.dev

Fix typos in AIP-164
+5 -3

0 comment

1 changed file

pr created time in 6 days

create barnchapasel422/google.aip.dev

branch : undelete-typos

created branch time in 6 days

PR opened googleapis/api-linter

Add validate_only field to AIP-163 request-unknown-fields doc

It's permitted at https://github.com/googleapis/api-linter/blob/005f6feace6f363c94bf559fe9845bbba964688e/rules/aip0135/request_unknown_fields.go#L35.

+2 -0

0 comment

1 changed file

pr created time in 6 days

create barnchapasel422/api-linter

branch : delete-unknown-fields

created branch time in 6 days

PR opened googleapis/api-linter

Add rules for AIP-164 Undelete

Fixes #666, #667, #668.

+1700 -0

0 comment

30 changed files

pr created time in 6 days

push eventapasel422/api-linter

Andrew Paseltiner

commit sha 4a6e7152b26899ec54478b2f46b1f6f4a84933b0

Add rules for AIP-164 Undelete

view details

push time in 6 days

push eventapasel422/api-linter

Andrew Paseltiner

commit sha f8448f5907dc325077d65c43f33d0b8eeb904c9d

Add rules for AIP-164 Undelete

view details

push time in 6 days

push eventapasel422/api-linter

Andrew Paseltiner

commit sha 7237807164edf6bb12185d4bcff5b1a54bd500eb

Add rules for AIP-164 Undelete

view details

push time in 6 days

push eventapasel422/api-linter

Andrew Paseltiner

commit sha 2a3c7bbf36d9181c059d73e00f77bb5cd1ef4952

Add rules for AIP-164 Undelete

view details

push time in 6 days

create barnchapasel422/api-linter

branch : undelete

created branch time in 6 days

PR opened aip-dev/google.aip.dev

Fix broken links in AIP-146
+4 -4

0 comment

1 changed file

pr created time in 6 days

push eventapasel422/google.aip.dev

Andrew Paseltiner

commit sha 0adcac51ae6be79614156da781c155baaa83ac24

Fix broken links in AIP-146

view details

push time in 6 days

Pull request review commentgoogleapis/api-linter

feat: Add three rules for AIP-154.

+---+rule:+  aip: 154+  name: [core, '0154', no-duplicate-etag]+  summary: |+    Etag fields should not be set on request messages that include+    the resource.+permalink: /154/no-duplicate-etag+redirect_from:+  - /0154/no-duplicate-etag+---++# Required etags++This rule enforces that `etag` fields are set on resources and requests that+reference those resources by name, but not on requests that include the+resource directly, as mandated in [AIP-154][].++## Details++This rule looks at any field named `etag` and complains if it is part of a+request message including a resource that itself includes an etag.++## Examples++**Incorrect** code for this rule:++```proto+// Incorrect.+message UpdateBookRequest {+  Book book = 1;+  google.protobuf.FieldMask = 2;
google.protobuf.FieldMask update_mask = 2;
lukesneeringer

comment created time in 7 days

Pull request review commentgoogleapis/api-linter

feat: Add three rules for AIP-154.

+---+rule:+  aip: 154+  name: [core, '0154', no-duplicate-etag]+  summary: |+    Etag fields should not be set on request messages that include+    the resource.+permalink: /154/no-duplicate-etag+redirect_from:+  - /0154/no-duplicate-etag+---++# Required etags++This rule enforces that `etag` fields are set on resources and requests that+reference those resources by name, but not on requests that include the+resource directly, as mandated in [AIP-154][].++## Details++This rule looks at any field named `etag` and complains if it is part of a+request message including a resource that itself includes an etag.++## Examples++**Incorrect** code for this rule:++```proto+// Incorrect.+message UpdateBookRequest {+  Book book = 1;+  google.protobuf.FieldMask = 2;+  string etag = 3;  // The Book message already includes etag.+}+```++**Correct** code for this rule:++```proto+// Correct.+message UpdateBookRequest {+  Book book = 1;+  google.protobuf.FieldMask = 2;
google.protobuf.FieldMask update_mask = 2;
lukesneeringer

comment created time in 7 days

Pull request review commentgoogleapis/api-linter

feat: Add three rules for AIP-154.

+---+rule:+  aip: 154+  name: [core, '0154', declarative-friendly-required]+  summary: Declarative-friendly resources must have an etag field.+permalink: /154/declarative-friendly-required+redirect_from:+  - /0154/declarative-friendly-required+---++# Required etags++This rule enforces that declarative-friendly resources have etags, as mandated+in [AIP-154][].++## Details++This rule looks at any resource with a `google.api.resource` annotation that+includes `style: DECLARATIVE_FRIENDLY`, and complains if it lacks a+`string etag` field.++Additionally, it looks at certain corresponding request messages (e.g.+`DeleteBookRequest`) that _do not_ include the resource, and make the same+check.++## Examples++**Incorrect** code for this rule:++```proto+// Incorrect.+message Book {+  option (google.api.resource) = {+    type: "library.googleapis.com/Book"+    pattern: "publishers/{publisher}/books/{book}"+    style: DECLARATIVE_FRIENDLY+  }++  string name = 1;+  // A string etag field should exist.+}+```++```proto+// Incorrect.+message DeleteBookRequest {+  string name = 1 [(google.api.resource_reference) = {+    type: "library.googleapis.com/Book"+  }];+  // A string etag field should exist.+}+```++**Correct** code for this rule:++```proto+// Correct.+message Book {+  option (google.api.resource) = {+    type: "library.googleapis.com/Book"+    pattern: "publishers/{publisher}/books/{book}"+    style: DECLARATIVE_FRIENDLY+  }++  string name = 1;+  string etag = 2;+}+```++```proto+// Correct.+message DeleteBookRequest {+  string name = 1 [(google.api.resource_reference) = {+    type: "library.googleapis.com/Book"+  }];+  string etag = 2;+}+```++## Disabling++If you need to violate this rule, use a leading comment above the message.+Remember to also include an [aip.dev/not-precedent][] comment explaining why.++```proto+// (-- api-linter: core::0154::declarative-friendly-required=disabled+//     aip.dev/not-precedent: We need to do this because reasons. --)+message Book {+  option (google.api.resource) = {+    type: "library.googleapis.com/Book"+    pattern: "publishers/{publisher}/books/{book}"+    style: DECLARATIVE_FRIENDLY+  }

Missing ; after the }.

lukesneeringer

comment created time in 7 days

Pull request review commentgoogleapis/api-linter

feat: Add three rules for AIP-154.

+---+rule:+  aip: 154+  name: [core, '0154', no-duplicate-etag]+  summary: |+    Etag fields should not be set on request messages that include+    the resource.+permalink: /154/no-duplicate-etag+redirect_from:+  - /0154/no-duplicate-etag+---++# Required etags++This rule enforces that `etag` fields are set on resources and requests that+reference those resources by name, but not on requests that include the+resource directly, as mandated in [AIP-154][].++## Details++This rule looks at any field named `etag` and complains if it is part of a+request message including a resource that itself includes an etag.++## Examples++**Incorrect** code for this rule:++```proto+// Incorrect.+message UpdateBookRequest {+  Book book = 1;+  google.protobuf.FieldMask = 2;+  string etag = 3;  // The Book message already includes etag.+}+```++**Correct** code for this rule:++```proto+// Correct.+message UpdateBookRequest {+  Book book = 1;+  google.protobuf.FieldMask = 2;+}+```++## Disabling++If you need to violate this rule, use a leading comment above the field.+Remember to also include an [aip.dev/not-precedent][] comment explaining why.++```proto+message UpdateBookRequest {+  Book book = 1;+  google.protobuf.FieldMask = 2;
google.protobuf.FieldMask update_mask = 2;
lukesneeringer

comment created time in 7 days

Pull request review commentgoogleapis/api-linter

feat: Add three rules for AIP-154.

+---+rule:+  aip: 154+  name: [core, '0154', declarative-friendly-required]+  summary: Declarative-friendly resources must have an etag field.+permalink: /154/declarative-friendly-required+redirect_from:+  - /0154/declarative-friendly-required+---++# Required etags++This rule enforces that declarative-friendly resources have etags, as mandated+in [AIP-154][].++## Details++This rule looks at any resource with a `google.api.resource` annotation that+includes `style: DECLARATIVE_FRIENDLY`, and complains if it lacks a+`string etag` field.++Additionally, it looks at certain corresponding request messages (e.g.+`DeleteBookRequest`) that _do not_ include the resource, and make the same

s/make/makes/

lukesneeringer

comment created time in 7 days

more