mirror of
https://github.com/apricote/releaser-pleaser.git
synced 2026-02-07 10:17:02 +00:00
feat(releasepr): release PRs can be updated
- PR Description - Read prefix+suffix from PR description and put into changelog - Keep those overrides on PR description changes - Add pending level to new PRs
This commit is contained in:
parent
cb529f4760
commit
fe871a0213
17 changed files with 1442 additions and 22 deletions
|
|
@ -99,6 +99,8 @@ func Test_NewChangelogEntry(t *testing.T) {
|
|||
changesets []Changeset
|
||||
version string
|
||||
link string
|
||||
prefix string
|
||||
suffix string
|
||||
}
|
||||
tests := []struct {
|
||||
name string
|
||||
|
|
@ -188,6 +190,54 @@ func Test_NewChangelogEntry(t *testing.T) {
|
|||
|
||||
- Foobar!
|
||||
- **sad**: So sad!
|
||||
`,
|
||||
wantErr: assert.NoError,
|
||||
},
|
||||
{
|
||||
name: "prefix",
|
||||
args: args{
|
||||
changesets: []Changeset{{ChangelogEntries: []AnalyzedCommit{
|
||||
{
|
||||
Commit: Commit{},
|
||||
Type: "fix",
|
||||
Description: "Foobar!",
|
||||
},
|
||||
}}},
|
||||
version: "1.0.0",
|
||||
link: "https://example.com/1.0.0",
|
||||
prefix: "### Breaking Changes",
|
||||
},
|
||||
want: `## [1.0.0](https://example.com/1.0.0)
|
||||
### Breaking Changes
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- Foobar!
|
||||
`,
|
||||
wantErr: assert.NoError,
|
||||
},
|
||||
{
|
||||
name: "suffix",
|
||||
args: args{
|
||||
changesets: []Changeset{{ChangelogEntries: []AnalyzedCommit{
|
||||
{
|
||||
Commit: Commit{},
|
||||
Type: "fix",
|
||||
Description: "Foobar!",
|
||||
},
|
||||
}}},
|
||||
version: "1.0.0",
|
||||
link: "https://example.com/1.0.0",
|
||||
suffix: "### Compatibility\n\nThis version is compatible with flux-compensator v2.2 - v2.9.",
|
||||
},
|
||||
want: `## [1.0.0](https://example.com/1.0.0)
|
||||
### Bug Fixes
|
||||
|
||||
- Foobar!
|
||||
|
||||
### Compatibility
|
||||
|
||||
This version is compatible with flux-compensator v2.2 - v2.9.
|
||||
`,
|
||||
wantErr: assert.NoError,
|
||||
},
|
||||
|
|
@ -195,7 +245,7 @@ func Test_NewChangelogEntry(t *testing.T) {
|
|||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
got, err := NewChangelogEntry(tt.args.changesets, tt.args.version, tt.args.link)
|
||||
got, err := NewChangelogEntry(tt.args.changesets, tt.args.version, tt.args.link, tt.args.prefix, tt.args.suffix)
|
||||
if !tt.wantErr(t, err) {
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue