Skip to content

Commit

Permalink
fix(internal/postprocessor): handle googleapis link in commit body (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
noahdietz committed Jan 12, 2024
1 parent 04ce84d commit 1dd3515
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion internal/postprocessor/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ func (p *postProcessor) processCommit(title, body string) (string, string, error
// 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/") {
if strings.HasPrefix(line, "Source-Link") && strings.Contains(line, "googleapis/googleapis/") {
hash := extractHashFromLine(line)
scopes, err := p.getScopesFromGoogleapisCommitHash(hash)
if err != nil {
Expand Down
13 changes: 13 additions & 0 deletions internal/postprocessor/testdata/nested-commits.input
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,17 @@ Source-Link: https://togithub.com/googleapis/googleapis/commit/488a4bdeebf9c7f50

Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/5b3d3a550015e9367ad13ee5f9febe0c3f84cf33
Copy-Tag: eyJwIjoiamF2YS1iYXRjaC8uT3dsQm90LnlhbWwiLCJoIjoiNWIzZDNhNTUwMDE1ZTkzNjdhZDEzZWU1ZjlmZWJlMGMzZjg0Y2YzMyJ9
END_NESTED_COMMIT

BEGIN_NESTED_COMMIT
fix(datacatalog): Change field behavior of the property "name" to IDENTIFIER

The solution follows guidelines from https://google.aip.dev/203#identifier and https://github.com/googleapis/googleapis/blob/master/google/api/field_behavior.proto#L91-L103.

PiperOrigin-RevId: 596643040

Source-Link: https://togithub.com/googleapis/googleapis/commit/3c84a3ca7d480cb6e09dc1e8f1bc4a77d03cac82

Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/4c4a9f43f4a4f7d87c931c121e0bd0fbd6392468
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNGM0YTlmNDNmNGE0ZjdkODdjOTMxYzEyMWUwYmQwZmJkNjM5MjQ2OCJ9
END_NESTED_COMMIT
12 changes: 12 additions & 0 deletions internal/postprocessor/testdata/nested-commits.output
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,16 @@ Source-Link: https://togithub.com/googleapis/googleapis/commit/488a4bdeebf9c7f50

Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/5b3d3a550015e9367ad13ee5f9febe0c3f84cf33
Copy-Tag: eyJwIjoiamF2YS1iYXRjaC8uT3dsQm90LnlhbWwiLCJoIjoiNWIzZDNhNTUwMDE1ZTkzNjdhZDEzZWU1ZjlmZWJlMGMzZjg0Y2YzMyJ9
END_NESTED_COMMIT
BEGIN_NESTED_COMMIT
fix(datacatalog): Change field behavior of the property "name" to IDENTIFIER

The solution follows guidelines from https://google.aip.dev/203#identifier and https://github.com/googleapis/googleapis/blob/master/google/api/field_behavior.proto#L91-L103.

PiperOrigin-RevId: 596643040

Source-Link: https://togithub.com/googleapis/googleapis/commit/3c84a3ca7d480cb6e09dc1e8f1bc4a77d03cac82

Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/4c4a9f43f4a4f7d87c931c121e0bd0fbd6392468
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNGM0YTlmNDNmNGE0ZjdkODdjOTMxYzEyMWUwYmQwZmJkNjM5MjQ2OCJ9
END_NESTED_COMMIT

0 comments on commit 1dd3515

Please sign in to comment.