fix: priority:0 omitempty and markdown nil pointer (GH#671, GH#674)
- Remove omitempty from Priority field so P0 issues preserve priority:0 - Add nil check for store in createIssuesFromMarkdown 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -306,6 +306,15 @@ func parseMarkdownFile(path string) ([]*IssueTemplate, error) {
|
||||
|
||||
// createIssuesFromMarkdown parses a markdown file and creates multiple issues from it
|
||||
func createIssuesFromMarkdown(_ *cobra.Command, filepath string) {
|
||||
// Ensure globals are initialized (bd-m0tl: fix nil pointer when store not ready)
|
||||
if store == nil {
|
||||
fmt.Fprintf(os.Stderr, "Error: database not initialized\n")
|
||||
os.Exit(1)
|
||||
}
|
||||
if actor == "" {
|
||||
actor = "bd" // Default actor if not set
|
||||
}
|
||||
|
||||
// Parse markdown file
|
||||
templates, err := parseMarkdownFile(filepath)
|
||||
if err != nil {
|
||||
|
||||
@@ -44,7 +44,7 @@ type Issue struct {
|
||||
Description string `json:"description,omitempty"`
|
||||
Notes string `json:"notes,omitempty"`
|
||||
Status string `json:"status,omitempty"`
|
||||
Priority int `json:"priority,omitempty"`
|
||||
Priority int `json:"priority"` // No omitempty: 0 is valid (P0/critical)
|
||||
IssueType string `json:"issue_type,omitempty"`
|
||||
CreatedAt string `json:"created_at,omitempty"`
|
||||
UpdatedAt string `json:"updated_at,omitempty"`
|
||||
|
||||
@@ -17,7 +17,7 @@ type Issue struct {
|
||||
AcceptanceCriteria string `json:"acceptance_criteria,omitempty"`
|
||||
Notes string `json:"notes,omitempty"`
|
||||
Status Status `json:"status,omitempty"`
|
||||
Priority int `json:"priority,omitempty"`
|
||||
Priority int `json:"priority"` // No omitempty: 0 is valid (P0/critical)
|
||||
IssueType IssueType `json:"issue_type,omitempty"`
|
||||
Assignee string `json:"assignee,omitempty"`
|
||||
EstimatedMinutes *int `json:"estimated_minutes,omitempty"`
|
||||
|
||||
Reference in New Issue
Block a user