File tree 5 files changed +38
-3
lines changed
5 files changed +38
-3
lines changed Original file line number Diff line number Diff line change 23
23
from library_generation .utils .commit_message_formatter import format_commit_message
24
24
from library_generation .utilities import get_file_paths
25
25
from library_generation .utils .commit_message_formatter import wrap_nested_commit
26
+ from library_generation .utils .commit_message_formatter import wrap_override_commit
26
27
27
28
28
29
@click .group (invoke_without_command = False )
@@ -175,7 +176,11 @@ def __combine_commit_messages(
175
176
f"[googleapis/googleapis@{ short_sha } ](https://github.com/googleapis/googleapis/commit/{ commit .hexsha } )"
176
177
)
177
178
178
- messages .extend (format_commit_message (commits = commits , is_monorepo = is_monorepo ))
179
+ messages .extend (
180
+ wrap_override_commit (
181
+ format_commit_message (commits = commits , is_monorepo = is_monorepo )
182
+ )
183
+ )
179
184
180
185
return "\n " .join (messages )
181
186
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ Qualified commits are:
6
6
[googleapis/googleapis@0733fdb](https://github.com/googleapis/googleapis/commit/0733fdb5f745192f9f3c95f8d08039286567cbcc)
7
7
[googleapis/googleapis@9e35c62](https://github.com/googleapis/googleapis/commit/9e35c620157d7b11cb5b2e5d0249c5caaee824f3)
8
8
[googleapis/googleapis@36dedd0](https://github.com/googleapis/googleapis/commit/36dedd0d9020c19d1c8259003c2fe9656ada7471)
9
+ BEGIN_COMMIT_OVERRIDE
9
10
BEGIN_NESTED_COMMIT
10
11
docs: [cloudcontrolspartner] update documentation URL
11
12
@@ -49,4 +50,5 @@ feat: [cloudcontrolspartner] added CloudControlsPartner API
49
50
50
51
PiperOrigin-RevId: 606720708
51
52
52
- END_NESTED_COMMIT
53
+ END_NESTED_COMMIT
54
+ END_COMMIT_OVERRIDE
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ This pull request is generated with proto changes between googleapis commit 6790
2
2
Qualified commits are:
3
3
[googleapis/googleapis@fbcfef0](https://github.com/googleapis/googleapis/commit/fbcfef09510b842774530989889ed1584a8b5acb)
4
4
[googleapis/googleapis@63d2a60](https://github.com/googleapis/googleapis/commit/63d2a60056ad5b156c05c7fb13138fc886c3b739)
5
+ BEGIN_COMMIT_OVERRIDE
5
6
BEGIN_NESTED_COMMIT
6
7
fix: extend timeouts for deleting snapshots, backups and tables
7
8
@@ -13,4 +14,5 @@ chore: update retry settings for backup rpcs
13
14
14
15
PiperOrigin-RevId: 605367937
15
16
16
- END_NESTED_COMMIT
17
+ END_NESTED_COMMIT
18
+ END_COMMIT_OVERRIDE
Original file line number Diff line number Diff line change 16
16
17
17
from library_generation .utils .commit_message_formatter import format_commit_message
18
18
from library_generation .utils .commit_message_formatter import wrap_nested_commit
19
+ from library_generation .utils .commit_message_formatter import wrap_override_commit
19
20
20
21
21
22
class CommitMessageFormatterTest (unittest .TestCase ):
@@ -114,3 +115,15 @@ def test_wrap_nested_commit_success(self):
114
115
],
115
116
wrap_nested_commit (messages ),
116
117
)
118
+
119
+ def test_wrap_override_commit_success (self ):
120
+ messages = ["a commit message" , "another message" ]
121
+ self .assertEqual (
122
+ [
123
+ "BEGIN_COMMIT_OVERRIDE" ,
124
+ "a commit message" ,
125
+ "another message" ,
126
+ "END_COMMIT_OVERRIDE" ,
127
+ ],
128
+ wrap_override_commit (messages ),
129
+ )
Original file line number Diff line number Diff line change @@ -62,3 +62,16 @@ def wrap_nested_commit(messages: List[str]) -> List[str]:
62
62
result .extend (messages )
63
63
result .append ("END_NESTED_COMMIT" )
64
64
return result
65
+
66
+
67
+ def wrap_override_commit (messages : List [str ]) -> List [str ]:
68
+ """
69
+ Wrap message between `BEGIN_COMMIT_OVERRIDE` and `END_COMMIT_OVERRIDE`.
70
+
71
+ :param messages: a (multi-line) commit message, one line per item.
72
+ :return: wrapped messages.
73
+ """
74
+ result = ["BEGIN_COMMIT_OVERRIDE" ]
75
+ result .extend (messages )
76
+ result .append ("END_COMMIT_OVERRIDE" )
77
+ return result
You can’t perform that action at this time.
0 commit comments