From 7d66e0efbf9ff005e18bad4d0c501d2d40738ea7 Mon Sep 17 00:00:00 2001 From: Adriana Date: Fri, 10 Feb 2023 11:27:43 -0500 Subject: [PATCH 1/4] fix(internal/postprocessor): add scopes without OwlBot api-name feature --- .github/.OwlBot.yaml | 4 - internal/postprocessor/go.mod | 2 +- internal/postprocessor/go.sum | 4 +- internal/postprocessor/main.go | 114 ++++++++++++++++++---------- internal/postprocessor/main_test.go | 8 +- 5 files changed, 83 insertions(+), 49 deletions(-) diff --git a/.github/.OwlBot.yaml b/.github/.OwlBot.yaml index fa06bd3d299a..0018abeb9b19 100644 --- a/.github/.OwlBot.yaml +++ b/.github/.OwlBot.yaml @@ -519,7 +519,3 @@ deep-copy-regex: dest: /workflows/apiv1 - source: /google/cloud/workflows/v1beta/cloud.google.com/go/workflows/apiv1beta dest: /workflows/apiv1beta - -# api-name inserts a [REPLACEME] in OwlBot generated commit messages that is used by -# postprocessor to identify commit titles that need scope added -api-name: REPLACEME diff --git a/internal/postprocessor/go.mod b/internal/postprocessor/go.mod index d83e39b942af..869f0d7e85d8 100644 --- a/internal/postprocessor/go.mod +++ b/internal/postprocessor/go.mod @@ -33,7 +33,7 @@ require ( golang.org/x/sys v0.3.0 // indirect golang.org/x/tools v0.4.0 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20230112194545-e10362b5ecf9 // indirect + google.golang.org/genproto v0.0.0-20230202175211-008b39050e57 // indirect google.golang.org/protobuf v1.28.1 // indirect gopkg.in/src-d/go-billy.v4 v4.3.2 // indirect gopkg.in/src-d/go-git.v4 v4.13.1 // indirect diff --git a/internal/postprocessor/go.sum b/internal/postprocessor/go.sum index 5bb3d42052c4..f94fbeb21812 100644 --- a/internal/postprocessor/go.sum +++ b/internal/postprocessor/go.sum @@ -103,8 +103,8 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20230112194545-e10362b5ecf9 h1:ru6tJGasqJpgjM4q3Qq2fS3FKQ6CPPSRqgolUVBc994= -google.golang.org/genproto v0.0.0-20230112194545-e10362b5ecf9/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230202175211-008b39050e57 h1:vArvWooPH749rNHpBGgVl+U9B9dATjiEhJzcWGlovNs= +google.golang.org/genproto v0.0.0-20230202175211-008b39050e57/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= google.golang.org/grpc v1.51.0 h1:E1eGv1FTqoLIdnBCZufiSHgKjlqG6fKFf6pPWtMTh8U= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= diff --git a/internal/postprocessor/main.go b/internal/postprocessor/main.go index 4af3d23fc313..aa1d39c68fe4 100644 --- a/internal/postprocessor/main.go +++ b/internal/postprocessor/main.go @@ -38,17 +38,15 @@ import ( ) const ( - owlBotBranchPrefix = "owl-bot-copy" - apiNameOwlBotScope = "[REPLACEME]" + owlBotBranchPrefix = "owl-bot-copy" + beginNestedCommitDelimiter = "BEGIN_NESTED_COMMIT" + endNestedCommitDelimiter = "END_NESTED_COMMIT" + copyTagSubstring = "Copy-Tag:" ) var ( // hashFromLinePattern grabs the hash from the end of a github commit URL hashFromLinePattern = regexp.MustCompile(`.*/(?P[a-zA-Z0-9]*).*`) - // firstPartTitlePattern grabs the existing commit title before the ': [REPLACEME]' - firstPartTitlePattern = regexp.MustCompile(`(?P)(\: *\` + apiNameOwlBotScope + `)(.*)`) - // secondPartTitlePattern grabs the commit title after the ': [REPLACME]' - secondPartTitlePattern = regexp.MustCompile(`.*\: *\` + apiNameOwlBotScope + ` *(?P.*)`) ) func main() { @@ -357,45 +355,84 @@ func (c *config) SetScopesAndPRInfo(ctx context.Context) error { return nil } +func contains(s []string, str string) bool { + for _, elem := range s { + if elem == str { + return true + } + } + return false +} + func (c *config) processCommit(title, body string) (string, string, error) { var newPRTitle string - var commitTitle string - var commitTitleIndex int - var modules []string + var newPRBodySlice []string + var commitsSlice []string + startCommitIndex := 0 bodySlice := strings.Split(body, "\n") + + // Split body into separate commits, stripping nested commit delimiters for index, line := range bodySlice { - if strings.Contains(line, apiNameOwlBotScope) { - commitTitle = line - commitTitleIndex = index - continue - } - // When OwlBot generates the commit body, after commit titles it provides 'Source-Link's. - // The source-link pointing to the googleapis/googleapis repo commit allows us to extract - // hash and find files changed in order to identify the commit's scope. - if !strings.Contains(line, "googleapis/googleapis/") { - continue + if strings.Contains(line, beginNestedCommitDelimiter) || strings.Contains(line, endNestedCommitDelimiter) { + startCommitIndex = index + 1 } - hash := extractHashFromLine(line) - scopes, err := c.getScopesFromGoogleapisCommitHash(hash) - modules = append(modules, scopes...) - var scope string - if len(scopes) == 1 { - scope = scopes[0] + if strings.Contains(line, copyTagSubstring) { + thisCommit := strings.Join(bodySlice[startCommitIndex:index+1], "\n") + commitsSlice = append(commitsSlice, thisCommit) + startCommitIndex = index + 1 } - if err != nil { - return "", "", err + } + + // Add scope to each commit + for commitIndex, commit := range commitsSlice { + commitLines := strings.Split(commit, "\n") + var currTitle string + if commitIndex == 0 { + currTitle = title + } else { + currTitle = commitLines[0] + commitLines = commitLines[1:] + newPRBodySlice = append(newPRBodySlice, "") + newPRBodySlice = append(newPRBodySlice, beginNestedCommitDelimiter) } - if newPRTitle == "" { - newPRTitle = updateCommitTitle(title, scope) - continue + for _, line := range commitLines { + // When OwlBot generates the commit body, after commit titles it provides 'Source-Link's. + // The source-link pointing to the googleapis/googleapis repo commit allows us to extract + // hash and find files changed in order to identify the commit's scope. + if strings.Contains(line, "googleapis/googleapis/") { + hash := extractHashFromLine(line) + scopes, err := c.getScopesFromGoogleapisCommitHash(hash) + for _, scope := range scopes { + if !contains(c.modules, scope) { + c.modules = append(c.modules, scope) + } + } + var scope string + if len(scopes) == 1 { + scope = scopes[0] + } + if err != nil { + return "", "", err + } + + newCommitTitle := updateCommitTitle(currTitle, scope) + if newPRTitle == "" { + newPRTitle = newCommitTitle + } else { + newPRBodySlice = append(newPRBodySlice, newCommitTitle) + } + + newPRBodySlice = append(newPRBodySlice, commitLines...) + if commitIndex != 0 { + newPRBodySlice = append(newPRBodySlice, endNestedCommitDelimiter) + } + } } - newCommitTitle := updateCommitTitle(commitTitle, scope) - bodySlice[commitTitleIndex] = newCommitTitle } - body = strings.Join(bodySlice, "\n") - c.modules = append(c.modules, modules...) - return newPRTitle, body, nil + newPRBody := strings.Join(newPRBodySlice, "\n") + return newPRTitle, newPRBody, nil + } func (c *config) getPR(ctx context.Context) (*github.PullRequest, error) { @@ -470,11 +507,12 @@ func extractHashFromLine(line string) string { func updateCommitTitle(title, titlePkg string) string { var newTitle string + var breakChangeIndicator string - firstTitlePart := firstPartTitlePattern.ReplaceAllString(title, "$titleFirstPart") - secondTitlePart := secondPartTitlePattern.ReplaceAllString(title, "$titleSecondPart") + titleSlice := strings.Split(title, ":") + firstTitlePart := titleSlice[0] + secondTitlePart := strings.TrimSpace(titleSlice[1]) - var breakChangeIndicator string if strings.HasSuffix(firstTitlePart, "!") { breakChangeIndicator = "!" } diff --git a/internal/postprocessor/main_test.go b/internal/postprocessor/main_test.go index d52609dda51a..9edc13b2524a 100644 --- a/internal/postprocessor/main_test.go +++ b/internal/postprocessor/main_test.go @@ -60,7 +60,7 @@ func TestProcessCommit(t *testing.T) { }{ { name: "test nested commits", - title: "feat: [REPLACEME] Adds named reservation to InstancePolicy", + title: "feat: Adds named reservation to InstancePolicy", body: `- [ ] Regenerate this pull request now. --- @@ -77,7 +77,7 @@ Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/fcc564ef064c7 Copy-Tag: eyJwIjoiamF2YS1iYXRjaC8uT3dsQm90LnlhbWwiLCJoIjoiZmNjNTY0ZWYwNjRjN2RmZjMxZDc5NzBlMTIzMThhZDA4NDcwM2FjNiJ9 BEGIN_NESTED_COMMIT -feat: [REPLACEME] Adds named reservation to InstancePolicy +feat: Adds named reservation to InstancePolicy --- docs:Remove "not yet implemented" for Accelerator & Refine Volume API docs @@ -108,7 +108,7 @@ Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/fcc564ef064c7 Copy-Tag: eyJwIjoiamF2YS1iYXRjaC8uT3dsQm90LnlhbWwiLCJoIjoiZmNjNTY0ZWYwNjRjN2RmZjMxZDc5NzBlMTIzMThhZDA4NDcwM2FjNiJ9 BEGIN_NESTED_COMMIT -feat: Adds named reservation to InstancePolicy +feat(batch): Adds named reservation to InstancePolicy --- docs:Remove "not yet implemented" for Accelerator & Refine Volume API docs @@ -125,7 +125,7 @@ END_NESTED_COMMIT`, }, { name: "test nested client scope", - title: "feat: [REPLACEME] added JSON_PACKAGE field to ExportAgentRequest", + title: "feat: added JSON_PACKAGE field to ExportAgentRequest", body: `- [ ] Regenerate this pull request now. PiperOrigin-RevId: 504031208 From 1ac883bf2ddc1ff7af5e360d1953713a9f0e0544 Mon Sep 17 00:00:00 2001 From: Adriana Date: Fri, 10 Feb 2023 14:03:54 -0500 Subject: [PATCH 2/4] formatting --- internal/postprocessor/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/postprocessor/main.go b/internal/postprocessor/main.go index 44cd301f52de..6ac3112cf839 100644 --- a/internal/postprocessor/main.go +++ b/internal/postprocessor/main.go @@ -611,7 +611,7 @@ func (c *config) processCommit(title, body string) (string, string, error) { c.modules = []string{} c.modules = append(c.modules, moduleConfigs...) } - newPRBody := strings.Join(newPRBodySlice, "\n") + newPRBody := strings.Join(newPRBodySlice, "\n") return newPRTitle, newPRBody, nil } From b11821ad35074371da62d283a2f38adaf0c74306 Mon Sep 17 00:00:00 2001 From: Adriana Date: Fri, 10 Feb 2023 16:27:03 -0500 Subject: [PATCH 3/4] fix test --- internal/postprocessor/main_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/postprocessor/main_test.go b/internal/postprocessor/main_test.go index 9edc13b2524a..fec920ac2b2f 100644 --- a/internal/postprocessor/main_test.go +++ b/internal/postprocessor/main_test.go @@ -108,7 +108,7 @@ Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/fcc564ef064c7 Copy-Tag: eyJwIjoiamF2YS1iYXRjaC8uT3dsQm90LnlhbWwiLCJoIjoiZmNjNTY0ZWYwNjRjN2RmZjMxZDc5NzBlMTIzMThhZDA4NDcwM2FjNiJ9 BEGIN_NESTED_COMMIT -feat(batch): Adds named reservation to InstancePolicy +feat: Adds named reservation to InstancePolicy --- docs:Remove "not yet implemented" for Accelerator & Refine Volume API docs From 4943b2bdad34b927b132b00ebedc26b8e6a60219 Mon Sep 17 00:00:00 2001 From: Adriana Date: Fri, 10 Feb 2023 16:52:57 -0500 Subject: [PATCH 4/4] add tests --- internal/postprocessor/main.go | 2 +- internal/postprocessor/main_test.go | 184 +++++++++++++++++++++++++--- 2 files changed, 170 insertions(+), 16 deletions(-) diff --git a/internal/postprocessor/main.go b/internal/postprocessor/main.go index 6ac3112cf839..dbc39d991e20 100644 --- a/internal/postprocessor/main.go +++ b/internal/postprocessor/main.go @@ -563,7 +563,7 @@ func (c *config) processCommit(title, body string) (string, string, error) { // Add scope to each commit for commitIndex, commit := range commitsSlice { - commitLines := strings.Split(commit, "\n") + commitLines := strings.Split(strings.TrimSpace(commit), "\n") var currTitle string if commitIndex == 0 { currTitle = title diff --git a/internal/postprocessor/main_test.go b/internal/postprocessor/main_test.go index fec920ac2b2f..2727697e568c 100644 --- a/internal/postprocessor/main_test.go +++ b/internal/postprocessor/main_test.go @@ -128,21 +128,178 @@ END_NESTED_COMMIT`, title: "feat: added JSON_PACKAGE field to ExportAgentRequest", body: `- [ ] Regenerate this pull request now. - PiperOrigin-RevId: 504031208 + PiperOrigin-RevId: 504031208 - Source-Link: https://github.com/googleapis/googleapis/commit/c6af392b613b435757358fac555628d84e443abd - - Source-Link: googleapis/googleapis-gen@7849764 - Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNzg0OTc2NDc3NzYyZDk4YTljMzA4MzRkYzQ1ODVkODE1YWYyZmJmYiJ9`, + Source-Link: https://github.com/googleapis/googleapis/commit/c6af392b613b435757358fac555628d84e443abd + + Source-Link: googleapis/googleapis-gen@7849764 + Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNzg0OTc2NDc3NzYyZDk4YTljMzA4MzRkYzQ1ODVkODE1YWYyZmJmYiJ9`, want: "feat(dialogflow/cx): added JSON_PACKAGE field to ExportAgentRequest", want1: `- [ ] Regenerate this pull request now. - PiperOrigin-RevId: 504031208 + PiperOrigin-RevId: 504031208 + + Source-Link: https://github.com/googleapis/googleapis/commit/c6af392b613b435757358fac555628d84e443abd - Source-Link: https://github.com/googleapis/googleapis/commit/c6af392b613b435757358fac555628d84e443abd - - Source-Link: googleapis/googleapis-gen@7849764 - Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNzg0OTc2NDc3NzYyZDk4YTljMzA4MzRkYzQ1ODVkODE1YWYyZmJmYiJ9`, + Source-Link: googleapis/googleapis-gen@7849764 + Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNzg0OTc2NDc3NzYyZDk4YTljMzA4MzRkYzQ1ODVkODE1YWYyZmJmYiJ9`, + }, + { + name: "test add commit delimiters", + title: "feat: Adds named reservation to InstancePolicy", + body: `- [ ] Regenerate this pull request now. + +--- +docs:Remove "not yet implemented" for Accelerator & Refine Volume API docs + +--- +docs: update the job id format requirement + +PiperOrigin-RevId: 489502315 + +Source-Link: https://togithub.com/googleapis/googleapis/commit/db1cc1139fe0def1e87ead1fffbc5bedbeccb887 + +Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/fcc564ef064c7dff31d7970e12318ad084703ac6 +Copy-Tag: eyJwIjoiamF2YS1iYXRjaC8uT3dsQm90LnlhbWwiLCJoIjoiZmNjNTY0ZWYwNjRjN2RmZjMxZDc5NzBlMTIzMThhZDA4NDcwM2FjNiJ9 +feat: Adds named reservation to InstancePolicy +--- +docs:Remove "not yet implemented" for Accelerator & Refine Volume API docs + +--- +docs: update the job id format requirement + +PiperOrigin-RevId: 489501779 + +Source-Link: https://togithub.com/googleapis/googleapis/commit/488a4bdeebf9c7f505f48bed23f0b95fcbbec0bb + +Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/5b3d3a550015e9367ad13ee5f9febe0c3f84cf33 +Copy-Tag: eyJwIjoiamF2YS1iYXRjaC8uT3dsQm90LnlhbWwiLCJoIjoiNWIzZDNhNTUwMDE1ZTkzNjdhZDEzZWU1ZjlmZWJlMGMzZjg0Y2YzMyJ9`, + want: "feat(batch): Adds named reservation to InstancePolicy", + want1: `- [ ] Regenerate this pull request now. + +--- +docs:Remove "not yet implemented" for Accelerator & Refine Volume API docs + +--- +docs: update the job id format requirement + +PiperOrigin-RevId: 489502315 + +Source-Link: https://togithub.com/googleapis/googleapis/commit/db1cc1139fe0def1e87ead1fffbc5bedbeccb887 + +Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/fcc564ef064c7dff31d7970e12318ad084703ac6 +Copy-Tag: eyJwIjoiamF2YS1iYXRjaC8uT3dsQm90LnlhbWwiLCJoIjoiZmNjNTY0ZWYwNjRjN2RmZjMxZDc5NzBlMTIzMThhZDA4NDcwM2FjNiJ9 + +BEGIN_NESTED_COMMIT +feat: Adds named reservation to InstancePolicy +--- +docs:Remove "not yet implemented" for Accelerator & Refine Volume API docs + +--- +docs: update the job id format requirement + +PiperOrigin-RevId: 489501779 + +Source-Link: https://togithub.com/googleapis/googleapis/commit/488a4bdeebf9c7f505f48bed23f0b95fcbbec0bb + +Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/5b3d3a550015e9367ad13ee5f9febe0c3f84cf33 +Copy-Tag: eyJwIjoiamF2YS1iYXRjaC8uT3dsQm90LnlhbWwiLCJoIjoiNWIzZDNhNTUwMDE1ZTkzNjdhZDEzZWU1ZjlmZWJlMGMzZjg0Y2YzMyJ9 +END_NESTED_COMMIT`, + }, + { + name: "test separate multiple commits in delimiters", + title: "feat: Adds named reservation to InstancePolicy", + body: `- [ ] Regenerate this pull request now. + +--- +docs:Remove "not yet implemented" for Accelerator & Refine Volume API docs + +--- +docs: update the job id format requirement + +PiperOrigin-RevId: 489502315 + +Source-Link: https://togithub.com/googleapis/googleapis/commit/db1cc1139fe0def1e87ead1fffbc5bedbeccb887 + +Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/fcc564ef064c7dff31d7970e12318ad084703ac6 +Copy-Tag: eyJwIjoiamF2YS1iYXRjaC8uT3dsQm90LnlhbWwiLCJoIjoiZmNjNTY0ZWYwNjRjN2RmZjMxZDc5NzBlMTIzMThhZDA4NDcwM2FjNiJ9 + +BEGIN_NESTED_COMMIT +feat: Adds named reservation to InstancePolicy +--- +docs:Remove "not yet implemented" for Accelerator & Refine Volume API docs + +--- +docs: update the job id format requirement + +PiperOrigin-RevId: 489501779 + +Source-Link: https://togithub.com/googleapis/googleapis/commit/488a4bdeebf9c7f505f48bed23f0b95fcbbec0bb + +Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/5b3d3a550015e9367ad13ee5f9febe0c3f84cf33 +Copy-Tag: eyJwIjoiamF2YS1iYXRjaC8uT3dsQm90LnlhbWwiLCJoIjoiNWIzZDNhNTUwMDE1ZTkzNjdhZDEzZWU1ZjlmZWJlMGMzZjg0Y2YzMyJ9 + +feat: Adds named reservation to InstancePolicy +--- +docs:Remove "not yet implemented" for Accelerator & Refine Volume API docs + +--- +docs: update the job id format requirement + +PiperOrigin-RevId: 489501779 + +Source-Link: https://togithub.com/googleapis/googleapis/commit/488a4bdeebf9c7f505f48bed23f0b95fcbbec0bb + +Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/5b3d3a550015e9367ad13ee5f9febe0c3f84cf33 +Copy-Tag: eyJwIjoiamF2YS1iYXRjaC8uT3dsQm90LnlhbWwiLCJoIjoiNWIzZDNhNTUwMDE1ZTkzNjdhZDEzZWU1ZjlmZWJlMGMzZjg0Y2YzMyJ9 +END_NESTED_COMMIT`, + want: "feat(batch): Adds named reservation to InstancePolicy", + want1: `- [ ] Regenerate this pull request now. + +--- +docs:Remove "not yet implemented" for Accelerator & Refine Volume API docs + +--- +docs: update the job id format requirement + +PiperOrigin-RevId: 489502315 + +Source-Link: https://togithub.com/googleapis/googleapis/commit/db1cc1139fe0def1e87ead1fffbc5bedbeccb887 + +Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/fcc564ef064c7dff31d7970e12318ad084703ac6 +Copy-Tag: eyJwIjoiamF2YS1iYXRjaC8uT3dsQm90LnlhbWwiLCJoIjoiZmNjNTY0ZWYwNjRjN2RmZjMxZDc5NzBlMTIzMThhZDA4NDcwM2FjNiJ9 + +BEGIN_NESTED_COMMIT +feat: Adds named reservation to InstancePolicy +--- +docs:Remove "not yet implemented" for Accelerator & Refine Volume API docs + +--- +docs: update the job id format requirement + +PiperOrigin-RevId: 489501779 + +Source-Link: https://togithub.com/googleapis/googleapis/commit/488a4bdeebf9c7f505f48bed23f0b95fcbbec0bb + +Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/5b3d3a550015e9367ad13ee5f9febe0c3f84cf33 +Copy-Tag: eyJwIjoiamF2YS1iYXRjaC8uT3dsQm90LnlhbWwiLCJoIjoiNWIzZDNhNTUwMDE1ZTkzNjdhZDEzZWU1ZjlmZWJlMGMzZjg0Y2YzMyJ9 +END_NESTED_COMMIT + +BEGIN_NESTED_COMMIT +feat: Adds named reservation to InstancePolicy +--- +docs:Remove "not yet implemented" for Accelerator & Refine Volume API docs + +--- +docs: update the job id format requirement + +PiperOrigin-RevId: 489501779 + +Source-Link: https://togithub.com/googleapis/googleapis/commit/488a4bdeebf9c7f505f48bed23f0b95fcbbec0bb + +Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/5b3d3a550015e9367ad13ee5f9febe0c3f84cf33 +Copy-Tag: eyJwIjoiamF2YS1iYXRjaC8uT3dsQm90LnlhbWwiLCJoIjoiNWIzZDNhNTUwMDE1ZTkzNjdhZDEzZWU1ZjlmZWJlMGMzZjg0Y2YzMyJ9 +END_NESTED_COMMIT`, }, } for _, tt := range tests { @@ -156,11 +313,8 @@ END_NESTED_COMMIT`, t.Errorf("processCommit() error = %v, wantErr %v", err, tt.wantErr) return } - if got != tt.want { - t.Errorf("processCommit() got = %v, want %v", got, tt.want) - } - if got1 != tt.want1 { - t.Errorf("processCommit() got1 = %v, want %v", got1, tt.want1) + if diff := cmp.Diff(tt.want, got); diff != "" { + t.Errorf("processCommit() mismatch (-want +got):\n%s", diff) } if diff := cmp.Diff(tt.want1, got1); diff != "" { t.Errorf("processCommit() mismatch (-want +got):\n%s", diff)