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(internal/postprocessor): handle googleapis link in commit body #9251

Merged
merged 1 commit into from
Jan 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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://github.com/googleapis/googleapis/commit/488a4bdeebf9c7f50

Source-Link: https://github.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://github.com/googleapis/googleapis/commit/3c84a3ca7d480cb6e09dc1e8f1bc4a77d03cac82

Source-Link: https://github.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://github.com/googleapis/googleapis/commit/488a4bdeebf9c7f50

Source-Link: https://github.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://github.com/googleapis/googleapis/commit/3c84a3ca7d480cb6e09dc1e8f1bc4a77d03cac82

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