fix(storage): persist close_reason to issues table on close (#551)
CloseIssue was storing the reason only in the events table, not in the issues.close_reason column. This caused `bd show --json` to return an empty close_reason even when one was provided. - Update CloseIssue in queries.go and transaction.go to set close_reason - Clear close_reason when reopening issues (in manageClosedAt) - Add tests for close_reason in storage and CLI JSON output - Document the dual-storage of close_reason (issues + events tables)
This commit is contained in:
@@ -268,6 +268,9 @@ func TestTransactionCloseIssue(t *testing.T) {
|
||||
if closed.Status != types.StatusClosed {
|
||||
t.Errorf("expected status 'closed', got %q", closed.Status)
|
||||
}
|
||||
if closed.CloseReason != "Done" {
|
||||
t.Errorf("expected close_reason 'Done', got %q", closed.CloseReason)
|
||||
}
|
||||
}
|
||||
|
||||
// TestTransactionDeleteIssue tests deleting an issue within a transaction.
|
||||
|
||||
Reference in New Issue
Block a user