|
6 | 6 | "encoding/json" |
7 | 7 | "fmt" |
8 | 8 | "os" |
9 | | - "path/filepath" |
10 | 9 | "regexp" |
11 | 10 | "strconv" |
12 | 11 | "strings" |
@@ -149,6 +148,7 @@ ticket in a text-based UI. Press 'y' to confirm creation, 'n' to skip, |
149 | 148 | } |
150 | 149 | if re.MatchString(tickets[i].TestPackage) { |
151 | 150 | tickets[i].AssigneeId = mapping.Assignee |
| 151 | + tickets[i].AssigneeName = mapping.AssigneeName |
152 | 152 | break // use first matching mapping |
153 | 153 | } |
154 | 154 | } |
@@ -599,11 +599,15 @@ func (m tmodel) View() string { |
599 | 599 | header = headerStyle.Render(fmt.Sprintf("Ticket #%d of %d (Invalid)", m.index+1, len(m.tickets))) |
600 | 600 | } |
601 | 601 |
|
602 | | - // New: Assignee line above Summary |
| 602 | + // Assignee |
603 | 603 | var assigneeLine string |
604 | | - if t.AssigneeId != "" { |
605 | | - assigneeLine = summaryStyle.Render("Assignee:") + "\n" + t.AssigneeId |
| 604 | + var assigneeDisplayValue string |
| 605 | + if t.AssigneeName != "" { |
| 606 | + assigneeDisplayValue = fmt.Sprintf("%s (%s)", t.AssigneeName, t.AssigneeId) |
| 607 | + } else { |
| 608 | + assigneeDisplayValue = t.AssigneeId |
606 | 609 | } |
| 610 | + assigneeLine = summaryStyle.Render("Assignee:") + "\n" + bodyStyle.Render(assigneeDisplayValue) |
607 | 611 |
|
608 | 612 | sum := summaryStyle.Render("Summary:") |
609 | 613 | sumBody := descBodyStyle.Render(t.Summary) |
@@ -709,41 +713,3 @@ func readFlakyTestsCSV(path string) ([][]string, error) { |
709 | 713 | r := csv.NewReader(f) |
710 | 714 | return r.ReadAll() |
711 | 715 | } |
712 | | - |
713 | | -func writeRemainingTicketsCSV(newPath string, m tmodel) error { |
714 | | - confirmedRows := make(map[int]bool) |
715 | | - for _, t := range m.tickets { |
716 | | - if t.Confirmed || t.ExistingJiraKey != "" { |
717 | | - confirmedRows[t.RowIndex] = true |
718 | | - } |
719 | | - } |
720 | | - var newRecords [][]string |
721 | | - orig := m.originalRecords |
722 | | - if len(orig) > 0 { |
723 | | - newRecords = append(newRecords, orig[0]) |
724 | | - } |
725 | | - for i := 1; i < len(orig); i++ { |
726 | | - if !confirmedRows[i] { |
727 | | - newRecords = append(newRecords, orig[i]) |
728 | | - } |
729 | | - } |
730 | | - f, err := os.Create(newPath) |
731 | | - if err != nil { |
732 | | - return err |
733 | | - } |
734 | | - defer f.Close() |
735 | | - w := csv.NewWriter(f) |
736 | | - if err := w.WriteAll(newRecords); err != nil { |
737 | | - return err |
738 | | - } |
739 | | - w.Flush() |
740 | | - return w.Error() |
741 | | -} |
742 | | - |
743 | | -func makeRemainingCSVPath(originalPath string) string { |
744 | | - ext := filepath.Ext(originalPath) |
745 | | - base := strings.TrimSuffix(filepath.Base(originalPath), ext) |
746 | | - dir := filepath.Dir(originalPath) |
747 | | - newName := base + ".remaining" + ext |
748 | | - return filepath.Join(dir, newName) |
749 | | -} |
0 commit comments