Repository navigation
refactor(workqueue): centralize assignment receipt projections - #67649
Conversation
Centralize payload-free identity projections in workqueue and retain CLI receipt aliases and captured lifecycle enrichment. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality Sentinel skipped because pre-fetch PR data was unavailable: unable to fetch test file diff
|
|
✅ PR Code Quality Reviewer completed the code quality review.
|
|
✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft.
|
|
✅ Ponytail Reviewer completed successfully! Lean already. Ship.
|
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
There was a problem hiding this comment.
🟢 Approval recommended
The refactor preserves validation and output behavior with comprehensive regression coverage.
0 open findings
What changed in this PR
Centralizes payload-free work-queue receipt projections while preserving CLI reporting behavior and validation.
Changes:
- Adds assignment and claim receipt projections.
- Replaces duplicated CLI structs with aliases.
- Adds projection and JSON-schema regressions.
| File | Description |
|---|---|
pkg/workqueue/receipts.go |
Defines receipt types and projections. |
pkg/workqueue/receipts_test.go |
Tests identity, isolation, shape, and omission behavior. |
pkg/cli/logs_work_queue_current.go |
Uses centralized receipts with lifecycle enrichment. |
pkg/cli/logs_work_queue_current_test.go |
Verifies the enriched CLI JSON schema. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
I didn't find an actionable blocking issue in the changed lines.
Scope
Reviewed the receipt projection refactor in `pkg/workqueue` and the CLI snapshot wiring/tests for correctness, lifecycle enrichment, and schema/regression coverage.🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt54 · 35 AIC · ⌖ 5.45 AIC · ⊞ 21.2K
Comment /review to run again
🏗️ Design Decision Gate — ADR RequiredThis PR makes significant changes to core business logic (156 new lines in 📄 Draft ADR committed:
🔍 Evidence used
📋 What to do next
Once an ADR is linked in the PR body, this gate will re-run and verify the implementation matches the decision. ❓ Why ADRs MatterADRs create a searchable, permanent record of why the codebase looks the way it does. Future contributors (and your future self) will thank you. 📋 Michael Nygard ADR Format ReferenceAn ADR must contain these four sections to be considered complete:
All ADRs are stored in
|
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /codebase-design — this is a clean, well-tested refactor with only minor clarity suggestions, no blocking issues.
📋 Key Themes & Highlights
Key Themes
- Two minor clarity suggestions around the
dispatch.ToReceipt()embedding resolution and the implicit index-alignment invariant incurrentWorkQueueAssignmentReceipt. Neither is a correctness bug — both are pre-existing patterns (the map-lookup zero-value fallback behavior is unchanged from before this PR) carried forward faithfully by the refactor.
Positive Highlights
- ✅
ToReceipt()projections are well-scoped: they strip payloads/result descriptors by construction rather than via an allowlist filter, which is a safer default. - ✅ Nil vs. empty slice handling is explicitly preserved and tested (
TestAssignmentToReceiptPreservesClaimsShape), avoiding a common JSON-shape regression. - ✅ The type-alias approach (
WorkQueueAssignmentReceipt = workqueue.AssignmentReceipt) is a clean way to centralize the type without breaking the CLI's existing JSON field names/tags. - ✅ Good regression coverage added in both packages, including a full enriched JSON schema test and a no-aliasing-of-source-claims assertion.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet50 · 77.9 AIC · ⌖ 14.5 AIC · ⊞ 10.3K
Comment /matt to run again
Explain embedded assignment projection at the CLI call site and document source claim order preservation. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
@copilot address the following outstanding work in one pass:
Push the necessary fixes, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved. Use the pr-finisher skill and stop when only human review or CI remains; do not trigger CI. Sous-chef head: 9cb0ff4
|
…eceipt-projections Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Summary
Assignment.ToReceipt()andAssignmentClaim.ToReceipt()projections inpkg/workqueue.Fixes #67200.
Validation
make buildandmake fmt-gopassed.make agent-report-progresspassed.golangci-lint run --allow-parallel-runners ./pkg/workqueue ./pkg/clipassed with zero issues.file.Close()error inreadBoundedWorkQueueArtifact; these are not changed by this PR.make fmtcompleted Go formatting but failed in the unrelated JavaScript formatting target; incidental JavaScript formatting changes were removed.