Skip to content
Merged
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
036bff0
🐛 fix: clear blocker ledger entry when an issue closes
odttlnt Oct 29, 2026
53b91bd
Merge branch 'v5' into hive/adopt-15312
hivecommons-hive[bot] Oct 30, 2026
bcaf7b9
Merge branch 'v5' into hive/adopt-15312
hivecommons-hive[bot] Oct 30, 2026
5275d0f
Merge branch 'v5' into hive/adopt-15312
hivecommons-hive[bot] Oct 30, 2026
6f74e7c
Merge branch 'v5' into hive/adopt-15312
hivecommons-hive[bot] Oct 30, 2026
5a1104e
Merge branch 'v5' into hive/adopt-15312
hivecommons-hive[bot] Oct 30, 2026
7cb3db3
Merge branch 'v5' into hive/adopt-15312
hivecommons-hive[bot] Oct 30, 2026
f6554d5
Merge branch 'v5' into hive/adopt-15312
hivecommons-hive[bot] Oct 30, 2026
f7fca62
Merge branch 'v5' into hive/adopt-15312
hivecommons-hive[bot] Oct 30, 2026
e6e829a
Merge branch 'v5' into hive/adopt-15312
hivecommons-hive[bot] Oct 30, 2026
08ebcf5
Merge branch 'v5' into hive/adopt-15312
hivecommons-hive[bot] Oct 30, 2026
2367a5e
Merge branch 'v5' into hive/adopt-15312
hivecommons-hive[bot] Oct 30, 2026
fda46a2
Merge branch 'v5' into hive/adopt-15312
hivecommons-hive[bot] Oct 30, 2026
f8c1bfc
Merge branch 'v5' into hive/adopt-15312
hivecommons-hive[bot] Oct 30, 2026
038995f
Merge branch 'v5' into hive/adopt-15312
hivecommons-hive[bot] Oct 30, 2026
59fd4cf
Merge branch 'v5' into hive/adopt-15312
hivecommons-hive[bot] Oct 30, 2026
6de83ba
Merge branch 'v5' into hive/adopt-15312
hivecommons-hive[bot] Oct 30, 2026
df8b854
Merge branch 'v5' into hive/adopt-15312
hivecommons-hive[bot] Oct 30, 2026
21b7cfb
Merge branch 'v5' into hive/adopt-15312
hivecommons-hive[bot] Oct 30, 2026
03eb52b
Merge branch 'v5' into hive/adopt-15312
hivecommons-hive[bot] Oct 30, 2026
867255f
Merge branch 'v5' into hive/adopt-15312
hivecommons-hive[bot] Oct 30, 2026
5ecec07
Merge branch 'v5' into hive/adopt-15312
hivecommons-hive[bot] Oct 30, 2026
146b903
Merge branch 'v5' into hive/adopt-15312
hivecommons-hive[bot] Oct 30, 2026
88be7ed
Merge branch 'v5' into hive/adopt-15312
hivecommons-hive[bot] Oct 30, 2026
05f28d6
Merge branch 'v5' into hive/adopt-15312
hivecommons-hive[bot] Oct 30, 2026
79bffde
Merge branch 'v5' into hive/adopt-15312
hivecommons-hive[bot] Oct 30, 2026
04dfe41
Merge branch 'v5' into hive/adopt-15312
hivecommons-hive[bot] Oct 30, 2026
6e6253c
♻️ refactor: drop redundant close-clear; keep realistic regression test
hivecommons-hive[bot] Oct 30, 2026
b4a0c35
✅ test: name comment-seeded blocker test for what it adds
hivecommons-hive[bot] Oct 30, 2026
8c23ac2
Merge branch 'v5' into hive/adopt-15312
hivecommons-hive[bot] Oct 30, 2026
1f22fca
Merge branch 'v5' into hive/adopt-15312
hivecommons-hive[bot] Oct 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions src/pkg/github/issue_blocker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,35 @@ func TestWebhookIssueCommentRecordsBlocker(t *testing.T) {
}
}

// hivecommons/hive#15273: a blocker recorded from a live issue_comment
// delivery (not seeded via Observe) is forgotten when GitHub later closes
// the issue, so capabilities.blocked_items stops counting it while other
// items keep their count. Negative cases (labeled, PR close, reopen) live in
// TestWebhookClosedIssueClearsBlocker.
func TestWebhookCommentSeededBlockerClearsOnClose(t *testing.T) {
l := swapSharedLedger(t)
c, _ := setupWebhookCacheTest(t)
at := time.Date(2026, 10, 20, 19, 33, 0, 0, time.UTC)
res, err := c.HandleWebhookEvent("issue_comment", []byte(`{"action":"created","issue":{"number":21},"comment":{"body":`+jsonString(workflowsReport)+`,"created_at":"2026-10-20T19:33:00Z"},"repository":{"full_name":"org/repo"}}`))
if err != nil || res.BlockerKind == "" {
t.Fatalf("seed: %+v %v", res, err)
}
repo := res.ConfiguredRepo
l.Observe(repo, 22, workflowsReport, at)
if _, ok := l.Blocking(repo, 21); !ok {
t.Fatal("issue 21 not blocking before close")
}
if _, err := c.HandleWebhookEvent("issues", []byte(`{"action":"closed","issue":{"number":21,"state":"closed"},"repository":{"full_name":"org/repo"}}`)); err != nil {
t.Fatal(err)
}
if _, ok := l.Get(repo, 21); ok {
t.Fatal("closed issue kept its ledger row")
}
if got := l.Capabilities(); got.BlockedItems != 1 {
t.Fatalf("blocked_items = %+v, want only issue 22", got)
}
}

func jsonString(s string) string {
return `"` + strings.NewReplacer(`\`, `\\`, `"`, `\"`, "\n", `\n`).Replace(s) + `"`
}
Expand Down
Loading