Skip to content

feat: ticket groups for batch progress tracking#12

Merged
ochaton merged 4 commits into
masterfrom
feat-groups
Apr 23, 2026
Merged

feat: ticket groups for batch progress tracking#12
ochaton merged 4 commits into
masterfrom
feat-groups

Conversation

@ochaton

@ochaton ochaton commented Apr 23, 2026

Copy link
Copy Markdown
Owner

Summary

  • Tickets can now be assigned to a named group via WithGroup(id) — works as a Put option, a ticket builder method, or a lifecycle transition option (same pattern as WithTube)
  • kh.Group(id) returns a lightweight handle with PendingCount(ctx) and AllTerminal(ctx) to query collective progress without blocking
  • Groups are persisted in the tickets table via a nullable group_id column, backed by a small partial index WHERE group_id IS NOT NULL AND status = 'pending' that shrinks as work completes
  • Also fixes a pre-existing memory store bug where UpdateBatch never applied status updates, and a postgres bug where the default update path queued an empty statement

Test plan

  • go test ./... in root and test/ — all existing tests pass
  • Five new group tests cover: pending count, all-terminal, mixed states, empty group, ungrouped isolation
  • Both memory and postgres store implementations satisfy the updated Store interface

🤖 Generated with Claude Code

ochaton and others added 2 commits April 23, 2026 13:26
Tickets can now be assigned to a named group via WithGroup(id).
A group handle (kh.Group(id)) exposes PendingCount and AllTerminal
so callers can asynchronously submit many tickets and later check
whether all have left the pending state — without blocking or polling
individual ticket IDs.

Groups are persisted in the tickets table (group_id column, nullable),
backed by a partial index on (group_id) WHERE pending, and support
mid-lifecycle transitions to a different group the same way tube
transfers work.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ochaton

ochaton commented Apr 23, 2026

Copy link
Copy Markdown
Owner Author

@copilot Review

Copilot AI commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

@copilot Review

Reviewed the current PR state at commit 6255d86. I reran go test ./... in the repo root and in test/, and both passed; no additional code changes were needed from this review request.

ochaton and others added 2 commits April 23, 2026 13:37
golangci-lint latest (v1.64.8) was built with Go 1.24 and rejects go 1.25+
in go.mod. Pin to v2.7.1 which supports Go 1.25+. Also suppress errcheck
on defer br.Close() and tx.Rollback() where ignoring the return is intentional.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
golangci-lint-action@v6 explicitly rejects v2.x version strings.
v7 is required to run golangci-lint v2.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ochaton ochaton merged commit d493ea6 into master Apr 23, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants