From f39a209f63829dc80172425911cab03c4dd30b0d Mon Sep 17 00:00:00 2001 From: "kevin.new" Date: Wed, 10 Jun 2026 08:52:34 +0000 Subject: [PATCH 1/2] feat(pushqueue): add domain entities and extension interfaces Introduce QueueTarget, LandStrategy, LandItem entities and the VCS and LandQueue extension interfaces with generated mocks. Co-Authored-By: Claude Opus 4.6 (1M context) --- pushqueue/entity/BUILD.bazel | 8 ++ pushqueue/entity/land.go | 49 ++++++++ pushqueue/extension/landqueue/BUILD.bazel | 9 ++ pushqueue/extension/landqueue/landqueue.go | 50 ++++++++ .../extension/landqueue/mock/BUILD.bazel | 12 ++ .../landqueue/mock/landqueue_mock.go | 115 ++++++++++++++++++ pushqueue/extension/vcs/BUILD.bazel | 9 ++ pushqueue/extension/vcs/mock/BUILD.bazel | 13 ++ pushqueue/extension/vcs/mock/vcs_mock.go | 95 +++++++++++++++ pushqueue/extension/vcs/vcs.go | 87 +++++++++++++ 10 files changed, 447 insertions(+) create mode 100644 pushqueue/entity/BUILD.bazel create mode 100644 pushqueue/entity/land.go create mode 100644 pushqueue/extension/landqueue/BUILD.bazel create mode 100644 pushqueue/extension/landqueue/landqueue.go create mode 100644 pushqueue/extension/landqueue/mock/BUILD.bazel create mode 100644 pushqueue/extension/landqueue/mock/landqueue_mock.go create mode 100644 pushqueue/extension/vcs/BUILD.bazel create mode 100644 pushqueue/extension/vcs/mock/BUILD.bazel create mode 100644 pushqueue/extension/vcs/mock/vcs_mock.go create mode 100644 pushqueue/extension/vcs/vcs.go diff --git a/pushqueue/entity/BUILD.bazel b/pushqueue/entity/BUILD.bazel new file mode 100644 index 00000000..4665d3ab --- /dev/null +++ b/pushqueue/entity/BUILD.bazel @@ -0,0 +1,8 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "entity", + srcs = ["land.go"], + importpath = "github.com/uber/submitqueue/pushqueue/entity", + visibility = ["//visibility:public"], +) diff --git a/pushqueue/entity/land.go b/pushqueue/entity/land.go new file mode 100644 index 00000000..48f9b050 --- /dev/null +++ b/pushqueue/entity/land.go @@ -0,0 +1,49 @@ +// Copyright (c) 2025 Uber Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package entity + +// QueueTarget identifies a landing destination in a version control system. +// Defined locally in pushqueue; consolidated into shared entity/ by Chunk 2. +type QueueTarget struct { + // Name is an optional logical identifier for correlation and config lookup. + Name string + // Address is the VCS repository address (remote URL, depot path). + Address string + // Target is the landing ref (branch name, stream path). + Target string +} + +// LandStrategy defines the possible landing methods for a code change. +type LandStrategy string + +const ( + // LandStrategyUnknown is the unknown strategy. It is set by default + // when the structure is initialized. It should never be seen in the system. + LandStrategyUnknown LandStrategy = "" + // LandStrategyRebase rebases commits onto the target branch before landing. + LandStrategyRebase LandStrategy = "rebase" + // LandStrategySquashRebase squashes commits into a single commit before rebasing. + LandStrategySquashRebase LandStrategy = "squash_rebase" + // LandStrategyMerge creates a merge commit preserving commit history. + LandStrategyMerge LandStrategy = "merge" +) + +// LandItem represents a single code change to land with its strategy. +type LandItem struct { + // URIs identifies the change (RFC 3986). Scheme identifies the provider. + URIs []string + // Strategy is the landing strategy for this change. + Strategy LandStrategy +} diff --git a/pushqueue/extension/landqueue/BUILD.bazel b/pushqueue/extension/landqueue/BUILD.bazel new file mode 100644 index 00000000..282394ab --- /dev/null +++ b/pushqueue/extension/landqueue/BUILD.bazel @@ -0,0 +1,9 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "landqueue", + srcs = ["landqueue.go"], + importpath = "github.com/uber/submitqueue/pushqueue/extension/landqueue", + visibility = ["//visibility:public"], + deps = ["//pushqueue/entity"], +) diff --git a/pushqueue/extension/landqueue/landqueue.go b/pushqueue/extension/landqueue/landqueue.go new file mode 100644 index 00000000..a1d1aa53 --- /dev/null +++ b/pushqueue/extension/landqueue/landqueue.go @@ -0,0 +1,50 @@ +// Copyright (c) 2025 Uber Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package landqueue + +//go:generate mockgen -source=landqueue.go -destination=mock/landqueue_mock.go -package=mock + +import ( + "context" + + "github.com/uber/submitqueue/pushqueue/entity" +) + +// Preparer performs pre-push preparation for a set of land items. +// Implementations are typically backed by a VCS extension. The Queue +// receives a Preparer at construction time and may invoke it between +// Enqueue and Wait to pipeline preparation with queue wait time. +type Preparer interface { + Prepare(ctx context.Context, target entity.QueueTarget, items []entity.LandItem) error +} + +// Queue serializes access to a landing target, ensuring only one request +// pushes at a time per (address, target) pair. +// +// Contract: +// - Enqueue is idempotent: re-enqueueing the same request is a no-op. +// - Wait blocks until this request is head-of-queue AND preparation +// (via the Preparer provided at construction) has completed. +// Must respect ctx cancellation. +// - Dequeue removes this request from the queue. Must be called exactly +// once per successful Enqueue (use defer). +// - Implementations must detect stale queue heads and evict them after a timeout. +// - Implementations decide when to call Preparer.Prepare — during the +// wait (pipelined) or synchronously before Wait returns (simple). +type Queue interface { + Enqueue(ctx context.Context, target entity.QueueTarget, items []entity.LandItem) error + Wait(ctx context.Context, target entity.QueueTarget) error + Dequeue(ctx context.Context, target entity.QueueTarget) error +} diff --git a/pushqueue/extension/landqueue/mock/BUILD.bazel b/pushqueue/extension/landqueue/mock/BUILD.bazel new file mode 100644 index 00000000..328c52c8 --- /dev/null +++ b/pushqueue/extension/landqueue/mock/BUILD.bazel @@ -0,0 +1,12 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "mock", + srcs = ["landqueue_mock.go"], + importpath = "github.com/uber/submitqueue/pushqueue/extension/landqueue/mock", + visibility = ["//visibility:public"], + deps = [ + "//pushqueue/entity", + "@com_github_golang_mock//gomock", + ], +) diff --git a/pushqueue/extension/landqueue/mock/landqueue_mock.go b/pushqueue/extension/landqueue/mock/landqueue_mock.go new file mode 100644 index 00000000..a14dd8a4 --- /dev/null +++ b/pushqueue/extension/landqueue/mock/landqueue_mock.go @@ -0,0 +1,115 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: landqueue.go + +// Package mock is a generated GoMock package. +package mock + +import ( + context "context" + reflect "reflect" + + gomock "github.com/golang/mock/gomock" + entity "github.com/uber/submitqueue/pushqueue/entity" +) + +// MockPreparer is a mock of Preparer interface. +type MockPreparer struct { + ctrl *gomock.Controller + recorder *MockPreparerMockRecorder +} + +// MockPreparerMockRecorder is the mock recorder for MockPreparer. +type MockPreparerMockRecorder struct { + mock *MockPreparer +} + +// NewMockPreparer creates a new mock instance. +func NewMockPreparer(ctrl *gomock.Controller) *MockPreparer { + mock := &MockPreparer{ctrl: ctrl} + mock.recorder = &MockPreparerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockPreparer) EXPECT() *MockPreparerMockRecorder { + return m.recorder +} + +// Prepare mocks base method. +func (m *MockPreparer) Prepare(ctx context.Context, target entity.QueueTarget, items []entity.LandItem) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Prepare", ctx, target, items) + ret0, _ := ret[0].(error) + return ret0 +} + +// Prepare indicates an expected call of Prepare. +func (mr *MockPreparerMockRecorder) Prepare(ctx, target, items interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Prepare", reflect.TypeOf((*MockPreparer)(nil).Prepare), ctx, target, items) +} + +// MockQueue is a mock of Queue interface. +type MockQueue struct { + ctrl *gomock.Controller + recorder *MockQueueMockRecorder +} + +// MockQueueMockRecorder is the mock recorder for MockQueue. +type MockQueueMockRecorder struct { + mock *MockQueue +} + +// NewMockQueue creates a new mock instance. +func NewMockQueue(ctrl *gomock.Controller) *MockQueue { + mock := &MockQueue{ctrl: ctrl} + mock.recorder = &MockQueueMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockQueue) EXPECT() *MockQueueMockRecorder { + return m.recorder +} + +// Dequeue mocks base method. +func (m *MockQueue) Dequeue(ctx context.Context, target entity.QueueTarget) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Dequeue", ctx, target) + ret0, _ := ret[0].(error) + return ret0 +} + +// Dequeue indicates an expected call of Dequeue. +func (mr *MockQueueMockRecorder) Dequeue(ctx, target interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Dequeue", reflect.TypeOf((*MockQueue)(nil).Dequeue), ctx, target) +} + +// Enqueue mocks base method. +func (m *MockQueue) Enqueue(ctx context.Context, target entity.QueueTarget, items []entity.LandItem) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Enqueue", ctx, target, items) + ret0, _ := ret[0].(error) + return ret0 +} + +// Enqueue indicates an expected call of Enqueue. +func (mr *MockQueueMockRecorder) Enqueue(ctx, target, items interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Enqueue", reflect.TypeOf((*MockQueue)(nil).Enqueue), ctx, target, items) +} + +// Wait mocks base method. +func (m *MockQueue) Wait(ctx context.Context, target entity.QueueTarget) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Wait", ctx, target) + ret0, _ := ret[0].(error) + return ret0 +} + +// Wait indicates an expected call of Wait. +func (mr *MockQueueMockRecorder) Wait(ctx, target interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Wait", reflect.TypeOf((*MockQueue)(nil).Wait), ctx, target) +} diff --git a/pushqueue/extension/vcs/BUILD.bazel b/pushqueue/extension/vcs/BUILD.bazel new file mode 100644 index 00000000..5be99025 --- /dev/null +++ b/pushqueue/extension/vcs/BUILD.bazel @@ -0,0 +1,9 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "vcs", + srcs = ["vcs.go"], + importpath = "github.com/uber/submitqueue/pushqueue/extension/vcs", + visibility = ["//visibility:public"], + deps = ["//pushqueue/entity"], +) diff --git a/pushqueue/extension/vcs/mock/BUILD.bazel b/pushqueue/extension/vcs/mock/BUILD.bazel new file mode 100644 index 00000000..20c3bfb8 --- /dev/null +++ b/pushqueue/extension/vcs/mock/BUILD.bazel @@ -0,0 +1,13 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "mock", + srcs = ["vcs_mock.go"], + importpath = "github.com/uber/submitqueue/pushqueue/extension/vcs/mock", + visibility = ["//visibility:public"], + deps = [ + "//pushqueue/entity", + "//pushqueue/extension/vcs", + "@com_github_golang_mock//gomock", + ], +) diff --git a/pushqueue/extension/vcs/mock/vcs_mock.go b/pushqueue/extension/vcs/mock/vcs_mock.go new file mode 100644 index 00000000..31163731 --- /dev/null +++ b/pushqueue/extension/vcs/mock/vcs_mock.go @@ -0,0 +1,95 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: vcs.go + +// Package mock is a generated GoMock package. +package mock + +import ( + context "context" + reflect "reflect" + + gomock "github.com/golang/mock/gomock" + entity "github.com/uber/submitqueue/pushqueue/entity" + vcs "github.com/uber/submitqueue/pushqueue/extension/vcs" +) + +// MockVCS is a mock of VCS interface. +type MockVCS struct { + ctrl *gomock.Controller + recorder *MockVCSMockRecorder +} + +// MockVCSMockRecorder is the mock recorder for MockVCS. +type MockVCSMockRecorder struct { + mock *MockVCS +} + +// NewMockVCS creates a new mock instance. +func NewMockVCS(ctrl *gomock.Controller) *MockVCS { + mock := &MockVCS{ctrl: ctrl} + mock.recorder = &MockVCSMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockVCS) EXPECT() *MockVCSMockRecorder { + return m.recorder +} + +// CheckMergeability mocks base method. +func (m *MockVCS) CheckMergeability(ctx context.Context, target entity.QueueTarget, items []entity.LandItem) ([]vcs.MergeabilityResult, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CheckMergeability", ctx, target, items) + ret0, _ := ret[0].([]vcs.MergeabilityResult) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CheckMergeability indicates an expected call of CheckMergeability. +func (mr *MockVCSMockRecorder) CheckMergeability(ctx, target, items interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CheckMergeability", reflect.TypeOf((*MockVCS)(nil).CheckMergeability), ctx, target, items) +} + +// Finalize mocks base method. +func (m *MockVCS) Finalize(ctx context.Context, target entity.QueueTarget, items []entity.LandItem) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Finalize", ctx, target, items) + ret0, _ := ret[0].(error) + return ret0 +} + +// Finalize indicates an expected call of Finalize. +func (mr *MockVCSMockRecorder) Finalize(ctx, target, items interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Finalize", reflect.TypeOf((*MockVCS)(nil).Finalize), ctx, target, items) +} + +// Prepare mocks base method. +func (m *MockVCS) Prepare(ctx context.Context, target entity.QueueTarget, items []entity.LandItem) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Prepare", ctx, target, items) + ret0, _ := ret[0].(error) + return ret0 +} + +// Prepare indicates an expected call of Prepare. +func (mr *MockVCSMockRecorder) Prepare(ctx, target, items interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Prepare", reflect.TypeOf((*MockVCS)(nil).Prepare), ctx, target, items) +} + +// Push mocks base method. +func (m *MockVCS) Push(ctx context.Context, target entity.QueueTarget, items []entity.LandItem) (vcs.PushResult, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Push", ctx, target, items) + ret0, _ := ret[0].(vcs.PushResult) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Push indicates an expected call of Push. +func (mr *MockVCSMockRecorder) Push(ctx, target, items interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Push", reflect.TypeOf((*MockVCS)(nil).Push), ctx, target, items) +} diff --git a/pushqueue/extension/vcs/vcs.go b/pushqueue/extension/vcs/vcs.go new file mode 100644 index 00000000..ae362c75 --- /dev/null +++ b/pushqueue/extension/vcs/vcs.go @@ -0,0 +1,87 @@ +// Copyright (c) 2025 Uber Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package vcs + +//go:generate mockgen -source=vcs.go -destination=mock/vcs_mock.go -package=mock + +import ( + "context" + "errors" + + "github.com/uber/submitqueue/pushqueue/entity" +) + +// ErrConflict is returned when a change fails to apply cleanly on top of the target. +var ErrConflict = errors.New("change conflict") + +// ErrStaleHead is returned when the target ref moved during the push, making the operation stale. +var ErrStaleHead = errors.New("stale head") + +// OutcomeStatus describes what happened to a single item during a Push. +type OutcomeStatus string + +const ( + // OutcomeStatusUnknown is the unreachable zero value. + OutcomeStatusUnknown OutcomeStatus = "" + // OutcomeStatusCommitted means the change produced one or more revisions on the target. + OutcomeStatusCommitted OutcomeStatus = "committed" + // OutcomeStatusAlreadyExisted means the change was already present on the target. + OutcomeStatusAlreadyExisted OutcomeStatus = "already_existed" +) + +// ItemOutcome describes what happened to a single LandItem during a Push. +type ItemOutcome struct { + // Status describes whether the change produced revisions or was already present. + Status OutcomeStatus + // RevisionIDs lists the revisions produced on the target, in apply order. + RevisionIDs []string +} + +// PushResult holds the outcomes of a successful Push call. +type PushResult struct { + // Outcomes is one entry per input item, in the same order. + Outcomes []ItemOutcome +} + +// MergeabilityResult describes whether a single LandItem can be landed. +type MergeabilityResult struct { + // Mergeable is true if the item can be landed. + Mergeable bool + // Reason is a human-readable explanation when not mergeable. + Reason string +} + +// VCS performs all version control and change-provider operations for landing +// changes onto a target branch. Implementations bundle VCS operations (git, +// Perforce) with platform operations (GitHub, Phabricator) where needed. +// +// Idempotency: every method must be safe to call multiple times with the same +// inputs. The full Land flow (Prepare → Push → Finalize) may be retried +// end-to-end on any failure: +// - Prepare: re-applying already-applied changes rebuilds the working copy. +// Implementations detect stale state from a previous failed attempt and +// recover automatically. +// - Push: detects already-pushed changes, returns OutcomeStatusAlreadyExisted. +// - Finalize: closing an already-closed review is a no-op. +// - CheckMergeability: read-only, naturally idempotent. +// +// Push atomicity: when Push returns a non-nil error, NO change has been pushed +// to the remote. +type VCS interface { + CheckMergeability(ctx context.Context, target entity.QueueTarget, items []entity.LandItem) ([]MergeabilityResult, error) + Prepare(ctx context.Context, target entity.QueueTarget, items []entity.LandItem) error + Push(ctx context.Context, target entity.QueueTarget, items []entity.LandItem) (PushResult, error) + Finalize(ctx context.Context, target entity.QueueTarget, items []entity.LandItem) error +} From 4d2c36b1291cf172d9a5fdd83e83f67c020c4fdc Mon Sep 17 00:00:00 2001 From: "kevin.new" Date: Wed, 10 Jun 2026 17:59:31 +0000 Subject: [PATCH 2/2] fix: use org_uber_go_mock in mock BUILD files Replace @com_github_golang_mock with @org_uber_go_mock to match the Bzlmod module registry. Co-Authored-By: Claude Opus 4.6 (1M context) --- pushqueue/extension/landqueue/mock/BUILD.bazel | 2 +- .../extension/landqueue/mock/landqueue_mock.go | 17 ++++++++++++----- pushqueue/extension/vcs/mock/BUILD.bazel | 2 +- pushqueue/extension/vcs/mock/vcs_mock.go | 16 +++++++++++----- 4 files changed, 25 insertions(+), 12 deletions(-) diff --git a/pushqueue/extension/landqueue/mock/BUILD.bazel b/pushqueue/extension/landqueue/mock/BUILD.bazel index 328c52c8..a05e2adf 100644 --- a/pushqueue/extension/landqueue/mock/BUILD.bazel +++ b/pushqueue/extension/landqueue/mock/BUILD.bazel @@ -7,6 +7,6 @@ go_library( visibility = ["//visibility:public"], deps = [ "//pushqueue/entity", - "@com_github_golang_mock//gomock", + "@org_uber_go_mock//gomock", ], ) diff --git a/pushqueue/extension/landqueue/mock/landqueue_mock.go b/pushqueue/extension/landqueue/mock/landqueue_mock.go index a14dd8a4..7f1e1a55 100644 --- a/pushqueue/extension/landqueue/mock/landqueue_mock.go +++ b/pushqueue/extension/landqueue/mock/landqueue_mock.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: landqueue.go +// +// Generated by this command: +// +// mockgen -source=landqueue.go -destination=mock/landqueue_mock.go -package=mock +// // Package mock is a generated GoMock package. package mock @@ -8,14 +13,15 @@ import ( context "context" reflect "reflect" - gomock "github.com/golang/mock/gomock" entity "github.com/uber/submitqueue/pushqueue/entity" + gomock "go.uber.org/mock/gomock" ) // MockPreparer is a mock of Preparer interface. type MockPreparer struct { ctrl *gomock.Controller recorder *MockPreparerMockRecorder + isgomock struct{} } // MockPreparerMockRecorder is the mock recorder for MockPreparer. @@ -44,7 +50,7 @@ func (m *MockPreparer) Prepare(ctx context.Context, target entity.QueueTarget, i } // Prepare indicates an expected call of Prepare. -func (mr *MockPreparerMockRecorder) Prepare(ctx, target, items interface{}) *gomock.Call { +func (mr *MockPreparerMockRecorder) Prepare(ctx, target, items any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Prepare", reflect.TypeOf((*MockPreparer)(nil).Prepare), ctx, target, items) } @@ -53,6 +59,7 @@ func (mr *MockPreparerMockRecorder) Prepare(ctx, target, items interface{}) *gom type MockQueue struct { ctrl *gomock.Controller recorder *MockQueueMockRecorder + isgomock struct{} } // MockQueueMockRecorder is the mock recorder for MockQueue. @@ -81,7 +88,7 @@ func (m *MockQueue) Dequeue(ctx context.Context, target entity.QueueTarget) erro } // Dequeue indicates an expected call of Dequeue. -func (mr *MockQueueMockRecorder) Dequeue(ctx, target interface{}) *gomock.Call { +func (mr *MockQueueMockRecorder) Dequeue(ctx, target any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Dequeue", reflect.TypeOf((*MockQueue)(nil).Dequeue), ctx, target) } @@ -95,7 +102,7 @@ func (m *MockQueue) Enqueue(ctx context.Context, target entity.QueueTarget, item } // Enqueue indicates an expected call of Enqueue. -func (mr *MockQueueMockRecorder) Enqueue(ctx, target, items interface{}) *gomock.Call { +func (mr *MockQueueMockRecorder) Enqueue(ctx, target, items any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Enqueue", reflect.TypeOf((*MockQueue)(nil).Enqueue), ctx, target, items) } @@ -109,7 +116,7 @@ func (m *MockQueue) Wait(ctx context.Context, target entity.QueueTarget) error { } // Wait indicates an expected call of Wait. -func (mr *MockQueueMockRecorder) Wait(ctx, target interface{}) *gomock.Call { +func (mr *MockQueueMockRecorder) Wait(ctx, target any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Wait", reflect.TypeOf((*MockQueue)(nil).Wait), ctx, target) } diff --git a/pushqueue/extension/vcs/mock/BUILD.bazel b/pushqueue/extension/vcs/mock/BUILD.bazel index 20c3bfb8..f57b9784 100644 --- a/pushqueue/extension/vcs/mock/BUILD.bazel +++ b/pushqueue/extension/vcs/mock/BUILD.bazel @@ -8,6 +8,6 @@ go_library( deps = [ "//pushqueue/entity", "//pushqueue/extension/vcs", - "@com_github_golang_mock//gomock", + "@org_uber_go_mock//gomock", ], ) diff --git a/pushqueue/extension/vcs/mock/vcs_mock.go b/pushqueue/extension/vcs/mock/vcs_mock.go index 31163731..199d2faa 100644 --- a/pushqueue/extension/vcs/mock/vcs_mock.go +++ b/pushqueue/extension/vcs/mock/vcs_mock.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: vcs.go +// +// Generated by this command: +// +// mockgen -source=vcs.go -destination=mock/vcs_mock.go -package=mock +// // Package mock is a generated GoMock package. package mock @@ -8,15 +13,16 @@ import ( context "context" reflect "reflect" - gomock "github.com/golang/mock/gomock" entity "github.com/uber/submitqueue/pushqueue/entity" vcs "github.com/uber/submitqueue/pushqueue/extension/vcs" + gomock "go.uber.org/mock/gomock" ) // MockVCS is a mock of VCS interface. type MockVCS struct { ctrl *gomock.Controller recorder *MockVCSMockRecorder + isgomock struct{} } // MockVCSMockRecorder is the mock recorder for MockVCS. @@ -46,7 +52,7 @@ func (m *MockVCS) CheckMergeability(ctx context.Context, target entity.QueueTarg } // CheckMergeability indicates an expected call of CheckMergeability. -func (mr *MockVCSMockRecorder) CheckMergeability(ctx, target, items interface{}) *gomock.Call { +func (mr *MockVCSMockRecorder) CheckMergeability(ctx, target, items any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CheckMergeability", reflect.TypeOf((*MockVCS)(nil).CheckMergeability), ctx, target, items) } @@ -60,7 +66,7 @@ func (m *MockVCS) Finalize(ctx context.Context, target entity.QueueTarget, items } // Finalize indicates an expected call of Finalize. -func (mr *MockVCSMockRecorder) Finalize(ctx, target, items interface{}) *gomock.Call { +func (mr *MockVCSMockRecorder) Finalize(ctx, target, items any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Finalize", reflect.TypeOf((*MockVCS)(nil).Finalize), ctx, target, items) } @@ -74,7 +80,7 @@ func (m *MockVCS) Prepare(ctx context.Context, target entity.QueueTarget, items } // Prepare indicates an expected call of Prepare. -func (mr *MockVCSMockRecorder) Prepare(ctx, target, items interface{}) *gomock.Call { +func (mr *MockVCSMockRecorder) Prepare(ctx, target, items any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Prepare", reflect.TypeOf((*MockVCS)(nil).Prepare), ctx, target, items) } @@ -89,7 +95,7 @@ func (m *MockVCS) Push(ctx context.Context, target entity.QueueTarget, items []e } // Push indicates an expected call of Push. -func (mr *MockVCSMockRecorder) Push(ctx, target, items interface{}) *gomock.Call { +func (mr *MockVCSMockRecorder) Push(ctx, target, items any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Push", reflect.TypeOf((*MockVCS)(nil).Push), ctx, target, items) }