* fix(issueops): enforce the close guards on every close leg The template read-only guard, the pin guard and the assignee authority fence (be-035) lived only in cmd/bd (validateIssueClosable), so a close through bd serve, issues:batchClose, a batch:apply close item or a library caller of Lifecycle.Close / BatchCloser / BatchApplier closed what bd close refused. They now run inside the close's own transaction in CloseIssueCheckedInTx (enforceCloseGuardsInTx), the body every checked close shares (dolt, embedded, uow, and the server behind httpapi), for a target that is not already closed: - a template refuses with *issueops.TemplateReadOnlyError (no bypass); - unless Force (CloseRequest, CloseBatchRequest, CloseItem) is set, a pinned issue refuses with *issueops.PinnedError and another actor's bead with *issueops.CloseNotAssigneeError (matches ErrNotOwner). Wire: 409 template_read_only, issue_pinned and not_assignee (holder in `assignee`, also on a batch-close outcome); the client rebuilds the typed errors. The decision is one exported pure rule over the pre-image, issueops.CheckClosable (internal/storage/issueops), which the in-tx guard calls; bd close's direct and proxied preflights call it too, ahead of gate satisfaction under the same already-closed skip, so bd close output, refusal order and exit codes are unchanged (validateIssueClosable is gone). bd close --if-revision now applies the guards too. Conformance: RunLifecycleCloseEnforcesTheCloseGuards, RunBatchCloserItemsAnswerToTheCloseGuards and RunBatchApplyCloseItemsAnswerToTheCloseGuards on dolt, embedded, uow and http, plus handler mapping tests, a CheckClosable table test, and a cmd/bd test pinning that the guards outrank gate satisfaction. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(httpclient): send force on the raw close; scope the close guards Review fixes for #7425 (adopt-pr bd-0h0ao4, iterations 1 and 2). The raw close keeps parity over http. httpclient.Store.CloseIssue maps the off-role raw close onto the role's closeIssue op and sent force=false. With the guards in the role, a pinned or claimed target then refused (409 issue_pinned / not_assignee) on http only: dolt, embedded and proxied run the raw close as issueops.CloseIssueInTx, which applies neither the guards nor close policy. The molecule auto-close, `bd gate resolve`, `bd todo done` and `bd human dismiss` all make that call, and its signature carries no force a caller could pass. It now sends force. Over http that also stops applying close policy to the raw close, which it did at base and no other backend does; parity is the point, so that goes too. The template guard has no bypass on the wire, so a template still refuses the raw close over http where the other backends close it; no raw caller is known to close one. TestServedRawCloseKeepsParityWithTheOtherBackends closes both pin spellings, a held bead and a parent with an open child through Store.CloseIssue and requires the template refusal; with force back to false it fails on 409 issue_pinned. The close guards stay on the close verbs. A status update that crosses into the done category (`bd update -s closed`, PATCH, a batchApply update item) still answers to close policy only, so it closes a pinned issue or another actor's bead on every backend, as it did before this PR. Guarding it changes what the update legs admit and needs its own refusal mapping on PATCH and batchApply, so it is left for a follow-up; the update.go and domain/db comments now say the exclusion is deliberate. CHANGELOG: the entry moves from Fixed to Changed as BREAKING, is scoped to the close operations, names the two paths the guards do not cover, and adds a Migration line (send force or reclaim; templates are never closable). Docs: the OpBatchCloseIssues item codes, the CloseIssueChecked and CloseIssueOptions.Force docs (storage, dolt, embeddeddolt), the oracle-a scenario strings that named the retired validateIssueClosable, and the TestCloseCheckOne_CloseGuardsOutrankGateSatisfaction doc, which claimed a proxied route it does not drive. Iteration 2: the wire contract says what force waives. The OpenAPI `force` members of CloseIssueRequest, BatchCloseRequest and ApplyCloseItem said force bypasses close policy "and nothing else"; it also waives the pin and the assignee guard, and never the template guard. The batchClose "only two answers" paragraph now says the same, and types.gen.go is regenerated (`make api-gen`). "Close guards" names the close operations instead of "every route to a close" and adds that a status update into the done category is not one, and the PATCH done-crossing paragraph says a patch is never refused `issue_pinned` or `not_assignee`. The conformance comments that quoted the old Force sentence (batch_apply_contract.go, batch_closer_contract.go, lifecycle_close_reopen_contract.go) quote the current docs, and the batch_apply failure message no longer says Force does nothing else. CHANGELOG: a `close` line of `bd batch` is named among the raw closes, and "a template is never closable" becomes "the close operations never close a template, forced or not". The storage interface CloseIssue gains a doc that states its HTTP exception. TestCloseGuardRefusalsPrintTheGuardSentenceOnEveryRoute pins the sentence `bd close` prints for each guard (template, pin, assignee) through each printer (closeDirectRefusal, closeDirectTypedRefusal, closeProxiedRefusal, closeProxiedTypedRefusal), with the refusal bare, wrapped by the use case and the SQL repository, or inside a served problem envelope. One pinned refusal also goes through closeProxiedOutcomes and closeProxiedFailures, where the stderr line and the `--json` error field must both be the sentence. Six overlay mutants fail it: closeGuardRefusal recognizing no guard, or not the pin, and each of the four printers skipping its call to closeGuardRefusal. Not done here: a CLI test that `--if-revision` exits 1 on a guard refusal, not ExitGuardMismatch. External PR #7372 carries per-id fence tests for that route (6 of 7 pass at this head); they are better absorbed with credit than rewritten. Agent-Signature: claude-code-claude-opus-5-5-max on behalf of Gas City Adopt-PR Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
387 lines
16 KiB
Go
387 lines
16 KiB
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"strings"
|
|
"testing"
|
|
|
|
"github.com/steveyegge/beads/internal/storage"
|
|
"github.com/steveyegge/beads/internal/types"
|
|
"github.com/steveyegge/beads/issueops"
|
|
)
|
|
|
|
// assertCloseFailedErrorIsTyped checks one failed[].error entry against the
|
|
// route-parity contract both close routes owe a --json consumer: the field
|
|
// carries the typed error, while the line a person reads keeps the --force hint.
|
|
//
|
|
// The two integration suites share it, which is the point — a contract that is
|
|
// supposed to be identical per route should be asserted by identical code. It is
|
|
// written against the RELATIONSHIP between the two spellings rather than a
|
|
// transcribed sentence so neither suite has to hardcode how the engine renders a
|
|
// blocker list: closeDirectRefusal and closeProxiedRefusal both produce exactly
|
|
// the typed error plus the hint, so the typed error must appear on stderr with
|
|
// the hint appended and must not contain the hint itself.
|
|
//
|
|
// Lives in an untagged file so it is compiled in the CGO_ENABLED=0 lane too,
|
|
// alongside the pins below; its callers are the cgo-gated suites.
|
|
func assertCloseFailedErrorIsTyped(t *testing.T, failedError, stderr string) {
|
|
t.Helper()
|
|
const hint = " (use --force to override)"
|
|
if !strings.HasPrefix(failedError, "cannot close blocked issue:") {
|
|
t.Errorf("failed[].error = %q, want the engine's typed ErrCloseBlocked vocabulary: both routes must spell one refusal one way",
|
|
failedError)
|
|
}
|
|
if strings.Contains(failedError, hint) {
|
|
t.Errorf("failed[].error = %q carries the --force hint; that decoration is advice for a human reader and belongs on the stderr line only",
|
|
failedError)
|
|
}
|
|
if want := failedError + hint; !strings.Contains(stderr, want) {
|
|
t.Errorf("stderr is missing the decorated refusal %q; the hint must still reach the person reading it\nstderr:\n%s",
|
|
want, stderr)
|
|
}
|
|
}
|
|
|
|
// The route-parity contract for the machine-readable half of the partial-failure
|
|
// report: `failed[].error` carries the TYPED error on both routes, and the
|
|
// decorated display line stays on stderr where a human reads it.
|
|
//
|
|
// The direct route already splits the two (close.go records res.Err.Error() in
|
|
// closeIDFailure while printing closeDirectRefusal's decorated line). The proxied
|
|
// route used to copy pre.errors — the display line — into the JSON field, so the
|
|
// same blocked-id refusal answered "cannot close blocked issue: X is blocked by
|
|
// [Y]" embedded and "... (use --force to override)" proxied. These live here
|
|
// rather than in the proxied integration suite because nothing in the split needs
|
|
// a server: the refusal slots are filled by closeProxiedOutcomes and read by
|
|
// closeProxiedFailures, both pure.
|
|
func TestCloseProxiedFailuresRecordTheTypedErrorNotTheDisplayLine(t *testing.T) {
|
|
blockedErr := fmt.Errorf("%w: pb-2 is blocked by [pb-1]", storage.ErrCloseBlocked)
|
|
|
|
// arg 0 closes, arg 1 is refused by the engine.
|
|
args := []string{"pb-3", "pb-2"}
|
|
pre := closeProxiedPreflight{
|
|
items: []issueops.BatchCloseItem{
|
|
{IssueID: "pb-3", Reason: "done"},
|
|
{IssueID: "pb-2", Reason: "done"},
|
|
},
|
|
itemArgs: []int{0, 1},
|
|
before: map[string]*types.Issue{"pb-3": {ID: "pb-3"}},
|
|
errors: make([]string, len(args)),
|
|
failureErrors: make([]string, len(args)),
|
|
}
|
|
outcomes, _ := closeProxiedOutcomes(&pre, issueops.CloseBatchResult{
|
|
Outcomes: []issueops.CloseOutcome{
|
|
{IssueID: "pb-3", Issue: &types.Issue{ID: "pb-3"}, Changed: true},
|
|
{IssueID: "pb-2", Err: blockedErr},
|
|
},
|
|
})
|
|
if len(outcomes) != 1 || outcomes[0].id != "pb-3" {
|
|
t.Fatalf("outcomes = %+v, want only the survivor pb-3", outcomes)
|
|
}
|
|
|
|
failures := closeProxiedFailures(&pre, args)
|
|
if len(failures) != 1 || failures[0].ID != "pb-2" {
|
|
t.Fatalf("failures = %+v, want exactly the refused id pb-2", failures)
|
|
}
|
|
|
|
// The machine field is the typed error, byte for byte.
|
|
if failures[0].Error != blockedErr.Error() {
|
|
t.Errorf("failed[].error = %q, want the typed error %q: a --json consumer keying off this field must see the same string on both routes",
|
|
failures[0].Error, blockedErr.Error())
|
|
}
|
|
if strings.Contains(failures[0].Error, "use --force to override") {
|
|
t.Errorf("failed[].error = %q, must not carry the --force hint: that is advice for a human reader, and the direct route records res.Err.Error() here",
|
|
failures[0].Error)
|
|
}
|
|
|
|
// ...and the human line keeps the decoration. Without this half the fix
|
|
// could have passed by stripping the hint from stderr too, which is a
|
|
// different regression.
|
|
if want := closeProxiedRefusal("pb-2", blockedErr); pre.errors[1] != want {
|
|
t.Errorf("stderr line = %q, want the decorated refusal %q", pre.errors[1], want)
|
|
}
|
|
if !strings.Contains(pre.errors[1], "use --force to override") {
|
|
t.Errorf("stderr line = %q, want it to keep the --force hint for the person reading it", pre.errors[1])
|
|
}
|
|
}
|
|
|
|
// Every engine refusal class closeProxiedRefusal decorates, checked against the
|
|
// typed error it decorates. ErrCloseOpenChildren is in the table on purpose: it
|
|
// passes through undecorated, so it is the row that would still pass if the fix
|
|
// had been written as "special-case the blocked hint" instead of "record the
|
|
// typed error".
|
|
func TestCloseProxiedFailuresTypedErrorPerRefusalClass(t *testing.T) {
|
|
tests := []struct {
|
|
name string
|
|
err error
|
|
}{
|
|
{
|
|
name: "blocked gains the force hint on stderr",
|
|
err: fmt.Errorf("%w: rc-1 is blocked by [rc-9]", storage.ErrCloseBlocked),
|
|
},
|
|
{
|
|
name: "not found is rewritten on stderr",
|
|
err: fmt.Errorf("%w: rc-1", storage.ErrNotFound),
|
|
},
|
|
{
|
|
name: "default class is wrapped on stderr",
|
|
err: fmt.Errorf("dolt: connection reset"),
|
|
},
|
|
{
|
|
name: "open children passes through undecorated",
|
|
err: &storage.CloseOpenChildrenError{IssueID: "rc-1", OpenChildren: 2},
|
|
},
|
|
}
|
|
|
|
for _, tc := range tests {
|
|
t.Run(tc.name, func(t *testing.T) {
|
|
args := []string{"rc-1"}
|
|
pre := closeProxiedPreflight{
|
|
items: []issueops.BatchCloseItem{{IssueID: "rc-1", Reason: "done"}},
|
|
itemArgs: []int{0},
|
|
before: map[string]*types.Issue{},
|
|
errors: make([]string, len(args)),
|
|
failureErrors: make([]string, len(args)),
|
|
}
|
|
closeProxiedOutcomes(&pre, issueops.CloseBatchResult{
|
|
Outcomes: []issueops.CloseOutcome{{IssueID: "rc-1", Err: tc.err}},
|
|
})
|
|
|
|
failures := closeProxiedFailures(&pre, args)
|
|
if len(failures) != 1 {
|
|
t.Fatalf("failures = %+v, want one", failures)
|
|
}
|
|
if failures[0].Error != tc.err.Error() {
|
|
t.Errorf("failed[].error = %q, want the typed error %q", failures[0].Error, tc.err.Error())
|
|
}
|
|
if pre.errors[0] != closeProxiedRefusal("rc-1", tc.err) {
|
|
t.Errorf("stderr line = %q, want closeProxiedRefusal's spelling %q", pre.errors[0], closeProxiedRefusal("rc-1", tc.err))
|
|
}
|
|
})
|
|
}
|
|
}
|
|
|
|
// The second half of the route-parity contract, and the one the decoration fix
|
|
// alone does not deliver: a refusal that reached the proxied route arrives
|
|
// wrapped by the layers it travelled through, so even the undecorated typed
|
|
// error read differently per route until closeProxiedTypedRefusal unwrapped it.
|
|
//
|
|
// The wrapper strings here are transcribed from the two production sites named
|
|
// in that function's comment, and the "want" column is the byte-identical
|
|
// string the direct route records for the same refusal.
|
|
func TestCloseProxiedTypedRefusalUnwrapsTheRoleWrappers(t *testing.T) {
|
|
blocked := fmt.Errorf("%w: wr-1 is blocked by [wr-2]", storage.ErrCloseBlocked)
|
|
openChildren := &storage.CloseOpenChildrenError{IssueID: "wr-1", OpenChildren: 3}
|
|
unexpected := fmt.Errorf("dolt: connection reset")
|
|
|
|
// What the role actually hands back: db/issue.go wraps, then issue.go wraps.
|
|
roleWrapped := func(inner error) error {
|
|
return fmt.Errorf("close wr-1: %w", fmt.Errorf("db: IssueSQLRepository.CloseChecked wr-1: %w", inner))
|
|
}
|
|
|
|
tests := []struct {
|
|
name string
|
|
err error
|
|
want string
|
|
}{
|
|
{
|
|
name: "blocked, unwrapped",
|
|
err: blocked,
|
|
want: blocked.Error(),
|
|
},
|
|
{
|
|
name: "blocked, wrapped by the role",
|
|
err: roleWrapped(blocked),
|
|
want: blocked.Error(),
|
|
},
|
|
{
|
|
name: "open children, wrapped by the role",
|
|
err: roleWrapped(openChildren),
|
|
want: openChildren.Error(),
|
|
},
|
|
{
|
|
// No sentinel to converge on, and the chain is the only thing that
|
|
// says where the failure came from, so it is kept whole.
|
|
name: "unexpected error keeps its whole chain",
|
|
err: roleWrapped(unexpected),
|
|
want: "close wr-1: db: IssueSQLRepository.CloseChecked wr-1: dolt: connection reset",
|
|
},
|
|
}
|
|
|
|
for _, tc := range tests {
|
|
t.Run(tc.name, func(t *testing.T) {
|
|
if got := closeProxiedTypedRefusal(tc.err); got != tc.want {
|
|
t.Errorf("closeProxiedTypedRefusal = %q, want %q", got, tc.want)
|
|
}
|
|
})
|
|
}
|
|
|
|
// The walk must stop AT the refusal, not at the bare sentinel underneath
|
|
// it: unwrapping one link too far would drop the subject and leave every
|
|
// blocked id reporting the same reasonless sentence.
|
|
if got := closeProxiedTypedRefusal(roleWrapped(blocked)); got == storage.ErrCloseBlocked.Error() {
|
|
t.Errorf("closeProxiedTypedRefusal = %q, which is the bare sentinel: the id and its blockers were unwrapped away", got)
|
|
}
|
|
}
|
|
|
|
// A refusal decided by the CLI's own close policy has no separate display form,
|
|
// so both fields hold the one sentence closeProxiedCheckOne returned — and the
|
|
// failures still come back in the order the caller typed the ids, across a mix
|
|
// of policy and engine refusals. errors is what decides WHICH arguments failed,
|
|
// so a policy slot with an empty failureErrors twin would be a silent
|
|
// reason-less entry; this pins that it is not.
|
|
func TestCloseProxiedFailuresKeepPolicyRefusalsAndTypedOrder(t *testing.T) {
|
|
policyRefusal := "cannot close mx-1: gate not satisfied"
|
|
engineErr := fmt.Errorf("%w: mx-3 is blocked by [mx-9]", storage.ErrCloseBlocked)
|
|
|
|
// arg 0 refused by policy, arg 1 closes, arg 2 refused by the engine.
|
|
args := []string{"mx-1", "mx-2", "mx-3"}
|
|
pre := closeProxiedPreflight{
|
|
items: []issueops.BatchCloseItem{
|
|
{IssueID: "mx-2", Reason: "done"},
|
|
{IssueID: "mx-3", Reason: "done"},
|
|
},
|
|
itemArgs: []int{1, 2},
|
|
before: map[string]*types.Issue{"mx-2": {ID: "mx-2"}},
|
|
errors: make([]string, len(args)),
|
|
failureErrors: make([]string, len(args)),
|
|
}
|
|
// closeProxiedRunPreflight fills both slots for a policy refusal.
|
|
pre.errors[0] = policyRefusal
|
|
pre.failureErrors[0] = policyRefusal
|
|
|
|
closeProxiedOutcomes(&pre, issueops.CloseBatchResult{
|
|
Outcomes: []issueops.CloseOutcome{
|
|
{IssueID: "mx-2", Issue: &types.Issue{ID: "mx-2"}, Changed: true},
|
|
{IssueID: "mx-3", Err: engineErr},
|
|
},
|
|
})
|
|
|
|
failures := closeProxiedFailures(&pre, args)
|
|
want := []closeIDFailure{
|
|
{ID: "mx-1", Error: policyRefusal},
|
|
{ID: "mx-3", Error: engineErr.Error()},
|
|
}
|
|
if len(failures) != len(want) {
|
|
t.Fatalf("failures = %+v, want %+v", failures, want)
|
|
}
|
|
for i := range want {
|
|
if failures[i] != want[i] {
|
|
t.Errorf("failures[%d] = %+v, want %+v", i, failures[i], want[i])
|
|
}
|
|
}
|
|
|
|
// An entry never goes out reason-less. No production writer can reach this
|
|
// state — both fill the twin — but the degradation is defined rather than
|
|
// accidental, because an empty reason is the one answer a caller asking why
|
|
// an id failed cannot use.
|
|
pre.failureErrors[0] = ""
|
|
if got := closeProxiedFailures(&pre, args); got[0].Error != policyRefusal {
|
|
t.Errorf("failures[0].Error = %q, want the display line %q as the fallback", got[0].Error, policyRefusal)
|
|
}
|
|
}
|
|
|
|
// closeGuardServedEnvelope stands in for the problem envelope a served refusal
|
|
// arrives in (wire.ProblemError): a message of its own that never repeats the
|
|
// guard's sentence, with the typed refusal reachable only through Unwrap.
|
|
type closeGuardServedEnvelope struct{ inner error }
|
|
|
|
func (e closeGuardServedEnvelope) Error() string {
|
|
return "closeIssue: bd serve at http://127.0.0.1:1 answered 409 issue_pinned: this issue is pinned"
|
|
}
|
|
|
|
func (e closeGuardServedEnvelope) Unwrap() error { return e.inner }
|
|
|
|
// The close guards are the role's now, so they reach the CLI as typed refusals
|
|
// — and the line a person reads, and the failed[].error a --json consumer
|
|
// reads, must still be the sentence `bd close` printed when they were a CLI
|
|
// pre-read: on both routes, and however far the refusal traveled. Each guard's
|
|
// message already names its subject and its --force hint, so every printer
|
|
// hands it back BARE, with no "Error closing <id>:" prefix and no second hint.
|
|
//
|
|
// The "want" column is transcribed from the pre-read's validators
|
|
// (validation.NotTemplate, NotPinned, AssigneeMatches before the move), so the
|
|
// sentences themselves are pinned, not only their relationship to the typed
|
|
// errors. The bare rows catch the decorating printers; the wrapped rows are
|
|
// the ones that catch the typed printers, which would otherwise hand back the
|
|
// whole chain.
|
|
func TestCloseGuardRefusalsPrintTheGuardSentenceOnEveryRoute(t *testing.T) {
|
|
guards := []struct {
|
|
name string
|
|
err error
|
|
want string
|
|
}{
|
|
{
|
|
name: "template",
|
|
err: &issueops.TemplateReadOnlyError{IssueID: "gr-1"},
|
|
want: "cannot modify template gr-1: templates are read-only; use 'bd mol pour' to create a work item",
|
|
},
|
|
{
|
|
name: "pinned",
|
|
err: &issueops.PinnedError{IssueID: "gr-1"},
|
|
want: "cannot modify pinned issue gr-1 (use --force to override)",
|
|
},
|
|
{
|
|
name: "not assignee",
|
|
err: &issueops.CloseNotAssigneeError{IssueID: "gr-1", Assignee: "alice", Actor: "bob"},
|
|
want: `cannot close gr-1: assignee is "alice", actor is "bob"; reclaim or use --force to override`,
|
|
},
|
|
}
|
|
// How the refusal reaches the printer: as the engine minted it (the direct
|
|
// route), wrapped by the use case and the SQL repository (the proxied route;
|
|
// see TestCloseProxiedTypedRefusalUnwrapsTheRoleWrappers), or inside a
|
|
// served problem envelope.
|
|
travels := []struct {
|
|
name string
|
|
wrap func(error) error
|
|
}{
|
|
{name: "bare", wrap: func(err error) error { return err }},
|
|
{name: "wrapped by the role", wrap: func(err error) error {
|
|
return fmt.Errorf("close gr-1: %w", fmt.Errorf("db: IssueSQLRepository.CloseChecked gr-1: %w", err))
|
|
}},
|
|
{name: "in a served envelope", wrap: func(err error) error { return closeGuardServedEnvelope{inner: err} }},
|
|
}
|
|
printers := []struct {
|
|
name string
|
|
print func(error) string
|
|
}{
|
|
{name: "closeDirectRefusal", print: func(err error) string { return closeDirectRefusal("gr-1", err) }},
|
|
{name: "closeDirectTypedRefusal", print: closeDirectTypedRefusal},
|
|
{name: "closeProxiedRefusal", print: func(err error) string { return closeProxiedRefusal("gr-1", err) }},
|
|
{name: "closeProxiedTypedRefusal", print: closeProxiedTypedRefusal},
|
|
}
|
|
|
|
for _, g := range guards {
|
|
for _, tr := range travels {
|
|
for _, p := range printers {
|
|
t.Run(g.name+"/"+tr.name+"/"+p.name, func(t *testing.T) {
|
|
if got := p.print(tr.wrap(g.err)); got != g.want {
|
|
t.Errorf("%s = %q, want the guard's own sentence %q", p.name, got, g.want)
|
|
}
|
|
})
|
|
}
|
|
}
|
|
}
|
|
|
|
// And through the proxied route's own bookkeeping, which is where the two
|
|
// printers meet: the stderr line and failed[].error are the same sentence,
|
|
// because the hint a guard needs is already in it.
|
|
pinned := guards[1]
|
|
args := []string{"gr-1"}
|
|
pre := closeProxiedPreflight{
|
|
items: []issueops.BatchCloseItem{{IssueID: "gr-1", Reason: "done"}},
|
|
itemArgs: []int{0},
|
|
before: map[string]*types.Issue{},
|
|
errors: make([]string, len(args)),
|
|
failureErrors: make([]string, len(args)),
|
|
}
|
|
closeProxiedOutcomes(&pre, issueops.CloseBatchResult{
|
|
Outcomes: []issueops.CloseOutcome{{IssueID: "gr-1", Err: travels[1].wrap(pinned.err)}},
|
|
})
|
|
failures := closeProxiedFailures(&pre, args)
|
|
if len(failures) != 1 || failures[0].Error != pinned.want {
|
|
t.Errorf("failures = %+v, want one entry whose error is %q", failures, pinned.want)
|
|
}
|
|
if pre.errors[0] != pinned.want {
|
|
t.Errorf("stderr line = %q, want %q", pre.errors[0], pinned.want)
|
|
}
|
|
}
|