parseIssueSpec extracts the issue number from various formats Supports: - GitHub issue URLs: https://github.com/owner/repo/issues/123 - Issue references: #123 - Plain numbers: 123
(input string)
| 240 | // - Issue references: #123 |
| 241 | // - Plain numbers: 123 |
| 242 | func parseIssueSpec(input string) string { |
| 243 | input = strings.TrimSpace(input) |
| 244 | |
| 245 | // First try to match GitHub issue URLs |
| 246 | if matches := issueURLPattern.FindStringSubmatch(input); len(matches) >= 2 { |
| 247 | return matches[1] |
| 248 | } |
| 249 | |
| 250 | // Try to match issue references like #123 |
| 251 | if matches := issueRefPattern.FindStringSubmatch(input); len(matches) >= 2 { |
| 252 | return matches[1] |
| 253 | } |
| 254 | |
| 255 | // Try to match plain numbers like 123 |
| 256 | if issueNumberPattern.MatchString(input) { |
| 257 | return input |
| 258 | } |
| 259 | |
| 260 | return "" |
| 261 | } |
| 262 | |
| 263 | // saveTrialResult saves a trial result to a JSON file |
| 264 | func saveTrialResult(filename string, result any, verbose bool) error { |
no outgoing calls