@@ -200,16 +200,16 @@ func TestParseCommits(t *testing.T) {
200200 },
201201 },
202202 {
203- name : "commit_override " ,
203+ name : "begin_commit " ,
204204 message : `feat: original message
205205
206- BEGIN_COMMIT_OVERRIDE
206+ BEGIN_COMMIT
207207fix(override): this is the override message
208208
209209This is the body of the override.
210210
211211Reviewed-by: Jane Doe
212- END_COMMIT_OVERRIDE ` ,
212+ END_COMMIT ` ,
213213 want : []* ConventionalCommit {
214214 {
215215 Type : "fix" ,
@@ -304,7 +304,65 @@ END_NESTED_COMMIT
304304 },
305305 },
306306 {
307- name : "commit_override_with_nested_commits" ,
307+ name : "begin_commit_with_nested_commits" ,
308+ message : `feat: API regeneration main commit
309+
310+ This pull request is generated with proto changes between
311+ ... ...
312+
313+ Librarian Version: {librarian_version}
314+ Language Image: {language_image_name_and_digest}
315+
316+ BEGIN_COMMIT
317+ BEGIN_NESTED_COMMIT
318+ feat: [abc] nested commit 1
319+
320+ body of nested commit 1
321+ ...
322+
323+ PiperOrigin-RevId: 123456
324+
325+ Source-Link: fake-link
326+ END_NESTED_COMMIT
327+ BEGIN_NESTED_COMMIT
328+ feat: [abc] nested commit 2
329+
330+ body of nested commit 2
331+ ...
332+
333+ PiperOrigin-RevId: 654321
334+
335+ Source-Link: fake-link
336+ END_NESTED_COMMIT
337+ END_COMMIT
338+ ` ,
339+ want : []* ConventionalCommit {
340+ {
341+ Type : "feat" ,
342+ Subject : "[abc] nested commit 1" ,
343+ Body : "body of nested commit 1\n ..." ,
344+ LibraryID : "abc" ,
345+ IsNested : true ,
346+ Footers : map [string ]string {"PiperOrigin-RevId" : "123456" , "Source-Link" : "fake-link" },
347+ CommitHash : sha .String (),
348+ When : now ,
349+ },
350+ {
351+ Type : "feat" ,
352+ Subject : "[abc] nested commit 2" ,
353+ IsNested : true ,
354+ Body : "body of nested commit 2\n ..." ,
355+ LibraryID : "abc" ,
356+ Footers : map [string ]string {"PiperOrigin-RevId" : "654321" , "Source-Link" : "fake-link" },
357+ CommitHash : sha .String (),
358+ When : now ,
359+ },
360+ },
361+ },
362+ {
363+ // This test verifies that the deprecated mark, BEGIN_COMMIT_OVERRIDE and END_COMMIT_OVERRIDE
364+ // can be used to separate nested commits.
365+ name : "begin_commit_override_with_nested_commits" ,
308366 message : `feat: API regeneration main commit
309367
310368This pull request is generated with proto changes between
@@ -360,18 +418,18 @@ END_COMMIT_OVERRIDE
360418 },
361419 },
362420 {
363- name : "nest_commit_outside_of_override_ignored " ,
421+ name : "nest_commit_outside_of_begin_commit_ignored " ,
364422 message : `feat: original message
365423
366424BEGIN_NESTED_COMMIT
367425ignored line
368- BEGIN_COMMIT_OVERRIDE
426+ BEGIN_COMMIT
369427fix(override): this is the override message
370428
371429This is the body of the override.
372430
373431Reviewed-by: Jane Doe
374- END_COMMIT_OVERRIDE
432+ END_COMMIT
375433END_NESTED_COMMIT` ,
376434 want : []* ConventionalCommit {
377435 {
@@ -397,7 +455,7 @@ This pull request is generated with proto changes between
397455[googleapis/googleapis@b738e78](https://github.com/googleapis/googleapis/commit/b738e78ed63effb7d199ed2d61c9e03291b6077f)
398456(inclusive).
399457
400- BEGIN_COMMIT_OVERRIDE
458+ BEGIN_COMMIT
401459BEGIN_NESTED_COMMIT
402460feat: [texttospeech] Support promptable voices by specifying a model name and a prompt
403461feat: [texttospeech] Add enum value M4A to enum AudioEncoding
@@ -407,7 +465,7 @@ PiperOrigin-RevId: 799242210
407465
408466Source-Link: [googleapis/googleapis@b738e78](https://github.com/googleapis/googleapis/commit/b738e78ed63effb7d199ed2d61c9e03291b6077f)
409467END_NESTED_COMMIT
410- END_COMMIT_OVERRIDE ` ,
468+ END_COMMIT ` ,
411469 want : []* ConventionalCommit {
412470 {
413471 Type : "feat" ,
@@ -458,7 +516,7 @@ This pull request is generated with proto changes between
458516[googleapis/googleapis@b738e78](https://github.com/googleapis/googleapis/commit/b738e78ed63effb7d199ed2d61c9e03291b6077f)
459517(inclusive).
460518
461- BEGIN_COMMIT_OVERRIDE
519+ BEGIN_COMMIT
462520BEGIN_NESTED_COMMIT
463521feat: [texttospeech] Support promptable voices by specifying a model
464522name and a prompt
@@ -467,7 +525,7 @@ docs: [texttospeech] A comment for method 'StreamingSynthesize' in
467525service 'TextToSpeech' is changed
468526
469527END_NESTED_COMMIT
470- END_COMMIT_OVERRIDE ` ,
528+ END_COMMIT ` ,
471529 want : []* ConventionalCommit {
472530 {
473531 Type : "feat" ,
@@ -511,7 +569,7 @@ This pull request is generated with proto changes between
511569[googleapis/googleapis@36533b0](googleapis/googleapis@36533b0)
512570(inclusive).
513571
514- BEGIN_COMMIT_OVERRIDE
572+ BEGIN_COMMIT
515573BEGIN_NESTED_COMMIT
516574docs: [google-cloud-video-live-stream] Update requirements of resource ID fields to be more clear
517575
@@ -521,7 +579,7 @@ BEGIN_NESTED_COMMIT
521579feat: [google-cloud-eventarc] add new fields to Eventarc resources
522580
523581END_NESTED_COMMIT
524- END_COMMIT_OVERRIDE ` ,
582+ END_COMMIT ` ,
525583 want : []* ConventionalCommit {
526584 {
527585 Type : "docs" ,
0 commit comments