Skip to content

Commit

Permalink
always warn for deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
jazanne committed Mar 20, 2024
1 parent dd137c7 commit ef45f9a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion comments/comments.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func githubFlagComment(flag ldapi.FeatureFlag, aliases []string, added, extinct
func infoCellTemplate() string {
return `{{- if eq .Extinct true}} :white_check_mark: all references removed{{- end}} ` +
`{{- if eq .Archived true}}{{- if eq .Extinct true}}<br>{{end}}{{- if eq .Added true}} :warning:{{else}} :information_source:{{- end}} archived on {{.ArchivedAt | date "2006-01-02"}} ` +
`{{- else if eq .Deprecated true}}{{- if eq .Extinct true}}<br>{{end}}{{- if eq .Added true}} :warning:{{else}} :information_source:{{- end}} deprecated on {{.DeprecatedAt | date "2006-01-02"}}{{- end}}`
`{{- else if eq .Deprecated true}}{{- if eq .Extinct true}}<br>{{end}} :warning: deprecated on {{.DeprecatedAt | date "2006-01-02"}}{{- end}}`
}

func GithubNoFlagComment() *github.IssueComment {
Expand Down
10 changes: 5 additions & 5 deletions comments/comments_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ func newTestAccEnv() *testFlagEnv {
archivedFlag.ArchivedDate = ptr(int64(1691072480000))

deprecatedFlag := createFlag("deprecated-flag")
// deprecatedFlag.Deprecated = true
deprecatedFlag.Deprecated = true
deprecatedFlag.DeprecatedDate = ptr(int64(1691072480000))

return &testFlagEnv{
Flag: flag,
Expand Down Expand Up @@ -147,9 +148,8 @@ func TestGithubFlagComment(t *testing.T) {
t.Run("Extinct flag", acceptanceTestEnv.ExtinctFlag)
t.Run("Extinct and Archived flag", acceptanceTestEnv.ExtinctAndArchivedFlag)

// TODO need ldapi update to support deprecated flag
// t.Run("Deprecated flag added", acceptanceTestEnv.DeprecatedAdded)
// t.Run("Deprecated flag removed", acceptanceTestEnv.DeprecatedRemoved)
t.Run("Deprecated flag added", acceptanceTestEnv.DeprecatedAdded)
t.Run("Deprecated flag removed", acceptanceTestEnv.DeprecatedRemoved)
}

func TestProcessFlags(t *testing.T) {
Expand Down Expand Up @@ -236,7 +236,7 @@ func (e *testFlagEnv) DeprecatedRemoved(t *testing.T) {
comment, err := githubFlagComment(e.DeprecatedFlag, []string{}, false, false, &e.Config)
require.NoError(t, err)

expected := "| [deprecated flag](https://example.com/test) | `deprecated-flag` | | deprecated on 2023-08-03 |"
expected := "| [deprecated flag](https://example.com/test) | `deprecated-flag` | | :warning: deprecated on 2023-08-03 |"
assert.Equal(t, expected, comment)
}

Expand Down

0 comments on commit ef45f9a

Please sign in to comment.