Skip to content

Commit 180c8a9

Browse files
authored
feat: skip build only commit (#2555)
In this PR: - When generate pull request description, do not include a commit that only changes `BUILD.bazel`.
1 parent 5f2d4e7 commit 180c8a9

File tree

3 files changed

+44
-5
lines changed

3 files changed

+44
-5
lines changed

library_generation/generate_pr_description.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ def __get_commit_messages(
148148
def __filter_qualified_commit(paths: Dict[str, str], commit: Commit) -> (Commit, str):
149149
"""
150150
Returns a tuple of a commit and libray_name.
151-
A qualified commit means at least one file changes in that commit is
152-
within the versioned proto_path in paths.
151+
A qualified commit means at least one file, excluding BUILD.bazel, changes
152+
in that commit is within the versioned proto_path in paths.
153153
154154
:param paths: a mapping from versioned proto_path to library_name.
155155
:param commit: a commit under consideration.
@@ -158,7 +158,7 @@ def __filter_qualified_commit(paths: Dict[str, str], commit: Commit) -> (Commit,
158158
"""
159159
for file in commit.stats.files.keys():
160160
versioned_proto_path = find_versioned_proto_path(file)
161-
if versioned_proto_path in paths:
161+
if versioned_proto_path in paths and (not file.endswith("BUILD.bazel")):
162162
return commit, paths[versioned_proto_path]
163163
return ()
164164

library_generation/test/resources/integration/google-cloud-java/generation_config.yaml

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
gapic_generator_version: 2.37.0
22
protobuf_version: 25.2
3-
googleapis_commitish: 9868a57470a969ffa1d21194a5c05d7a6e4e98cc
3+
googleapis_commitish: 4ce0ff67a3d4509be641cbe47a35844ddc1268fc
44
owlbot_cli_image: sha256:623647ee79ac605858d09e60c1382a716c125fb776f69301b72de1cd35d49409
55
synthtool_commitish: 5e1fb2032fa44bc170677b38713023b4fec51a4e
66
template_excludes:
@@ -48,3 +48,11 @@ libraries:
4848
- proto_path: google/cloud/alloydb/connectors/v1
4949
- proto_path: google/cloud/alloydb/connectors/v1alpha
5050
- proto_path: google/cloud/alloydb/connectors/v1beta
51+
52+
- api_shortname: cloudcontrolspartner
53+
name_pretty: Cloud Controls Partner API
54+
product_documentation: https://cloud.google.com/sovereign-controls-by-partners/docs/sovereign-partners
55+
api_description: Provides insights about your customers and their Assured Workloads based on your Sovereign Controls by Partners offering.
56+
GAPICs:
57+
- proto_path: google/cloud/cloudcontrolspartner/v1
58+
- proto_path: google/cloud/cloudcontrolspartner/v1beta

library_generation/test/resources/integration/google-cloud-java/pr-description-golden.txt

+32-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,23 @@
1-
This pull request is generated with proto changes between googleapis commit a17d4caf184b050d50cacf2b0d579ce72c31ce74 (exclusive) and 9868a57470a969ffa1d21194a5c05d7a6e4e98cc (inclusive).
1+
This pull request is generated with proto changes between googleapis commit a17d4caf184b050d50cacf2b0d579ce72c31ce74 (exclusive) and 4ce0ff67a3d4509be641cbe47a35844ddc1268fc (inclusive).
22
Qualified commits are:
3+
[googleapis/googleapis@7659dd2](https://github.com/googleapis/googleapis/commit/7659dd2244563fd902b681bdcadbe5385b8d3462)
4+
[googleapis/googleapis@05d889e](https://github.com/googleapis/googleapis/commit/05d889e7dfe087fc2ddc9de9579f01d4e1c2f35e)
35
[googleapis/googleapis@aa16fda](https://github.com/googleapis/googleapis/commit/aa16fdad909bc33e2d4ff04cfde56a46d0e52b13)
46
[googleapis/googleapis@0733fdb](https://github.com/googleapis/googleapis/commit/0733fdb5f745192f9f3c95f8d08039286567cbcc)
7+
[googleapis/googleapis@9e35c62](https://github.com/googleapis/googleapis/commit/9e35c620157d7b11cb5b2e5d0249c5caaee824f3)
8+
[googleapis/googleapis@36dedd0](https://github.com/googleapis/googleapis/commit/36dedd0d9020c19d1c8259003c2fe9656ada7471)
9+
BEGIN_NESTED_COMMIT
10+
docs: [cloudcontrolspartner] update documentation URL
11+
12+
PiperOrigin-RevId: 612723053
13+
14+
END_NESTED_COMMIT
15+
BEGIN_NESTED_COMMIT
16+
feat: [cloudcontrolspartner] added CloudControlsPartner API
17+
18+
PiperOrigin-RevId: 612632640
19+
20+
END_NESTED_COMMIT
521
BEGIN_NESTED_COMMIT
622
feat: [alloydb] support for obtaining the public IP address of an Instance
723
feat: [alloydb] support for getting PSC DNS name from the GetConnectionInfo API
@@ -18,6 +34,21 @@ feat: [alloydb] support for getting PSC DNS name from the GetConnectionInfo API
1834

1935
PiperOrigin-RevId: 610415824
2036

37+
END_NESTED_COMMIT
38+
BEGIN_NESTED_COMMIT
39+
docs: [cloudcontrolspartner] Updated comment for method `ListCustomers` in service `CloudControlsPartnerCore`
40+
docs: [cloudcontrolspartner] Updated comment for field `location` in message `.google.cloud.cloudcontrolspartner.v1beta.Workload`
41+
docs: [cloudcontrolspartner] Updated a comment for field `partner_project_id` in message `.google.cloud.cloudcontrolspartner.v1beta.Partner`
42+
docs: [cloudcontrolspartner] Updated documentation URL
43+
44+
PiperOrigin-RevId: 609026905
45+
46+
END_NESTED_COMMIT
47+
BEGIN_NESTED_COMMIT
48+
feat: [cloudcontrolspartner] added CloudControlsPartner API
49+
50+
PiperOrigin-RevId: 606720708
51+
2152
END_NESTED_COMMIT
2253
BEGIN_NESTED_COMMIT
2354
feat: Regenerate with the Java code generator (gapic-generator-java) v2.37.0

0 commit comments

Comments
 (0)