Skip to content

Commit e95f170

Browse files
authored
Merge pull request #85 from tstromberg/reliable
Change assignment formatting
2 parents 6254ec1 + 2f9d075 commit e95f170

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

pkg/notify/format_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -293,15 +293,15 @@ func TestFormatNextActionsInternal(t *testing.T) {
293293
nextActions: map[string]turn.Action{
294294
"user1": {Kind: turn.ActionReview},
295295
},
296-
expected: "review: @user1",
296+
expected: "*review* → @user1",
297297
},
298298
{
299299
name: "multiple users same action",
300300
nextActions: map[string]turn.Action{
301301
"user1": {Kind: turn.ActionReview},
302302
"user2": {Kind: turn.ActionReview},
303303
},
304-
expected: "review: @user1, @user2",
304+
expected: "*review* → @user1, @user2",
305305
},
306306
{
307307
name: "system user filtered out",
@@ -316,7 +316,7 @@ func TestFormatNextActionsInternal(t *testing.T) {
316316
"_system": {Kind: turn.ActionReview},
317317
"user1": {Kind: turn.ActionReview},
318318
},
319-
expected: "review: @user1",
319+
expected: "*review* → @user1",
320320
},
321321
}
322322

@@ -650,7 +650,7 @@ func TestFormatNextActionsSuffixWithActions(t *testing.T) {
650650
Domain: "example.com",
651651
UserMapper: mapper,
652652
},
653-
expected: " review: @user1",
653+
expected: " • *review* → @user1",
654654
},
655655
{
656656
name: "suffix with multiple users",
@@ -667,7 +667,7 @@ func TestFormatNextActionsSuffixWithActions(t *testing.T) {
667667
Domain: "example.com",
668668
UserMapper: mapper,
669669
},
670-
expected: " review: ",
670+
expected: " • *review* → ",
671671
},
672672
{
673673
name: "suffix filters system user",
@@ -683,7 +683,7 @@ func TestFormatNextActionsSuffixWithActions(t *testing.T) {
683683
Domain: "example.com",
684684
UserMapper: mapper,
685685
},
686-
expected: " review",
686+
expected: " review",
687687
},
688688
}
689689

@@ -693,8 +693,8 @@ func TestFormatNextActionsSuffixWithActions(t *testing.T) {
693693
// For tests with multiple users, just check that result starts with the prefix
694694
// since map iteration order is not guaranteed
695695
if tt.name == "suffix with multiple users" {
696-
if !contains(result, " review: ") {
697-
t.Errorf("expected result to contain \" review: \", got: %q", result)
696+
if !contains(result, " • *review* → ") {
697+
t.Errorf("expected result to contain \" • *review* → \", got: %q", result)
698698
}
699699
} else if result != tt.expected {
700700
t.Errorf("expected %q, got %q", tt.expected, result)

pkg/notify/notify.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ func FormatNextActionsSuffix(ctx context.Context, params MessageParams) string {
126126

127127
actions := formatNextActionsInternal(ctx, params.CheckResult.Analysis.NextAction, params.Owner, params.Domain, params.UserMapper)
128128
if actions != "" {
129-
return fmt.Sprintf(" %s", actions)
129+
return fmt.Sprintf(" %s", actions)
130130
}
131131
return ""
132132
}
@@ -272,10 +272,10 @@ func formatNextActionsInternal(ctx context.Context, nextActions map[string]turn.
272272
// Format user mentions (will be empty if only _system was assigned)
273273
userMentions := userMapper.FormatUserMentions(ctx, users, owner, domain)
274274

275-
// If action has users, format as "action: users"
276-
// If no users (was only _system), just show the action
275+
// If action has users, format as "*action* → users" (bold action when assigned to person)
276+
// If no users (was only _system), just show the action without bold
277277
if userMentions != "" {
278-
parts = append(parts, fmt.Sprintf("%s: %s", actionName, userMentions))
278+
parts = append(parts, fmt.Sprintf("*%s* → %s", actionName, userMentions))
279279
} else {
280280
parts = append(parts, actionName)
281281
}

0 commit comments

Comments
 (0)