Skip to content

Commit 653219a

Browse files
committed
fix
1 parent c7a6647 commit 653219a

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

tools/flakeguard/cmd/create_jira_tickets.go

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,10 @@ ticket in a text-based UI. Press 'y' to confirm creation, 'n' to skip,
9595
ft.RowIndex = i + 1
9696

9797
// Check local DB for known Jira ticket
98-
if ft.Valid {
99-
if ticketID, found := db.Get(ft.TestPackage, ft.TestName); found {
100-
ft.ExistingJiraKey = ticketID
101-
ft.ExistingTicketSource = "localdb"
102-
}
98+
// Always check local DB for known Jira ticket (even for invalid tests)
99+
if ticketID, found := db.Get(ft.TestPackage, ft.TestName); found {
100+
ft.ExistingJiraKey = ticketID
101+
ft.ExistingTicketSource = "localdb"
103102
}
104103
tickets = append(tickets, ft)
105104
}
@@ -119,7 +118,7 @@ ticket in a text-based UI. Press 'y' to confirm creation, 'n' to skip,
119118
if client != nil {
120119
for i := range tickets {
121120
t := &tickets[i]
122-
if t.Valid && t.ExistingJiraKey == "" {
121+
if t.ExistingJiraKey == "" {
123122
key, err := findExistingTicket(client, jiraSearchLabel, *t)
124123
if err != nil {
125124
log.Warn().Msgf("Search failed for %q: %v", t.Summary, err)
@@ -528,15 +527,13 @@ func (m model) View() string {
528527
helpLine := ""
529528
// Cases:
530529
// A) If invalid:
531-
// - If there's an existing ticket => [n] to next, [e] to update existing ticket ID, [q] to quit.
532-
// - Else => "Press any key to skip, or [q] to quit."
533530
// B) If valid & there's an existing ticket => [n] to next, [e] to update existing ticket ID, [q] to quit.
534531
// C) If valid & no existing => [y] to confirm, [n] to skip, [e] to enter existing ticket, [q] to quit (with DRY RUN text if needed).
535532
if !t.Valid {
536533
if t.ExistingJiraKey != "" {
537534
helpLine = faintStyle.Render("\n[n] to next, [e] to update existing ticket ID, [q] to quit.")
538535
} else {
539-
helpLine = faintStyle.Render("\nPress any key to skip, or [q] to quit.")
536+
helpLine = faintStyle.Render("\n[n] to next, [e] to add existing ticket ID, [q] to quit.")
540537
}
541538
} else {
542539
if t.ExistingJiraKey != "" {
@@ -555,7 +552,7 @@ func (m model) View() string {
555552
}
556553

557554
return fmt.Sprintf(
558-
"%s\n\n%s\n%s%s%s%s%s\n",
555+
"%s\n\n%s\n%s%s%s%s\n%s\n",
559556
header,
560557
sum,
561558
descHeader,

0 commit comments

Comments
 (0)