parseCreateIssuesConfig handles create-issue configuration
(outputMap map[string]any)
| 30 | |
| 31 | // parseCreateIssuesConfig handles create-issue configuration |
| 32 | func (c *Compiler) parseCreateIssuesConfig(outputMap map[string]any) *CreateIssuesConfig { |
| 33 | return parseCreateEntityConfig( |
| 34 | outputMap, |
| 35 | "create-issue", |
| 36 | CreateParseOptions{ |
| 37 | BoolFields: []string{"close-older-issues", "group", "footer", "group-by-day"}, |
| 38 | IntFields: []string{"max"}, |
| 39 | HandleExpires: true, |
| 40 | }, |
| 41 | createIssueLog, |
| 42 | func(err error) *CreateIssuesConfig { |
| 43 | createIssueLog.Printf("Failed to unmarshal config: %v", err) |
| 44 | // For backward compatibility, handle nil/empty config |
| 45 | return &CreateIssuesConfig{} |
| 46 | }, |
| 47 | func(configData map[string]any) bool { |
| 48 | coerceStringOrArrayFields(configData, []string{"assignees"}, createIssueLog) |
| 49 | return true |
| 50 | }, |
| 51 | func(_ map[string]any, config *CreateIssuesConfig, expiresDisabled bool) { |
| 52 | // Set default max if not specified |
| 53 | if config.Max == nil { |
| 54 | config.Max = defaultIntStr(1) |
| 55 | } |
| 56 | |
| 57 | // Log expires if configured or explicitly disabled |
| 58 | if expiresDisabled { |
| 59 | createIssueLog.Print("Issue expiration explicitly disabled") |
| 60 | } else if config.Expires > 0 { |
| 61 | createIssueLog.Printf("Issue expiration configured: %d hours", config.Expires) |
| 62 | } |
| 63 | }, |
| 64 | ) |
| 65 | } |
| 66 | |
| 67 | // hasCopilotAssignee checks if "copilot" is in the assignees list |
| 68 | func hasCopilotAssignee(assignees []string) bool { |