feat(ploeg): expose who asked for changes on a pull request #203

Merged
ryangr0 merged 2 commits from ryangr0/ploeg-changes-requested-by into development 2026-10-03 15:14:41 +00:00 AGit
Owner

Summary

The operator API's pullRequest now carries changesRequestedBy: each distinct forge login from work_item_reviews that asked for changes (state = 'changes_requested', empty logins skipped), ordered by that login's newest request first, and [] when nobody did. It is a correlated jsonb_agg subquery next to the existing EXISTS, so list and detail reads stay one SQL statement. No migration.

Ticket: https://vikunja.webgrip.dev/tasks/1601

Acceptance criteria

  • Met: pullRequest.changesRequestedBy is an array of distinct reviewer logins from work_item_reviews, newest review first, and an empty array when there are none.
  • Met: humanChangesRequested stays unchanged. The existing assertions are untouched and still pass.
  • Met: the list query stays one SQL statement per page, with no per-item Go queries.
  • Met: docs/contracts/operator-api.v1.schema.json declares the field optional (not in required, uniqueItems).

Tests

  • pkg/store: TestOperatorPullRequestNamesWhoAskedForChangesNewestFirst covers no review, approved only, one reviewer, the same reviewer twice, two reviewers newest first, and a reviewer who asked again moving back to the front. It checks both the list and the detail.
  • pkg/httpapi: TestOperatorWorkItemNamesWhoAskedForChangesWithinTheSchema checks that the list and detail responses validate against operator-api.v1 and carry the logins.
  • On the old code both tests fail to compile (the field is missing).
  • go test -count=1 ./...: all ok. go vet ./...: clean. mise run verify: all gates passed (vloer 7, demo-replay 1, vloer-extension 4, ploeg 7, brand 1, site 5, site-demo 1, helm 15, release 3, integration 1, docs 1). The site replay was not stale.

Checks left to CI

None. Every gate ran locally.

🤖 Generated with Claude Code

## Summary The operator API's `pullRequest` now carries `changesRequestedBy`: each distinct forge login from `work_item_reviews` that asked for changes (`state = 'changes_requested'`, empty logins skipped), ordered by that login's newest request first, and `[]` when nobody did. It is a correlated `jsonb_agg` subquery next to the existing `EXISTS`, so list and detail reads stay one SQL statement. No migration. Ticket: https://vikunja.webgrip.dev/tasks/1601 ## Acceptance criteria - [x] **Met:** `pullRequest.changesRequestedBy` is an array of distinct reviewer logins from `work_item_reviews`, newest review first, and an empty array when there are none. - [x] **Met:** `humanChangesRequested` stays unchanged. The existing assertions are untouched and still pass. - [x] **Met:** the list query stays one SQL statement per page, with no per-item Go queries. - [x] **Met:** `docs/contracts/operator-api.v1.schema.json` declares the field optional (not in `required`, `uniqueItems`). ## Tests - `pkg/store`: `TestOperatorPullRequestNamesWhoAskedForChangesNewestFirst` covers no review, approved only, one reviewer, the same reviewer twice, two reviewers newest first, and a reviewer who asked again moving back to the front. It checks both the list and the detail. - `pkg/httpapi`: `TestOperatorWorkItemNamesWhoAskedForChangesWithinTheSchema` checks that the list and detail responses validate against operator-api.v1 and carry the logins. - On the old code both tests fail to compile (the field is missing). - `go test -count=1 ./...`: all ok. `go vet ./...`: clean. `mise run verify`: all gates passed (vloer 7, demo-replay 1, vloer-extension 4, ploeg 7, brand 1, site 5, site-demo 1, helm 15, release 3, integration 1, docs 1). The site replay was not stale. ## Checks left to CI None. Every gate ran locally. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The operator API's pullRequest now carries changesRequestedBy: each
distinct forge login that asked for changes, ordered by its newest
request first, and an empty array when nobody did. It is aggregated in
the same SQL statement as humanChangesRequested, which stays unchanged
for older consumers. operator-api.v1 declares the field optional.

VIK-1601
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
style(ploeg): gofmt the changesRequestedBy query concatenation
Some checks failed
[Workflow] On Pull Request / warnings (pull_request) Has been cancelled
[Workflow] On Pull Request / release-policy (pull_request) Has been cancelled
[Workflow] On Pull Request / checks (pull_request) Has been cancelled
25c0d268e0
VIK-1601
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
ryangr0 merged commit 9c1d53f01f into development 2026-10-03 15:14:41 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
webgrip/unfold!203
No description provided.