From 59ee6af62a081d16b98407119198f1876172f621 Mon Sep 17 00:00:00 2001 From: Doctor Vince Date: Tue, 12 Dec 2023 11:56:45 -0500 Subject: [PATCH] Vc/remove hollow 1 (#25) * remove ancient flasher dependency * excise references to go.hollow.sh/events --- condition/status.go | 5 ++--- condition/status_test.go | 9 ++++----- condition/types.go | 2 +- events/mock/events.go | 18 +++++++++++------- events/pkg/kv/kv.go | 2 +- events/pkg/kv/kv_test.go | 2 +- events/registry/registry.go | 4 ++-- events/registry/registry_test.go | 2 +- 8 files changed, 23 insertions(+), 21 deletions(-) diff --git a/condition/status.go b/condition/status.go index 5984214..bface88 100644 --- a/condition/status.go +++ b/condition/status.go @@ -5,10 +5,9 @@ import ( "fmt" "time" - "github.com/metal-toolbox/flasher/types" + "github.com/metal-toolbox/rivets/events/registry" "github.com/nats-io/nats.go" "github.com/pkg/errors" - "go.hollow.sh/toolbox/events/registry" ) type ErrQueryStatus struct { @@ -120,7 +119,7 @@ func CheckConditionInProgress(conditionID, facilityCode, kvBucket string, js nat } // we have an status entry for this condition, is is complete? - sv := types.StatusValue{} + sv := StatusValue{} if errJSON := json.Unmarshal(entry.Value(), &sv); errJSON != nil { errJSON = errors.Wrap(errJSON, "unable to construct a sane status for condition") return Indeterminate, newErrQueryStatus(errJSON, kvBucket, lookupKey, "") diff --git a/condition/status_test.go b/condition/status_test.go index d3021a6..73903bf 100644 --- a/condition/status_test.go +++ b/condition/status_test.go @@ -9,15 +9,14 @@ import ( "time" "github.com/google/uuid" - "github.com/metal-toolbox/flasher/types" + "github.com/metal-toolbox/rivets/events" + "github.com/metal-toolbox/rivets/events/pkg/kv" + "github.com/metal-toolbox/rivets/events/registry" "github.com/nats-io/nats-server/v2/server" srvtest "github.com/nats-io/nats-server/v2/test" "github.com/nats-io/nats.go" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.hollow.sh/toolbox/events" - "go.hollow.sh/toolbox/events/pkg/kv" - "go.hollow.sh/toolbox/events/registry" ) func startJetStreamServer(t *testing.T) *server.Server { @@ -107,7 +106,7 @@ func TestCheckConditionInProgress(t *testing.T) { Complete, "", func() []byte { - sv := &types.StatusValue{State: string(Failed)} + sv := &StatusValue{State: string(Failed)} return sv.MustBytes() }, false, diff --git a/condition/types.go b/condition/types.go index 226de59..2cac836 100644 --- a/condition/types.go +++ b/condition/types.go @@ -5,7 +5,7 @@ import ( "time" "github.com/google/uuid" - "go.hollow.sh/toolbox/events" + "github.com/metal-toolbox/rivets/events" "golang.org/x/exp/slices" ) diff --git a/events/mock/events.go b/events/mock/events.go index 6842068..594516c 100644 --- a/events/mock/events.go +++ b/events/mock/events.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: events/events.go - +// +// Generated by this command: +// +// mockgen -source=events/events.go -package=mock_events +// // Package mock_events is a generated GoMock package. package mock_events @@ -8,8 +12,8 @@ import ( context "context" reflect "reflect" - events "go.hollow.sh/toolbox/events" - "go.uber.org/mock/gomock" + events "github.com/metal-toolbox/rivets/events" + gomock "go.uber.org/mock/gomock" ) // MockStreamParameters is a mock of StreamParameters interface. @@ -95,7 +99,7 @@ func (m *MockStream) Publish(ctx context.Context, subject string, msg []byte) er } // Publish indicates an expected call of Publish. -func (mr *MockStreamMockRecorder) Publish(ctx, subject, msg interface{}) *gomock.Call { +func (mr *MockStreamMockRecorder) Publish(ctx, subject, msg any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Publish", reflect.TypeOf((*MockStream)(nil).Publish), ctx, subject, msg) } @@ -110,7 +114,7 @@ func (m *MockStream) PullMsg(ctx context.Context, batch int) ([]events.Message, } // PullMsg indicates an expected call of PullMsg. -func (mr *MockStreamMockRecorder) PullMsg(ctx, batch interface{}) *gomock.Call { +func (mr *MockStreamMockRecorder) PullMsg(ctx, batch any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PullMsg", reflect.TypeOf((*MockStream)(nil).PullMsg), ctx, batch) } @@ -125,7 +129,7 @@ func (m *MockStream) Subscribe(ctx context.Context) (events.MsgCh, error) { } // Subscribe indicates an expected call of Subscribe. -func (mr *MockStreamMockRecorder) Subscribe(ctx interface{}) *gomock.Call { +func (mr *MockStreamMockRecorder) Subscribe(ctx any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Subscribe", reflect.TypeOf((*MockStream)(nil).Subscribe), ctx) } @@ -190,7 +194,7 @@ func (m *MockMessage) ExtractOtelTraceContext(ctx context.Context) context.Conte } // ExtractOtelTraceContext indicates an expected call of ExtractOtelTraceContext. -func (mr *MockMessageMockRecorder) ExtractOtelTraceContext(ctx interface{}) *gomock.Call { +func (mr *MockMessageMockRecorder) ExtractOtelTraceContext(ctx any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExtractOtelTraceContext", reflect.TypeOf((*MockMessage)(nil).ExtractOtelTraceContext), ctx) } diff --git a/events/pkg/kv/kv.go b/events/pkg/kv/kv.go index d0e1066..90b4e19 100644 --- a/events/pkg/kv/kv.go +++ b/events/pkg/kv/kv.go @@ -7,7 +7,7 @@ import ( "github.com/nats-io/nats.go" - "go.hollow.sh/toolbox/events" + "github.com/metal-toolbox/rivets/events" ) // DefaultKVConfig returns a configuration with "mostly sane" defaults. Override diff --git a/events/pkg/kv/kv_test.go b/events/pkg/kv/kv_test.go index 504b929..169f874 100644 --- a/events/pkg/kv/kv_test.go +++ b/events/pkg/kv/kv_test.go @@ -7,8 +7,8 @@ import ( "github.com/nats-io/nats.go" + "github.com/metal-toolbox/rivets/events" kvTest "github.com/metal-toolbox/rivets/events/internal/test" - "go.hollow.sh/toolbox/events" "github.com/stretchr/testify/require" ) diff --git a/events/registry/registry.go b/events/registry/registry.go index 8e29cc1..0718f71 100644 --- a/events/registry/registry.go +++ b/events/registry/registry.go @@ -14,8 +14,8 @@ import ( "github.com/nats-io/nats.go" - "go.hollow.sh/toolbox/events" - "go.hollow.sh/toolbox/events/pkg/kv" + "github.com/metal-toolbox/rivets/events" + "github.com/metal-toolbox/rivets/events/pkg/kv" ) var ( diff --git a/events/registry/registry_test.go b/events/registry/registry_test.go index a0562ec..dfd4b13 100644 --- a/events/registry/registry_test.go +++ b/events/registry/registry_test.go @@ -7,8 +7,8 @@ import ( "github.com/nats-io/nats.go" "github.com/stretchr/testify/require" + "github.com/metal-toolbox/rivets/events" kvTest "github.com/metal-toolbox/rivets/events/internal/test" - "go.hollow.sh/toolbox/events" ) func TestAppLifecycle(t *testing.T) {