Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go

fix(issues): keep hidden blockers out of the release timeline and inbox entries (#11503)

pseudoyu664b1ab7e61d
diff --git a/server/internal/handler/issue_blocker_test.go b/server/internal/handler/issue_blocker_test.go
index 737098d748..4ed352ddbf 100644
--- a/server/internal/handler/issue_blocker_test.go
+++ b/server/internal/handler/issue_blocker_test.go
@@ -410,3 +410,39 @@ func TestIssueBlockerReleaseHonorsSuppressedRun(t *testing.T) {
})
}
}
+
+// A release names the blockers to the agent it starts. The timeline and the
+// inbox are read by people with different access, so neither names them.
+func TestIssueBlockerReleaseHidesReferencesFromGuest(t *testing.T) {
+ f := newGuestFixture(t)
+ ctx := context.Background()
+ for _, blocker := range []string{f.otherIssue, f.looseIssue} {
+ if err := service.AddIssueBlocker(ctx, testHandler.Queries, parseUUID(testWorkspaceID), parseUUID(f.sharedIssue), parseUUID(blocker), "member", parseUUID(testUserID)); err != nil {
+ t.Fatal(err)
+ }
+ }
+ t.Cleanup(func() {
+ dbfx.Exec(t, "DELETE FROM issue_blocker WHERE issue_id=$1", f.sharedIssue)
+ dbfx.Exec(t, "DELETE FROM inbox_item WHERE issue_id=$1", f.sharedIssue)
+ cleanupChildDoneIssue(f.sharedIssue)
+ })
+ dbfx.Exec(t, "UPDATE issue SET status='todo',assignee_type='member',assignee_id=$2 WHERE id=$1", f.sharedIssue, f.guest)
+ dbfx.Exec(t, "UPDATE issue SET status='done' WHERE id = ANY($1::uuid[])", []string{f.otherIssue, f.looseIssue})
+ svc := service.IssueWakeupService{Tasks: testHandler.TaskService}
+ if err := svc.TickWorkspaces(ctx, parseUUID(testWorkspaceID)); err != nil {
+ t.Fatal(err)
+ }
+ var inbox string
+ dbfx.QueryRow(t, "SELECT details::text FROM inbox_item WHERE issue_id=$1 AND type='blockers_done'", f.sharedIssue).Scan(&inbox)
+ timeline := guestRequest(t, testHandler.ListTimeline, f.guest, http.MethodGet, "/api/issues/"+f.sharedIssue+"/timeline", nil, "id", f.sharedIssue).Want(http.StatusOK).Body.String()
+ if !strings.Contains(timeline, "wakeup_triggered") {
+ t.Fatalf("release left no timeline entry: %s", timeline)
+ }
+ for name, got := range map[string]string{"timeline": timeline, "inbox": inbox} {
+ for _, secret := range []string{f.otherIssue, f.looseIssue, f.marker + " other issue", f.marker + " loose issue"} {
+ if strings.Contains(got, secret) {
+ t.Errorf("guest %s names a blocker it can't open (%s): %s", name, secret, got)
+ }
+ }
+ }
+}
diff --git a/server/internal/service/issue_blocker.go b/server/internal/service/issue_blocker.go
index 4bc0fb5bc4..b9a9c81c32 100644
--- a/server/internal/service/issue_blocker.go
+++ b/server/internal/service/issue_blocker.go
@@ -135,19 +135,9 @@ func systemWakeupFacts(w db.IssueWakeup, receipts []db.IssueWakeupReceipt) map[s
if w.SystemRule.String != SystemRuleBlockersDone {
return childDoneFacts(receipts)
}
- facts := map[string]any{"rule": SystemRuleBlockersDone}
- for i := len(receipts) - 1; i >= 0; i-- {
- if receipts[i].EventType != wakeupConditionEventType {
- continue
- }
- var payload struct {
- Observed map[string]any `json:"observed"`
- }
- _ = json.Unmarshal(receipts[i].Payload, &payload)
- facts["blockers"] = payload.Observed["blockers"]
- break
- }
- return facts
+ // The run's evidence names the blockers. These facts go to the timeline and
+ // the inbox, whose readers may not see every blocker's project.
+ return map[string]any{"rule": SystemRuleBlockersDone}
}
var ErrIssueBlockerNotFound = errors.New("blocker issue not found in this workspace")