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:
cbro
2025-12-14 17:18:01 -05:00
committed by GitHub
parent 3a4da4e08d
commit 2651620a4c
5 changed files with 31 additions and 7 deletions

View File

@@ -333,6 +333,9 @@ func TestCLI_Close(t *testing.T) {
if closed[0]["status"] != "closed" {
t.Errorf("Expected status 'closed', got: %v", closed[0]["status"])
}
if closed[0]["close_reason"] != "Done" {
t.Errorf("Expected close_reason 'Done', got: %v", closed[0]["close_reason"])
}
}
func TestCLI_DepAdd(t *testing.T) {