Skip to content

Commit

Permalink
chore: upgrade Go-Akt to 2.1.0 and other dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Tochemey committed Jun 6, 2024
1 parent 8063cd9 commit 6dee4e3
Show file tree
Hide file tree
Showing 7 changed files with 77 additions and 75 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
password: ${{ secrets.DOCKERHUB_TOKEN}}
- uses: earthly/actions/setup-earthly@v1
with:
version: v0.7.19
version: v0.8.13
- name: Earthly version
run: earthly --version
- name: Run Linter and Tests
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
password: ${{ secrets.DOCKERHUB_TOKEN}}
- uses: earthly/actions/setup-earthly@v1
with:
version: v0.7.19
version: v0.8.13
- name: Earthly version
run: earthly --version
- name: Run Linter and Tests
Expand Down
6 changes: 4 additions & 2 deletions Earthfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
VERSION 0.7
VERSION 0.8

FROM tochemey/docker-go:1.21.0-1.0.0

RUN go install github.com/ory/go-acc@latest

protogen:
# copy the proto files to generate
COPY --dir protos/ ./
Expand Down Expand Up @@ -78,7 +80,7 @@ local-test:
FROM +vendor

WITH DOCKER --pull postgres:11
RUN go test -mod=vendor ./... -race -v -coverprofile=coverage.out -covermode=atomic -coverpkg=./...
RUN go-acc ./... -o coverage.out --ignore egopb,test,example -- -mod=vendor -race -v
END

SAVE ARTIFACT coverage.out AS LOCAL coverage.out
31 changes: 20 additions & 11 deletions engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,15 @@ import (
"github.com/pkg/errors"
"go.uber.org/atomic"

"github.com/tochemey/goakt/v2/actors"
"github.com/tochemey/goakt/v2/discovery"
"github.com/tochemey/goakt/v2/log"
"github.com/tochemey/goakt/v2/telemetry"

"github.com/tochemey/ego/v2/eventstore"
"github.com/tochemey/ego/v2/eventstream"
egotel "github.com/tochemey/ego/v2/internal/telemetry"
"github.com/tochemey/ego/v2/offsetstore"
"github.com/tochemey/ego/v2/projection"
"github.com/tochemey/goakt/v2/actors"
"github.com/tochemey/goakt/v2/discovery"
"github.com/tochemey/goakt/v2/log"
"github.com/tochemey/goakt/v2/telemetry"
)

// Engine represents the engine that empowers the various entities
Expand Down Expand Up @@ -99,13 +98,23 @@ func (x *Engine) Start(ctx context.Context) error {
x.hostName, _ = os.Hostname()
}

replicatCount := 1
if x.minimumPeersQuorum > 1 {
replicatCount = 2
}

clusterConfig := actors.
NewClusterConfig().
WithDiscovery(x.discoveryProvider).
WithGossipPort(x.gossipPort).
WithPeersPort(x.peersPort).
WithMinimumPeersQuorum(uint32(x.minimumPeersQuorum)).
WithReplicaCount(uint32(replicatCount)).
WithPartitionCount(x.partitionsCount).
WithKinds(new(actor[State]))

opts = append(opts,
actors.WithClustering(
x.discoveryProvider,
x.partitionsCount,
x.minimumPeersQuorum,
x.gossipPort,
x.peersPort),
actors.WithCluster(clusterConfig),
actors.WithRemoting(x.hostName, int32(x.remotingPort)))
}

Expand Down
5 changes: 2 additions & 3 deletions engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,13 @@ import (
"github.com/travisjeffery/go-dynaport"
"google.golang.org/protobuf/proto"

"github.com/tochemey/goakt/v2/log"
mockdisco "github.com/tochemey/goakt/v2/mocks/discovery"

"github.com/tochemey/ego/v2/egopb"
"github.com/tochemey/ego/v2/eventstore/memory"
samplepb "github.com/tochemey/ego/v2/example/pbs/sample/pb/v1"
offsetstore "github.com/tochemey/ego/v2/offsetstore/memory"
"github.com/tochemey/ego/v2/projection"
"github.com/tochemey/goakt/v2/log"
mockdisco "github.com/tochemey/goakt/v2/mocks/discovery"
)

func TestEgo(t *testing.T) {
Expand Down
34 changes: 15 additions & 19 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ module github.com/tochemey/ego/v2

go 1.21

toolchain go1.21.4

require (
github.com/Masterminds/squirrel v1.5.4
github.com/deckarep/golang-set/v2 v2.6.0
Expand All @@ -12,7 +10,7 @@ require (
github.com/hashicorp/go-memdb v1.3.4
github.com/pkg/errors v0.9.1
github.com/stretchr/testify v1.9.0
github.com/tochemey/goakt/v2 v2.0.0
github.com/tochemey/goakt/v2 v2.1.0
github.com/tochemey/gopack v0.0.0-20240303193017-58b82904de1b
github.com/travisjeffery/go-dynaport v1.0.0
go.opentelemetry.io/otel v1.27.0
Expand All @@ -27,11 +25,10 @@ require (
connectrpc.com/connect v1.16.2 // indirect
connectrpc.com/otelconnect v0.7.0 // indirect
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 // indirect
github.com/RoaringBitmap/roaring v1.9.3 // indirect
github.com/XSAM/otelsql v0.29.0 // indirect
github.com/alphadose/haxmap v1.4.0 // indirect
github.com/RoaringBitmap/roaring v1.9.4 // indirect
github.com/XSAM/otelsql v0.31.0 // indirect
github.com/armon/go-metrics v0.4.1 // indirect
github.com/bits-and-blooms/bitset v1.13.0 // indirect
github.com/buraksezer/consistent v0.10.0 // indirect
Expand All @@ -43,9 +40,9 @@ require (
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/docker/go-connections v0.5.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/emicklei/go-restful/v3 v3.12.0 // indirect
github.com/georgysavva/scany/v2 v2.1.0 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/emicklei/go-restful/v3 v3.12.1 // indirect
github.com/georgysavva/scany/v2 v2.1.3 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/jsonpointer v0.21.0 // indirect
github.com/go-openapi/jsonreference v0.21.0 // indirect
Expand Down Expand Up @@ -80,7 +77,7 @@ require (
github.com/opencontainers/runc v1.1.12 // indirect
github.com/ory/dockertest v3.3.5+incompatible // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/redis/go-redis/v9 v9.5.1 // indirect
github.com/redis/go-redis/v9 v9.5.2 // indirect
github.com/reugn/go-quartz v0.12.0 // indirect
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
Expand All @@ -94,15 +91,14 @@ require (
go.opentelemetry.io/otel/metric v1.27.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/net v0.25.0 // indirect
golang.org/x/oauth2 v0.20.0 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/term v0.20.0 // indirect
golang.org/x/text v0.15.0 // indirect
golang.org/x/mod v0.18.0 // indirect
golang.org/x/net v0.26.0 // indirect
golang.org/x/oauth2 v0.21.0 // indirect
golang.org/x/sys v0.21.0 // indirect
golang.org/x/term v0.21.0 // indirect
golang.org/x/text v0.16.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.21.0 // indirect
golang.org/x/tools v0.22.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
Loading

0 comments on commit 6dee4e3

Please sign in to comment.