Skip to content

Commit

Permalink
fix: empty breaking or additive items in changelog (#16870)
Browse files Browse the repository at this point in the history
  • Loading branch information
tadelesh authored Jan 21, 2022
1 parent ec0cf6f commit 9727f72
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
18 changes: 12 additions & 6 deletions eng/tools/generator/autorest/model/changelog.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,21 @@ func writeChangelogForPackage(r *report.Package) string {
md := &markdown.Writer{}

// write breaking changes
md.WriteHeader("Breaking Changes")
for _, item := range getBreakingChanges(r.BreakingChanges) {
md.WriteListItem(item)
breakings := getBreakingChanges(r.BreakingChanges)
if len(breakings) > 0 {
md.WriteHeader("Breaking Changes")
for _, item := range breakings {
md.WriteListItem(item)
}
}

// write additional changes
md.WriteHeader("Features Added")
for _, item := range getNewContents(r.AdditiveChanges) {
md.WriteListItem(item)
additives := getNewContents(r.AdditiveChanges)
if len(additives) > 0 {
md.WriteHeader("Features Added")
for _, item := range additives {
md.WriteListItem(item)
}
}

return md.String()
Expand Down
4 changes: 0 additions & 4 deletions sdk/resourcemanager/resources/armpolicy/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@
- Struct `ErrorAdditionalInfo` has been removed
- Struct `ErrorResponse` has been removed

### Features Added



## 0.2.0 (2022-01-13)
### Breaking Changes

Expand Down

0 comments on commit 9727f72

Please sign in to comment.