Skip to content

Commit

Permalink
Move events from internal to pkg
Browse files Browse the repository at this point in the history
Signed-off-by: Radoslav Dimitrov <[email protected]>
  • Loading branch information
rdimitrov committed Oct 24, 2024
1 parent 828a944 commit 63216b8
Show file tree
Hide file tree
Showing 60 changed files with 62 additions and 62 deletions.
2 changes: 1 addition & 1 deletion internal/controlplane/handlers_entities.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ import (
"github.com/mindersec/minder/internal/db"
"github.com/mindersec/minder/internal/engine/engcontext"
"github.com/mindersec/minder/internal/entities/properties"
"github.com/mindersec/minder/internal/events"
"github.com/mindersec/minder/internal/logger"
"github.com/mindersec/minder/internal/providers"
"github.com/mindersec/minder/internal/reconcilers/messages"
"github.com/mindersec/minder/internal/util"
pb "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1"
"github.com/mindersec/minder/pkg/events"
)

// ReconcileEntityRegistration reconciles the registration of an entity.
Expand Down
2 changes: 1 addition & 1 deletion internal/controlplane/handlers_entities_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ import (

"github.com/mindersec/minder/internal/db"
"github.com/mindersec/minder/internal/engine/engcontext"
mockevents "github.com/mindersec/minder/internal/events/mock"
mockgh "github.com/mindersec/minder/internal/providers/github/mock"
"github.com/mindersec/minder/internal/providers/manager"
mockmanager "github.com/mindersec/minder/internal/providers/manager/mock"
rf "github.com/mindersec/minder/internal/repositories/mock/fixtures"
pb "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1"
mockevents "github.com/mindersec/minder/pkg/events/mock"
)

