diff --git a/cmd/backport-batch/effects_test.go b/cmd/backport-batch/effects_test.go index f96f5a596..9dfe0de95 100644 --- a/cmd/backport-batch/effects_test.go +++ b/cmd/backport-batch/effects_test.go @@ -53,7 +53,7 @@ func emptyBatch(f *fixture, gh *fakeGH, body string) *foldWorld { // and every check of the batch's shape takes the old name as the same file: // verify, a hand fold, and a rebuild by --defer. func TestRenamePickThroughFoldAndVerify(t *testing.T) { - f, mc5 := renameWorld(t) + f, _ := renameWorld(t) f.pr(6, "fix(app): six", "", map[string]string{"app/six.txt": "6\n"}) gh := &fakeGH{} head := openBatch(t, f, gh) @@ -74,7 +74,7 @@ func TestRenamePickThroughFoldAndVerify(t *testing.T) { t.Errorf("verify after the rebuild = %d\n%s\n%s", code, out, stderr) } - f, mc5 = renameWorld(t) + f, mc5 := renameWorld(t) w := emptyBatch(f, &fakeGH{}, "") pick := w.pick(w.head, f.git("rev-parse", mc5+"^2"), map[string]string{"app/old.txt": strings.Replace(appFile, "three", "THREE", 1)}) fold := w.merge(w.head, pick, "fix(app): fix the app file (#5)\n\n"+batchTrailer+": "+mc5) diff --git a/cmd/backport-batch/notify.go b/cmd/backport-batch/notify.go index e9ee23234..b2a8f7c18 100644 --- a/cmd/backport-batch/notify.go +++ b/cmd/backport-batch/notify.go @@ -102,10 +102,10 @@ func (a *app) notify(args []string) int { var conflicts, waiting []int after := map[int][]int{} for n, e := range deferred { - switch place := placement(deferred, n, map[int]bool{}); { - case place == "workflow": + switch placement(deferred, n, map[int]bool{}) { + case "workflow": waiting = append(waiting, n) - case place == "conflict": + case "conflict": conflicts = append(conflicts, n) } if len(e.Needs) > 0 { @@ -259,10 +259,10 @@ func placement(deferred map[int]deferredEntry, n int, seen map[int]bool) string seen[n] = true place := "" for _, f := range e.Needs { - switch p := placement(deferred, f, seen); { - case p == "workflow": + switch p := placement(deferred, f, seen); p { + case "workflow": return p - case p == "conflict": + case "conflict": place = p } } diff --git a/cmd/backport-batch/report.go b/cmd/backport-batch/report.go index fbfc4d569..27fd8860c 100644 --- a/cmd/backport-batch/report.go +++ b/cmd/backport-batch/report.go @@ -780,8 +780,8 @@ func (a *app) printReport(pr *pullRequest, s storedReport, inBody *storedReport, } for _, e := range d.Primary.Parked { text := "parked: " - switch { - case e.Kind == parkPartial: + switch e.Kind { + case parkPartial: text += "only part of it applies, it would leave " + strings.Join(e.Files, ", ") + " without effect" default: var needs []string diff --git a/internal/backupcontroller/cnpgstrategy_controller_test.go b/internal/backupcontroller/cnpgstrategy_controller_test.go index 5cd990f18..d88408100 100644 --- a/internal/backupcontroller/cnpgstrategy_controller_test.go +++ b/internal/backupcontroller/cnpgstrategy_controller_test.go @@ -2830,7 +2830,7 @@ func TestReconcileCNPG_ObjectStoreApplyRecovers(t *testing.T) { } failing = false - j, _ = f.pass() + _, _ = f.pass() f.settleDestination() j, backups := f.pass() if len(backups) != 1 {