Skip to content

Commit

Permalink
feat: update changelog convert format to move Backward Compatible as …
Browse files Browse the repository at this point in the history
…last item (#208)
  • Loading branch information
andreaangiolillo authored Aug 29, 2024
1 parent 0e8cd84 commit b6ff3e4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tools/cli/internal/cli/changelog/convert/slack.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ func newAttachmentFromChange(version, method, path string, change *changelog.Cha

func newAttachmentText(version, method, path, changeCode, change, backwardCompatible, hiddenFromChangelog string) string {
return fmt.Sprintf(
"\n• *Version*: `%s`\n• *Path*: `%s %s`\n• *Backward Compatible*: `%s`\n• *Hidden from Changelog*: `%s`\n• *Change Code*: `%s`\n• *Change*: `%s`",
version, method, path, backwardCompatible, hiddenFromChangelog, changeCode, change)
"\n• *Version*: `%s`\n• *Path*: `%s %s`\n• *Hidden from Changelog*: `%s`\n• *Change Code*: `%s`\n• *Change*: `%s`\n• *Backward Compatible*: `%s`",
version, method, path, hiddenFromChangelog, changeCode, change, backwardCompatible)
}

func newColorFromBackwardCompatible(backwardCompatible bool) string {
Expand Down
4 changes: 2 additions & 2 deletions tools/cli/internal/cli/changelog/convert/slack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func TestNewAttachmentText(t *testing.T) {
change: "added the new DUBLIN_IRL, FRANKFURT_DEU, LONDON_GBR enum values",
backwardCompatible: "true",
hiddenFromChangelog: "false",
expected: "\n• *Version*: `2024-08-05`\n• *Path*: `GET /api/atlas/v2/groups/{groupId}/clusters`\n• *Backward Compatible*: `true`\n• *Hidden from Changelog*: `false`\n• *Change Code*: `response-property-enum-value-added`\n• *Change*: `added the new DUBLIN_IRL, FRANKFURT_DEU, LONDON_GBR enum values`", //nolint:lll //Test string
expected: "\n• *Version*: `2024-08-05`\n• *Path*: `GET /api/atlas/v2/groups/{groupId}/clusters`\n• *Hidden from Changelog*: `false`\n• *Change Code*: `response-property-enum-value-added`\n• *Change*: `added the new DUBLIN_IRL, FRANKFURT_DEU, LONDON_GBR enum values`\n• *Backward Compatible*: `true`", //nolint:lll //Test string
},
{
name: "Non-Backward Compatible Change",
Expand All @@ -52,7 +52,7 @@ func TestNewAttachmentText(t *testing.T) {
change: "added the new optional request property replicaSetScalingStrategy",
hiddenFromChangelog: "true",
backwardCompatible: "false",
expected: "\n• *Version*: `2024-08-05`\n• *Path*: `POST /api/atlas/v2/groups/{groupId}/clusters`\n• *Backward Compatible*: `false`\n• *Hidden from Changelog*: `true`\n• *Change Code*: `new-optional-request-property`\n• *Change*: `added the new optional request property replicaSetScalingStrategy`", //nolint:lll //Test string
expected: "\n• *Version*: `2024-08-05`\n• *Path*: `POST /api/atlas/v2/groups/{groupId}/clusters`\n• *Hidden from Changelog*: `true`\n• *Change Code*: `new-optional-request-property`\n• *Change*: `added the new optional request property replicaSetScalingStrategy`\n• *Backward Compatible*: `false`", //nolint:lll //Test string
},
}

Expand Down

0 comments on commit b6ff3e4

Please sign in to comment.