droboticflow/internal/api/review_decision_test.go
d-robotics 74ea7f8274 🛡️ 03: deprecate task-scope review comments (ADR 0009)
Server: reject NEW task-scope problems on draft PUT (409
review_task_scope_deprecated, ID-matched against stored entries;
existing entries round-trip unchanged, full-replace semantics kept);
formal-rejection flattening no longer emits 整体任务 lines or
expands ProblemSliceIDs; rework-baseline reads hide task problems
(read-only narrowing); workforce stats stop counting task scope.

Frontend: remove task from composer scope lists and card cycle;
hide stored task opinions in rework banner/soft reminder/rail,
QC panel groups and history, acceptance source projection, stats
panel rows, frozen-comment displays (stripTaskOpinionLines);
submit/approve gates count visible problems only; stats panel
documents the 2026-10-14 scope switch.

Data untouched: no migration, no deletion, audit trail intact.
2026-10-14 19:02:29 +08:00

468 lines
21 KiB
Go

package api
import (
"context"
"droboticflow/internal/domain"
"droboticflow/internal/store"
"encoding/json"
"fmt"
"net/http"
"net/http/httptest"
"strconv"
"strings"
"sync"
"testing"
"time"
"go.mongodb.org/mongo-driver/bson"
)
// Enforce Mongo's document bound through the actual HTTP decision path.
type boundedReviewStore struct {
store.Store
largest int
}
func (s *boundedReviewStore) CompareAndSwapReviewOperation(ctx context.Context, op domain.ReviewOperation, version int) (bool, error) {
b, err := bson.Marshal(op)
if err != nil {
return false, err
}
if len(b) > s.largest {
s.largest = len(b)
}
if len(b) > 16*1024*1024 {
return false, fmt.Errorf("review operation exceeds BSON limit")
}
return s.Store.CompareAndSwapReviewOperation(ctx, op, version)
}
func TestReviewDecisionLargeHistoryPreserved(t *testing.T) {
f := decisionFixture(t)
item, _ := f.store.GetHumanItem(f.ctx, f.item.ID)
history := strings.Repeat("h", 7*1024*1024)
item.Subject.Payload["sliceResetHistory"] = history
f.store.UpsertHumanItem(f.ctx, *item)
version, headers := openReviewDraftSession(t, f)
wrapped := &boundedReviewStore{Store: f.store}
f.handler = NewHandler(wrapped, nil)
payload := map[string]any{"stage": "quality", "decision": "rejected", "reasonCodes": []string{"manual_review_reject"}, "problemSliceIds": []string{"left"}, "comment": "fix", "operationId": "large-history", "draftVersion": 0, "resultVersion": version}
r := reviewSessionRequest(f, http.MethodPost, "/api/plugins/annotation-qa/tasks/"+f.task.ID+"/reviews", f.reviewer, payload, headers)
if r.Code != 201 {
t.Fatalf("decision %d %s (largest %d)", r.Code, r.Body.String(), wrapped.largest)
}
after, _ := f.store.GetHumanItem(f.ctx, f.item.ID)
if after.Subject.Payload["sliceResetHistory"] != history {
t.Fatal("history changed")
}
if wrapped.largest > 8*1024*1024 {
t.Fatalf("duplicated evidence: %d", wrapped.largest)
}
if r.Body.Len() > 64*1024 {
t.Fatalf("bloated response: %d", r.Body.Len())
}
}
func TestReviewDecisionReceiptReplaysAfterQualityTaskLeavesReviewer(t *testing.T) {
f := reviewSessionFixture(t)
batch, _ := f.store.GetHumanBatch(f.ctx, f.item.BatchID)
batch.RequirePrePackageAcceptance = true
f.store.UpsertHumanBatch(f.ctx, *batch)
base := "/api/human-items/" + f.item.ID
r := f.request(http.MethodPost, base+"/review-session", f.reviewer, map[string]any{"action": "acquire", "pageId": "decision-page"})
if r.Code != 200 {
t.Fatalf("session %d %s", r.Code, r.Body.String())
}
var session struct {
ResultVersion string `json:"resultVersion"`
}
json.Unmarshal(r.Body.Bytes(), &session)
headers := map[string]string{"X-Review-Page": "decision-page", "X-Review-Generation": "1"}
input := map[string]any{"stage": "quality", "decision": "rejected", "comment": "请修正动作描述", "reasonCodes": []string{"manual_review_reject"}, "problemSliceIds": []string{"slice-1"}, "operationId": "quality-decision-1", "draftVersion": 0, "resultVersion": session.ResultVersion}
endpoint := "/api/plugins/annotation-qa/tasks/" + f.task.ID + "/reviews"
first := reviewSessionRequest(f, http.MethodPost, endpoint, f.reviewer, input, headers)
if first.Code != 201 {
t.Fatalf("first decision %d %s", first.Code, first.Body.String())
}
history := f.request(http.MethodGet, "/api/human-items?pool=reviewed&projectId="+f.task.ProjectID, f.reviewer, nil)
var historyBody struct {
Items []domain.HumanItemRecord `json:"items"`
}
_ = json.Unmarshal(history.Body.Bytes(), &historyBody)
if history.Code != 200 || len(historyBody.Items) != 1 || historyBody.Items[0].ID != f.item.ID {
t.Fatalf("completed decision missing from own history: %d %s", history.Code, history.Body.String())
}
again := reviewSessionRequest(f, http.MethodPost, endpoint, f.reviewer, input, headers)
if again.Code != 201 {
t.Fatalf("lost response replay %d %s", again.Code, again.Body.String())
}
status := f.request(http.MethodGet, base+"/review-operations/quality-decision-1", f.reviewer, nil)
if status.Code != 200 {
t.Fatalf("receipt %d %s", status.Code, status.Body.String())
}
var receipt struct {
Status string `json:"status"`
}
json.Unmarshal(status.Body.Bytes(), &receipt)
if receipt.Status != "completed" {
t.Fatalf("receipt not complete %s", status.Body.String())
}
detail := f.request(http.MethodGet, "/api/plugins/annotation-qa/tasks/"+f.task.ID, f.admin, nil)
var output struct {
Reviews []json.RawMessage `json:"reviews"`
HumanItem struct {
ReviewRound int `json:"reviewRound"`
} `json:"humanItem"`
}
json.Unmarshal(detail.Body.Bytes(), &output)
if len(output.Reviews) != 1 || output.HumanItem.ReviewRound != 2 {
t.Fatalf("duplicated formal effects %s", detail.Body.String())
}
input["comment"] = "different decision body"
conflict := reviewSessionRequest(f, http.MethodPost, endpoint, f.reviewer, input, headers)
if conflict.Code != 409 {
t.Fatalf("operation reused with changed body %d %s", conflict.Code, conflict.Body.String())
}
}
// These faults stop real public requests at persistence boundaries. Recreating
// the handler models a process restart while the durable store survives.
type interruptedReviewStore struct {
store.Store
failure string
fired bool
}
func (s *interruptedReviewStore) UpdateAnnotationTaskForReview(ctx context.Context, before, next domain.AnnotationTaskRecord) (bool, error) {
if s.failure == "before-task" && !s.fired {
s.fired = true
return false, fmt.Errorf("injected task write interruption")
}
return s.Store.UpdateAnnotationTaskForReview(ctx, before, next)
}
func (s *interruptedReviewStore) UpdateHumanItemForReview(ctx context.Context, next domain.HumanItemRecord, expected int) (bool, error) {
if s.failure == "before-second-source" && next.ID == "source-b" && !s.fired {
s.fired = true
return false, fmt.Errorf("injected aggregate source interruption")
}
ok, e := s.Store.UpdateHumanItemForReview(ctx, next, expected)
if s.failure == "after-human-write" && next.ReviewOperationID != "" && ok && e == nil && !s.fired {
s.fired = true
return false, fmt.Errorf("injected lost human write response")
}
return ok, e
}
func decisionFixture(t *testing.T) combinedDraftFixture {
f := qualityReviewDraftFixture(t)
batch, _ := f.store.GetHumanBatch(f.ctx, f.item.BatchID)
batch.RequirePrePackageAcceptance = true
f.store.UpsertHumanBatch(f.ctx, *batch)
return f
}
func TestReviewDecisionForwardRecoveryAfterPersistedEffects(t *testing.T) {
for _, failure := range []string{"before-task", "after-human-write"} {
t.Run(failure, func(t *testing.T) {
f := decisionFixture(t)
version, headers := openReviewDraftSession(t, f)
wrapped := &interruptedReviewStore{Store: f.store, failure: failure}
f.handler = NewHandler(wrapped, nil)
payload := map[string]any{"stage": "quality", "decision": "rejected", "reasonCodes": []string{"manual_review_reject"}, "problemSliceIds": []string{"left"}, "comment": "边界需要修正", "operationId": "recover", "draftVersion": 0, "resultVersion": version}
first := reviewSessionRequest(f, http.MethodPost, "/api/plugins/annotation-qa/tasks/"+f.task.ID+"/reviews", f.reviewer, payload, headers)
if first.Code != 202 || !strings.Contains(first.Body.String(), `"status":"applying"`) {
t.Fatalf("interruption %d %s", first.Code, first.Body.String())
}
// The original reviewer still sees the receipt even if the item already moved.
receipt := f.request(http.MethodGet, "/api/human-items/"+f.item.ID+"/review-operations/recover", f.reviewer, nil)
if receipt.Code != 200 {
t.Fatalf("pending receipt %d %s", receipt.Code, receipt.Body.String())
}
f.handler = NewHandler(f.store, nil)
retry := f.request(http.MethodPost, "/api/human-items/"+f.item.ID+"/review-operations/recover/reconcile", f.reviewer, nil)
if retry.Code != 201 {
t.Fatalf("reconcile %d %s", retry.Code, retry.Body.String())
}
detail := f.request(http.MethodGet, "/api/plugins/annotation-qa/tasks/"+f.task.ID, f.admin, nil)
var state struct {
Reviews []domain.AnnotationReviewRecord `json:"reviews"`
HumanItem domain.HumanItemRecord `json:"humanItem"`
}
json.Unmarshal(detail.Body.Bytes(), &state)
if len(state.Reviews) != 1 || state.HumanItem.ReviewRound != 2 || state.HumanItem.CurrentStageID != "annotation_combined" {
t.Fatalf("duplicated effects %s", detail.Body.String())
}
done := f.request(http.MethodGet, "/api/human-items/"+f.item.ID+"/review-operations/recover", f.reviewer, nil)
if done.Code != 200 || !strings.Contains(done.Body.String(), `"status":"completed"`) {
t.Fatalf("receipt not completed %s", done.Body.String())
}
})
}
}
func TestReviewDecisionRequiresSavedDraftAndStableContext(t *testing.T) {
f := decisionFixture(t)
version, headers := openReviewDraftSession(t, f)
base := "/api/human-items/" + f.item.ID
save := reviewSessionRequest(f, http.MethodPut, base+"/review-draft", f.reviewer, map[string]any{"version": 0, "resultVersion": version, "operationId": "save", "problems": []map[string]any{{"id": "one", "scope": "slice", "sliceId": "left", "text": "切片问题", "atSeconds": 1}}}, headers)
if save.Code != 200 {
t.Fatalf("save %d %s", save.Code, save.Body.String())
}
endpoint := "/api/plugins/annotation-qa/tasks/" + f.task.ID + "/reviews"
for _, input := range []map[string]any{
{"stage": "quality", "decision": "approved"},
{"stage": "quality", "decision": "approved", "operationId": "old-draft", "draftVersion": 0, "resultVersion": version},
{"stage": "quality", "decision": "approved", "operationId": "problem", "draftVersion": 1, "resultVersion": version},
{"stage": "quality", "decision": "approved", "operationId": "old-result", "draftVersion": 1, "resultVersion": "old"},
} {
r := reviewSessionRequest(f, http.MethodPost, endpoint, f.reviewer, input, headers)
if r.Code != 400 && r.Code != 409 {
t.Fatalf("guard bypass %d %s", r.Code, r.Body.String())
}
}
draft := f.request(http.MethodGet, base+"/review-draft", f.reviewer, nil)
if draft.Code != 200 || !strings.Contains(draft.Body.String(), "切片问题") {
t.Fatalf("failed decision lost draft %s", draft.Body.String())
}
detail := f.request(http.MethodGet, "/api/plugins/annotation-qa/tasks/"+f.task.ID, f.admin, nil)
var state struct {
Reviews []domain.AnnotationReviewRecord `json:"reviews"`
}
json.Unmarshal(detail.Body.Bytes(), &state)
if len(state.Reviews) != 0 {
t.Fatal("validation wrote a formal decision")
}
}
func TestReviewDecisionAggregateRecoveryDoesNotReopenSourceTwice(t *testing.T) {
f := acceptanceReviewDraftFixture(t)
batch, _ := f.store.GetHumanBatch(f.ctx, f.item.BatchID)
sourceBatch := *batch
sourceBatch.ID = "source-batch"
sourceBatch.Stages = domain.DefaultFanyuV58HumanStages()
sourceBatch.RequirePrePackageAcceptance = true
sourceBatch.ProcessingProfile = domain.ProcessingProfileRawHuman
f.store.UpsertHumanBatch(f.ctx, sourceBatch)
batch.SourceBatchID = sourceBatch.ID
batch.ProcessingProfile = domain.ProcessingProfileRawHuman
f.store.UpsertHumanBatch(f.ctx, *batch)
for _, id := range []string{"source-a", "source-b"} {
source := f.item
source.ID = id
source.BatchID = sourceBatch.ID
source.CurrentStageID = domain.FanyuV58StageQualityReview
source.Status = domain.HumanItemAccepted
source.ReviewRound = 4
source.Version = 10
source.AssignedUserID = ""
source.LegacyTaskID = "task-" + id
source.AcceptedAt = nowISO()
f.store.UpsertHumanItem(f.ctx, source)
task := f.task
task.ID = source.LegacyTaskID
task.Status = domain.AnnotationTaskStatusAccepted
f.store.UpsertAnnotationTask(f.ctx, task)
}
version, headers := openReviewDraftSession(t, f)
f.handler = NewHandler(&interruptedReviewStore{Store: f.store, failure: "before-second-source"}, nil)
payload := map[string]any{"version": f.item.Version, "decision": "rejected", "reasonCodes": []string{"batch_problem"}, "comment": "聚合任务需重新核对", "operationId": "aggregate-recover", "draftVersion": 0, "resultVersion": version}
endpoint := "/api/human-items/" + f.item.ID
first := reviewSessionRequest(f, http.MethodPost, endpoint+"/decisions", f.reviewer, payload, headers)
if first.Code != 202 {
t.Fatalf("interruption %d %s", first.Code, first.Body.String())
}
f.handler = NewHandler(f.store, nil)
retry := f.request(http.MethodPost, endpoint+"/review-operations/aggregate-recover/reconcile", f.reviewer, nil)
if retry.Code != 200 {
t.Fatalf("reconcile %d %s", retry.Code, retry.Body.String())
}
for _, id := range []string{"source-a", "source-b"} {
read := f.request(http.MethodGet, "/api/human-items/"+id, f.admin, nil)
var state struct {
Item domain.HumanItemRecord `json:"item"`
}
json.Unmarshal(read.Body.Bytes(), &state)
if read.Code != 200 || state.Item.ReviewRound != 5 || state.Item.Status != domain.HumanItemSubmitted {
t.Fatalf("wrong reroute %s", read.Body.String())
}
}
repeat := reviewSessionRequest(f, http.MethodPost, endpoint+"/decisions", f.reviewer, payload, headers)
if repeat.Code != 200 {
t.Fatalf("replay %d %s", repeat.Code, repeat.Body.String())
}
receipt := f.request(http.MethodGet, endpoint+"/review-operations/aggregate-recover", f.reviewer, nil)
if !strings.Contains(receipt.Body.String(), `"source-a","source-b"`) {
t.Fatalf("missing actual aggregate scope %s", receipt.Body.String())
}
}
type interruptedPreparationStore struct {
store.Store
offline bool
}
func (s *interruptedPreparationStore) CompareAndSwapReviewSession(ctx context.Context, next domain.ReviewSession, expected int) (bool, error) {
ok, e := s.Store.CompareAndSwapReviewSession(ctx, next, expected)
if strings.HasPrefix(next.WriteID, "review-operation-") && ok && e == nil {
s.offline = true
return false, fmt.Errorf("process lost storage after durable fence")
}
return ok, e
}
func (s *interruptedPreparationStore) GetReviewOperation(ctx context.Context, id string) (*domain.ReviewOperation, error) {
if s.offline {
return nil, fmt.Errorf("storage connection unavailable")
}
return s.Store.GetReviewOperation(ctx, id)
}
func TestReviewDecisionPreparedIntentRecoversOrphanedWriteFence(t *testing.T) {
f := decisionFixture(t)
version, headers := openReviewDraftSession(t, f)
f.handler = NewHandler(&interruptedPreparationStore{Store: f.store}, nil)
payload := map[string]any{"stage": "quality", "decision": "rejected", "comment": "需要修正", "reasonCodes": []string{"manual_review_reject"}, "problemSliceIds": []string{"left"}, "operationId": "prepare-crash", "draftVersion": 0, "resultVersion": version}
first := reviewSessionRequest(f, http.MethodPost, "/api/plugins/annotation-qa/tasks/"+f.task.ID+"/reviews", f.reviewer, payload, headers)
if first.Code != 500 {
t.Fatalf("expected interrupted preparation %d %s", first.Code, first.Body.String())
}
f.handler = NewHandler(f.store, nil)
base := "/api/human-items/" + f.item.ID
takeover := f.request(http.MethodPost, base+"/review-session", f.reviewer, map[string]any{"action": "takeover", "pageId": "another-page"})
if takeover.Code != 409 {
t.Fatalf("orphaned intent lost fence %d %s", takeover.Code, takeover.Body.String())
}
recovered := f.request(http.MethodPost, base+"/review-operations/prepare-crash/reconcile", f.reviewer, nil)
if recovered.Code != 201 {
t.Fatalf("prepared recovery %d %s", recovered.Code, recovered.Body.String())
}
receipt := f.request(http.MethodGet, base+"/review-operations/prepare-crash", f.reviewer, nil)
if !strings.Contains(receipt.Body.String(), `"status":"completed"`) {
t.Fatalf("orphan remained %s", receipt.Body.String())
}
}
func TestReviewDecisionReusesExistingStageAttemptIdentity(t *testing.T) {
f := decisionFixture(t)
f.store.UpsertHumanStageAttempt(f.ctx, domain.HumanStageAttemptRecord{ID: "existing-claimed-attempt", OrganizationID: f.item.OrganizationID, ItemID: f.item.ID, StageID: f.item.CurrentStageID, Round: f.item.ReviewRound, Status: domain.HumanItemClaimed, AssigneeUserID: f.reviewer.ID})
version, headers := openReviewDraftSession(t, f)
input := map[string]any{"stage": "quality", "decision": "rejected", "comment": "需要修正", "reasonCodes": []string{"manual_review_reject"}, "problemSliceIds": []string{"left"}, "operationId": "existing-attempt", "draftVersion": 0, "resultVersion": version}
result := reviewSessionRequest(f, http.MethodPost, "/api/plugins/annotation-qa/tasks/"+f.task.ID+"/reviews", f.reviewer, input, headers)
if result.Code != 201 {
t.Fatalf("decision %d %s", result.Code, result.Body.String())
}
read := f.request(http.MethodGet, "/api/human-items/"+f.item.ID, f.admin, nil)
var detail struct {
Attempts []domain.HumanStageAttemptRecord `json:"attempts"`
Events []domain.HumanEventRecord `json:"events"`
}
json.Unmarshal(read.Body.Bytes(), &detail)
matched := 0
for _, a := range detail.Attempts {
if a.StageID == f.item.CurrentStageID && a.Round == f.item.ReviewRound {
matched++
if a.ID != "existing-claimed-attempt" || a.Decision != domain.HumanDecisionRejected {
t.Fatalf("attempt identity not reused: %+v", a)
}
}
}
if matched != 1 {
t.Fatalf("duplicate stage attempts: %+v", detail.Attempts)
}
}
type racedDecisionFenceStore struct {
store.Store
arrived chan struct{}
resume chan struct{}
once sync.Once
}
func (s *racedDecisionFenceStore) CompareAndSwapReviewSession(ctx context.Context, next domain.ReviewSession, expected int) (bool, error) {
op, _ := s.Store.GetReviewOperation(ctx, next.WriteID)
if strings.HasPrefix(next.WriteID, "review-operation-") && op != nil && !strings.HasSuffix(op.Kind, "_draft") {
s.once.Do(func() { close(s.arrived); <-s.resume })
}
return s.Store.CompareAndSwapReviewSession(ctx, next, expected)
}
func TestReviewDecisionRechecksDraftAfterTakingWriteFence(t *testing.T) {
f := decisionFixture(t)
version, headers := openReviewDraftSession(t, f)
wrapped := &racedDecisionFenceStore{Store: f.store, arrived: make(chan struct{}), resume: make(chan struct{})}
f.handler = NewHandler(wrapped, nil)
decided := make(chan *httptest.ResponseRecorder, 1)
go func() {
decided <- reviewSessionRequest(f, http.MethodPost, "/api/plugins/annotation-qa/tasks/"+f.task.ID+"/reviews", f.reviewer, map[string]any{"stage": "quality", "decision": "approved", "operationId": "race-decision", "draftVersion": 0, "resultVersion": version}, headers)
}()
select {
case <-wrapped.arrived:
case <-time.After(3 * time.Second):
t.Fatal("decision did not reach fence")
}
save := reviewSessionRequest(f, http.MethodPut, "/api/human-items/"+f.item.ID+"/review-draft", f.reviewer, map[string]any{"version": 0, "resultVersion": version, "operationId": "racing-save", "problems": []map[string]any{{"id": "late-problem", "scope": "slice", "sliceId": "left", "text": "确认前新增的问题", "atSeconds": 1}}}, headers)
close(wrapped.resume)
if save.Code != 200 {
t.Fatalf("concurrent draft %d %s", save.Code, save.Body.String())
}
result := <-decided
if result.Code != 409 || !strings.Contains(result.Body.String(), "review_draft_conflict") {
t.Fatalf("stale approval accepted %d %s", result.Code, result.Body.String())
}
read := f.request(http.MethodGet, "/api/plugins/annotation-qa/tasks/"+f.task.ID, f.admin, nil)
var detail struct {
Reviews []domain.AnnotationReviewRecord `json:"reviews"`
}
json.Unmarshal(read.Body.Bytes(), &detail)
if len(detail.Reviews) != 0 {
t.Fatal("stale approval wrote a review")
}
}
func TestReviewDecisionLegacyWorkflowsKeepOriginalPayloads(t *testing.T) {
for _, stage := range []string{"quality", "acceptance"} {
for _, decision := range []string{"approved", "rejected"} {
t.Run(stage+"-"+decision, func(t *testing.T) {
f := qualityReviewDraftFixture(t)
if stage == "quality" {
batch, _ := f.store.GetHumanBatch(f.ctx, f.item.BatchID)
batch.Stages = domain.DefaultFanyuV5HumanStages()
batch.RequirePrePackageAcceptance = true
f.store.UpsertHumanBatch(f.ctx, *batch)
f.item.CurrentStageID = domain.FanyuV5StageSemanticReview
f.store.UpsertHumanItem(f.ctx, f.item)
f.task.TemplateVersion = 5
f.store.UpsertAnnotationTask(f.ctx, f.task)
} else {
f = acceptanceReviewDraftFixture(t)
batch, _ := f.store.GetHumanBatch(f.ctx, f.item.BatchID)
source := *batch
source.ID = "legacy-four-stage-source"
source.Stages = domain.DefaultFanyuV5HumanStages()
f.store.UpsertHumanBatch(f.ctx, source)
batch.SourceBatchID = source.ID
f.store.UpsertHumanBatch(f.ctx, *batch)
}
base := "/api/human-items/" + f.item.ID
session := f.request(http.MethodPost, base+"/review-session", f.reviewer, map[string]any{"action": "takeover", "pageId": "legacy-page"})
if session.Code != 200 || !strings.Contains(session.Body.String(), `"decisionProtocol":"legacy"`) {
t.Fatalf("legacy capability %d %s", session.Code, session.Body.String())
}
var lease struct {
Generation int `json:"generation"`
}
json.Unmarshal(session.Body.Bytes(), &lease)
headers := map[string]string{"X-Review-Page": "legacy-page", "X-Review-Generation": strconv.Itoa(lease.Generation)}
body := map[string]any{"decision": decision, "version": f.item.Version}
endpoint := base + "/decisions"
expected := 200
if stage == "quality" {
body["stage"] = "quality"
endpoint = "/api/plugins/annotation-qa/tasks/" + f.task.ID + "/reviews"
expected = 201
}
if decision == "rejected" {
body["comment"] = "沿用旧流程退回"
body["reasonCodes"] = []string{"manual_review_reject"}
}
result := reviewSessionRequest(f, http.MethodPost, endpoint, f.reviewer, body, headers)
if result.Code != expected {
t.Fatalf("legacy payload rejected %d %s", result.Code, result.Body.String())
}
})
}
}
}