|
20 | 20 | ticketsJSONPath string |
21 | 21 | jiraComment bool // if true, post a comment when marking as skipped |
22 | 22 | ticketsDryRun bool // if true, do not send anything to Jira |
| 23 | + hideSkipped bool // if true, do not show skipped tests |
23 | 24 | ) |
24 | 25 |
|
25 | 26 | // TicketsCmd is the new CLI command for managing tickets. |
@@ -62,6 +63,17 @@ You can later extend this command to support additional actions.`, |
62 | 63 | } |
63 | 64 | } |
64 | 65 |
|
| 66 | + // If the hideSkipped flag is set, filter out tickets with a non-zero SkippedAt. |
| 67 | + if hideSkipped { |
| 68 | + filtered := make([]model.FlakyTicket, 0, len(tickets)) |
| 69 | + for _, t := range tickets { |
| 70 | + if t.SkippedAt.IsZero() { |
| 71 | + filtered = append(filtered, t) |
| 72 | + } |
| 73 | + } |
| 74 | + tickets = filtered |
| 75 | + } |
| 76 | + |
65 | 77 | // 3) Setup a Jira client (if available). |
66 | 78 | jiraClient, clientErr := jirautils.GetJiraClient() |
67 | 79 | if clientErr != nil { |
@@ -96,6 +108,7 @@ func init() { |
96 | 108 | TicketsCmd.Flags().StringVar(&ticketsJSONPath, "test-db-path", "flaky_test_db.json", "Path to the JSON file containing tickets") |
97 | 109 | TicketsCmd.Flags().BoolVar(&jiraComment, "jira-comment", true, "If true, post a comment to the Jira ticket when marking as skipped") |
98 | 110 | TicketsCmd.Flags().BoolVar(&ticketsDryRun, "dry-run", false, "If true, do not send anything to Jira") |
| 111 | + TicketsCmd.Flags().BoolVar(&hideSkipped, "hide-skipped", false, "If true, do not show skipped tests") |
99 | 112 | } |
100 | 113 |
|
101 | 114 | // ------------------------- |
|
0 commit comments