Commit dcbe063
authored
fix(internal/conventionalcommits): relax footer regex to allow line broke footers to be properly recognized (#2388)
The original logic expect footer to follow `key: value` (exactly one
space before value) format as conventionalcommit specs. For multi-line
footers, when parsing
([logic](https://github.com/googleapis/librarian/blob/9b28aa4a3619579dfa59c430afa612589b353598/internal/conventionalcommits/conventional_commits.go#L336)),
the line content "Source-Link:" would fail the regex match and thus not
properly recognized as footer, and gets appended to the value of the
previous footer.
By relaxing the regex a bit to allow any number of spaces before "value"
in footer, the multiline footer can be recognized.
note: this format below from owlbot PR
([example](googleapis/google-cloud-python@34a7916))
is technically not valid footer according to conventionalcommits.org
spec
[here](https://www.conventionalcommits.org/en/v1.0.0/#:~:text=Each%20footer%20MUST%20consist%20of%20a%20word%20token%2C%20followed%20by%20either%20a%20%3A%3Cspace%3E%20or%20%3Cspace%3E%23%20separator%2C%20followed%20by%20a%20string%20value).
But we are relaxing to allow it for onboarding libraries.
```
Source-Link:
googleapis/googleapis@d300b15
```
This should solve the first issue causing this bug, see
[comment](#2080 (comment))
For #20801 parent 2e11004 commit dcbe063
File tree
2 files changed
+86
-2
lines changed- internal/conventionalcommits
2 files changed
+86
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
| 301 | + | |
| 302 | + | |
301 | 303 | | |
302 | 304 | | |
303 | 305 | | |
| |||
Lines changed: 82 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
693 | 693 | | |
694 | 694 | | |
695 | 695 | | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
0 commit comments