func TestServer_ReconcileEntityRegistration(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/controlplane/handlers_oauth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ import (
"github.com/mindersec/minder/internal/db"
"github.com/mindersec/minder/internal/engine/engcontext"
mockprops "github.com/mindersec/minder/internal/entities/properties/service/mock"
"github.com/mindersec/minder/internal/events"
"github.com/mindersec/minder/internal/providers"
"github.com/mindersec/minder/internal/providers/dockerhub"
mockclients "github.com/mindersec/minder/internal/providers/github/clients/mock"
Expand All @@ -51,6 +50,7 @@ import (
mockmanager "github.com/mindersec/minder/internal/providers/manager/mock"
"github.com/mindersec/minder/internal/providers/session"
pb "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1"
"github.com/mindersec/minder/pkg/events"
provinfv1 "github.com/mindersec/minder/pkg/providers/v1"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/controlplane/handlers_profile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ import (
"github.com/mindersec/minder/internal/db/embedded"
"github.com/mindersec/minder/internal/engine/engcontext"
"github.com/mindersec/minder/internal/engine/selectors"
stubeventer "github.com/mindersec/minder/internal/events/stubs"
"github.com/mindersec/minder/internal/profiles"
"github.com/mindersec/minder/internal/providers"
"github.com/mindersec/minder/internal/util"
minderv1 "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1"
stubeventer "github.com/mindersec/minder/pkg/events/stubs"
)

//nolint:gocyclo
Expand Down
2 changes: 1 addition & 1 deletion internal/controlplane/handlers_reconciliationtasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ import (

"github.com/mindersec/minder/internal/db"
"github.com/mindersec/minder/internal/engine/engcontext"
"github.com/mindersec/minder/internal/events"
"github.com/mindersec/minder/internal/logger"
reconcilers "github.com/mindersec/minder/internal/reconcilers/messages"
pb "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1"
"github.com/mindersec/minder/pkg/events"
)

// CreateEntityReconciliationTask creates a task to reconcile the state of an entity
Expand Down
2 changes: 1 addition & 1 deletion internal/controlplane/handlers_reconciliationtasks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import (
mockdb "github.com/mindersec/minder/database/mock"
"github.com/mindersec/minder/internal/db"
"github.com/mindersec/minder/internal/engine/engcontext"
stubeventer "github.com/mindersec/minder/internal/events/stubs"
"github.com/mindersec/minder/internal/providers"
pb "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1"
stubeventer "github.com/mindersec/minder/pkg/events/stubs"
)

func TestServer_CreateRepositoryReconciliationTask(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/controlplane/handlers_user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ import (
serverconfig "github.com/mindersec/minder/internal/config/server"
mockcrypto "github.com/mindersec/minder/internal/crypto/mock"
"github.com/mindersec/minder/internal/db"
"github.com/mindersec/minder/internal/events"
"github.com/mindersec/minder/internal/flags"
"github.com/mindersec/minder/internal/marketplaces"
"github.com/mindersec/minder/internal/projects"
"github.com/mindersec/minder/internal/providers"
mockprov "github.com/mindersec/minder/internal/providers/github/service/mock"
pb "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1"
"github.com/mindersec/minder/pkg/events"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion internal/controlplane/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ import (
"github.com/mindersec/minder/internal/crypto"
"github.com/mindersec/minder/internal/db"
propSvc "github.com/mindersec/minder/internal/entities/properties/service"
"github.com/mindersec/minder/internal/events"
"github.com/mindersec/minder/internal/history"
"github.com/mindersec/minder/internal/invites"
"github.com/mindersec/minder/internal/logger"
Expand All @@ -65,6 +64,7 @@ import (
"github.com/mindersec/minder/internal/ruletypes"
"github.com/mindersec/minder/internal/util"
pb "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1"
"github.com/mindersec/minder/pkg/events"
)

const metricsPath = "/metrics"
Expand Down
2 changes: 1 addition & 1 deletion internal/controlplane/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ import (
"github.com/mindersec/minder/internal/controlplane/metrics"
"github.com/mindersec/minder/internal/crypto"
mock_service "github.com/mindersec/minder/internal/entities/properties/service/mock"
"github.com/mindersec/minder/internal/events"
"github.com/mindersec/minder/internal/providers"
ghclient "github.com/mindersec/minder/internal/providers/github/clients"
ghService "github.com/mindersec/minder/internal/providers/github/service"
mock_reposvc "github.com/mindersec/minder/internal/repositories/mock"
pb "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1"
"github.com/mindersec/minder/pkg/events"
)

const bufSize = 1024 * 1024
Expand Down
2 changes: 1 addition & 1 deletion internal/eea/eea.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import (
"github.com/mindersec/minder/internal/db"
"github.com/mindersec/minder/internal/engine/entities"
"github.com/mindersec/minder/internal/entities/properties/service"
"github.com/mindersec/minder/internal/events"
"github.com/mindersec/minder/internal/providers/manager"
minderv1 "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1"
"github.com/mindersec/minder/pkg/events"
)

// EEA is the Event Execution Aggregator
Expand Down
2 changes: 1 addition & 1 deletion internal/eea/eea_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ import (
"github.com/mindersec/minder/internal/entities/properties"
psvc "github.com/mindersec/minder/internal/entities/properties/service"
propsvcmock "github.com/mindersec/minder/internal/entities/properties/service/mock"
"github.com/mindersec/minder/internal/events"
mockmanager "github.com/mindersec/minder/internal/providers/manager/mock"
minderv1 "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1"
"github.com/mindersec/minder/pkg/events"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion internal/email/awsses/awsses.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
"github.com/rs/zerolog"

"github.com/mindersec/minder/internal/email"
"github.com/mindersec/minder/internal/events"
"github.com/mindersec/minder/pkg/events"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion internal/email/noop/noop.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/rs/zerolog"

"github.com/mindersec/minder/internal/email"
"github.com/mindersec/minder/internal/events"
"github.com/mindersec/minder/pkg/events"
)

type noop struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/engine/entities/entity_event.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
"google.golang.org/protobuf/encoding/protojson"
"google.golang.org/protobuf/reflect/protoreflect"

"github.com/mindersec/minder/internal/events"
minderv1 "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1"
"github.com/mindersec/minder/pkg/events"
)

// EntityInfoWrapper is a helper struct to gather information
Expand Down
2 changes: 1 addition & 1 deletion internal/engine/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import (

"github.com/mindersec/minder/internal/engine/engcontext"
"github.com/mindersec/minder/internal/engine/entities"
"github.com/mindersec/minder/internal/events"
minderlogger "github.com/mindersec/minder/internal/logger"
pb "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1"
"github.com/mindersec/minder/pkg/events"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion internal/engine/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ import (
"github.com/mindersec/minder/internal/engine"
"github.com/mindersec/minder/internal/engine/entities"
mockengine "github.com/mindersec/minder/internal/engine/mock"
"github.com/mindersec/minder/internal/events"
"github.com/mindersec/minder/internal/util/testqueue"
minderv1 "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1"
"github.com/mindersec/minder/pkg/events"
)

func TestExecutorEventHandler_handleEntityEvent(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/entities/handlers/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ import (
"github.com/mindersec/minder/internal/entities/models"
"github.com/mindersec/minder/internal/entities/properties"
propertyService "github.com/mindersec/minder/internal/entities/properties/service"
"github.com/mindersec/minder/internal/events"
"github.com/mindersec/minder/internal/projects/features"
"github.com/mindersec/minder/internal/providers/manager"
v1 "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1"
"github.com/mindersec/minder/pkg/events"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions internal/entities/handlers/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ import (
"github.com/mindersec/minder/internal/entities/properties"
"github.com/mindersec/minder/internal/entities/properties/service"
"github.com/mindersec/minder/internal/entities/properties/service/mock/fixtures"
"github.com/mindersec/minder/internal/events"
stubeventer "github.com/mindersec/minder/internal/events/stubs"
mockgithub "github.com/mindersec/minder/internal/providers/github/mock"
ghprops "github.com/mindersec/minder/internal/providers/github/properties"
"github.com/mindersec/minder/internal/providers/manager"
mock_manager "github.com/mindersec/minder/internal/providers/manager/mock"
provManFixtures "github.com/mindersec/minder/internal/providers/manager/mock/fixtures"
"github.com/mindersec/minder/internal/reconcilers/messages"
minderv1 "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1"
"github.com/mindersec/minder/pkg/events"
stubeventer "github.com/mindersec/minder/pkg/events/stubs"
provifv1 "github.com/mindersec/minder/pkg/providers/v1"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/invites/mock/service.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/invites/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import (
serverconfig "github.com/mindersec/minder/internal/config/server"
"github.com/mindersec/minder/internal/db"
"github.com/mindersec/minder/internal/email"
"github.com/mindersec/minder/internal/events"
"github.com/mindersec/minder/internal/projects"
"github.com/mindersec/minder/internal/util"
minder "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1"
"github.com/mindersec/minder/pkg/events"
)

//go:generate go run go.uber.org/mock/mockgen -package mock_$GOPACKAGE -destination=./mock/$GOFILE -source=./$GOFILE
Expand Down
2 changes: 1 addition & 1 deletion internal/invites/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ import (
"github.com/mindersec/minder/internal/db"
dbf "github.com/mindersec/minder/internal/db/fixtures"
"github.com/mindersec/minder/internal/email"
mockevents "github.com/mindersec/minder/internal/events/mock"
"github.com/mindersec/minder/internal/projects"
minder "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1"
mockevents "github.com/mindersec/minder/pkg/events/mock"
)

func TestCreateInvite(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/logger/telemetry_store_watermill_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ import (

serverconfig "github.com/mindersec/minder/internal/config/server"
"github.com/mindersec/minder/internal/engine/entities"
"github.com/mindersec/minder/internal/events"
"github.com/mindersec/minder/internal/logger"
"github.com/mindersec/minder/internal/util/testqueue"
minderv1 "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1"
"github.com/mindersec/minder/pkg/events"
)

func TestTelemetryStoreWMMiddlewareLogsRepositoryInfo(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/profiles/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ import (
"github.com/mindersec/minder/internal/db"
"github.com/mindersec/minder/internal/engine/entities"
"github.com/mindersec/minder/internal/engine/selectors"
"github.com/mindersec/minder/internal/events"
"github.com/mindersec/minder/internal/logger"
"github.com/mindersec/minder/internal/marketplaces/namespaces"
"github.com/mindersec/minder/internal/reconcilers"
"github.com/mindersec/minder/internal/util"
"github.com/mindersec/minder/internal/util/ptr"
minderv1 "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1"
"github.com/mindersec/minder/pkg/events"
)

//go:generate go run go.uber.org/mock/mockgen -package mock_$GOPACKAGE -destination=./mock/$GOFILE -source=./$GOFILE
Expand Down
2 changes: 1 addition & 1 deletion internal/providers/github/installations/installations.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import (
"github.com/rs/zerolog"

"github.com/mindersec/minder/internal/db"
"github.com/mindersec/minder/internal/events"
"github.com/mindersec/minder/internal/providers/github/service"
"github.com/mindersec/minder/pkg/events"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion internal/providers/github/manager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ import (
"github.com/mindersec/minder/internal/crypto"
"github.com/mindersec/minder/internal/db"
propssvc "github.com/mindersec/minder/internal/entities/properties/service"
"github.com/mindersec/minder/internal/events"
"github.com/mindersec/minder/internal/providers"
"github.com/mindersec/minder/internal/providers/credentials"
"github.com/mindersec/minder/internal/providers/github/clients"
"github.com/mindersec/minder/internal/providers/github/properties"
"github.com/mindersec/minder/internal/providers/github/service"
m "github.com/mindersec/minder/internal/providers/manager"
"github.com/mindersec/minder/internal/providers/ratecache"
"github.com/mindersec/minder/pkg/events"
v1 "github.com/mindersec/minder/pkg/providers/v1"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/providers/github/webhook/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ import (
"github.com/mindersec/minder/internal/controlplane/metrics"
"github.com/mindersec/minder/internal/db"
"github.com/mindersec/minder/internal/entities/properties"
"github.com/mindersec/minder/internal/events"
"github.com/mindersec/minder/internal/providers/github/clients"
"github.com/mindersec/minder/internal/providers/github/installations"
"github.com/mindersec/minder/internal/providers/github/service"
"github.com/mindersec/minder/internal/reconcilers/messages"
pb "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1"
"github.com/mindersec/minder/pkg/events"
)

// installationEvent are events related the GitHub App. Minder uses
Expand Down
2 changes: 1 addition & 1 deletion internal/providers/github/webhook/fuzz_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"github.com/mindersec/minder/internal/config/server"
"github.com/mindersec/minder/internal/controlplane/metrics"
"github.com/mindersec/minder/internal/db"
"github.com/mindersec/minder/internal/events"
"github.com/mindersec/minder/pkg/events"
)

var eventTypes = [23]string{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ import (
entMsg "github.com/mindersec/minder/internal/entities/handlers/message"
"github.com/mindersec/minder/internal/entities/properties"
mock_service "github.com/mindersec/minder/internal/entities/properties/service/mock"
"github.com/mindersec/minder/internal/events"
"github.com/mindersec/minder/internal/providers/github/installations"
gf "github.com/mindersec/minder/internal/providers/github/mock/fixtures"
ghprop "github.com/mindersec/minder/internal/providers/github/properties"
ghService "github.com/mindersec/minder/internal/providers/github/service"
"github.com/mindersec/minder/internal/reconcilers/messages"
"github.com/mindersec/minder/internal/util/testqueue"
v1 "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1"
"github.com/mindersec/minder/pkg/events"
)

//go:embed test-payloads/installation-deleted.json
Expand Down
2 changes: 1 addition & 1 deletion internal/providers/github/webhook/handlers_packages.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import (
"github.com/mindersec/minder/internal/db"
entityMessage "github.com/mindersec/minder/internal/entities/handlers/message"
"github.com/mindersec/minder/internal/entities/properties"
"github.com/mindersec/minder/internal/events"
ghprop "github.com/mindersec/minder/internal/providers/github/properties"
pb "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1"
"github.com/mindersec/minder/pkg/events"
)

// packageEvent represent any event related to a repository and one of
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import (
"github.com/mindersec/minder/internal/db"
entityMessage "github.com/mindersec/minder/internal/entities/handlers/message"
"github.com/mindersec/minder/internal/entities/properties"
"github.com/mindersec/minder/internal/events"
ghprop "github.com/mindersec/minder/internal/providers/github/properties"
pb "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1"
"github.com/mindersec/minder/pkg/events"
)

// pullRequestEvent are events related to pull requests issued around
Expand Down
2 changes: 1 addition & 1 deletion internal/providers/github/webhook/handlers_repos.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import (
"github.com/mindersec/minder/internal/db"
entityMessage "github.com/mindersec/minder/internal/entities/handlers/message"
"github.com/mindersec/minder/internal/entities/properties"
"github.com/mindersec/minder/internal/events"
ghprop "github.com/mindersec/minder/internal/providers/github/properties"
pb "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1"
"github.com/mindersec/minder/pkg/events"
)

// repoEvent represents any event related to a repository.
Expand Down
2 changes: 1 addition & 1 deletion internal/providers/github/webhook/hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ import (
"github.com/mindersec/minder/internal/db"
"github.com/mindersec/minder/internal/engine/entities"
entMsg "github.com/mindersec/minder/internal/entities/handlers/message"
"github.com/mindersec/minder/internal/events"
"github.com/mindersec/minder/internal/providers/github/installations"
"github.com/mindersec/minder/internal/reconcilers/messages"
"github.com/mindersec/minder/pkg/events"
)

const (
Expand Down
Loading

0 comments on commit 63216b8

Please sign in to comment.