Skip to content

Commit

Permalink
upgrade(go): update go version to 1.22 (#9058)
Browse files Browse the repository at this point in the history
fixes tests to use `docker compose` instead of `docker-compose`

---------

Co-authored-by: Aman Mangal <[email protected]>
Co-authored-by: Harshil Goel <[email protected]>
  • Loading branch information
3 people authored Mar 23, 2024
1 parent 5ef9ae6 commit 4072134
Show file tree
Hide file tree
Showing 15 changed files with 1,316 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .go-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.19
1.22
10 changes: 5 additions & 5 deletions contrib/local-test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ DGRAPH_VERSION ?= local
current_dir = $(shell pwd)

up: ## Start the zero and alpha containers
DGRAPH_VERSION=$(DGRAPH_VERSION) docker-compose up -d && docker-compose logs --follow alpha zero keepalive
DGRAPH_VERSION=$(DGRAPH_VERSION) docker compose up -d && docker compose logs --follow alpha zero keepalive

up-with-lambda: ## Start the zero and alpha containers and a lambda container
DGRAPH_VERSION=$(DGRAPH_VERSION) docker-compose -f docker-compose.yml -f docker-compose-lambda.yml up -d && docker-compose logs --follow alpha zero lambda keepalive
DGRAPH_VERSION=$(DGRAPH_VERSION) docker compose -f docker-compose.yml -f docker-compose-lambda.yml up -d && docker compose logs --follow alpha zero lambda keepalive

down: ## Stop the containers
DGRAPH_VERSION=$(DGRAPH_VERSION) docker-compose stop
DGRAPH_VERSION=$(DGRAPH_VERSION) docker compose stop

down-with-lambda: ## Stop the containers (including the lambda container)
DGRAPH_VERSION=$(DGRAPH_VERSION) docker-compose -f docker-compose.yml -f docker-compose-lambda.yml stop
DGRAPH_VERSION=$(DGRAPH_VERSION) docker compose -f docker-compose.yml -f docker-compose-lambda.yml stop

refresh: ## Kick containers if new dgragh image found
DGRAPH_VERSION=$(DGRAPH_VERSION) docker-compose up --detach --build
DGRAPH_VERSION=$(DGRAPH_VERSION) docker compose up --detach --build

schema-dql: ## Load/update a DQL schema
ifneq (,$(wildcard ./schema.dql))
Expand Down
6 changes: 6 additions & 0 deletions dgraphtest/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,18 @@ type ClusterConfig struct {
uidLease int
portOffset int // exposed port offset for grpc/http port for both alpha/zero
bulkOutDir string
lambdaURL string
featureFlags []string
customPlugins bool
snapShotAfterEntries uint64
snapshotAfterDuration time.Duration
}

func (cc ClusterConfig) WithGraphqlLambdaURL(url string) ClusterConfig {
cc.lambdaURL = url
return cc
}

// NewClusterConfig generates a default ClusterConfig
func NewClusterConfig() ClusterConfig {
prefix := fmt.Sprintf("dgraphtest-%d", rand.NewSource(time.Now().UnixNano()).Int63()%1000000)
Expand Down
4 changes: 4 additions & 0 deletions dgraphtest/dgraph.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,10 @@ func (a *alpha) cmd(c *LocalCluster) []string {
"--telemetry=reports=false;sentry=false;")
}

if c.conf.lambdaURL != "" {
acmd = append(acmd, fmt.Sprintf(`--graphql=lambda-url=%s`, c.conf.lambdaURL))
}

if c.conf.acl {
if c.lowerThanV21 {
acmd = append(acmd, fmt.Sprintf(`--acl_secret_file=%s`, aclSecretMountPath),
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/dgraph-io/dgraph

go 1.19
go 1.22

replace sourcegraph.com/sourcegraph/appdash => github.com/sourcegraph/appdash v0.0.0-20180110180208-2cc67fd64755

Expand Down Expand Up @@ -65,6 +65,7 @@ require (
golang.org/x/text v0.14.0
golang.org/x/tools v0.18.0
google.golang.org/grpc v1.62.1
google.golang.org/protobuf v1.33.0
gopkg.in/square/go-jose.v2 v2.3.1
gopkg.in/yaml.v2 v2.4.0
)
Expand Down Expand Up @@ -146,7 +147,6 @@ require (
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240311173647-c811ad7063a7 // indirect
google.golang.org/grpc/examples v0.0.0-20230821201920-d51b3f41716d // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/DataDog/dd-trace-go.v1 v1.22.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
10 changes: 7 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7
github.com/99designs/gqlgen v0.13.0/go.mod h1:NV130r6f4tpRWuAI+zsrSdooO/eWUv+Gyyoi3rEfXIk=
github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8=
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8=
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
Expand Down Expand Up @@ -125,6 +126,7 @@ github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGX
github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
github.com/cockroachdb/datadriven v1.0.2 h1:H9MtNqVoVhvd9nCBwOyDjUEdZCREqbIdCJD93PBm/jA=
github.com/cockroachdb/datadriven v1.0.2/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU=
github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM=
github.com/containerd/continuity v0.0.0-20181203112020-004b46473808/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y=
github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
Expand All @@ -151,9 +153,6 @@ github.com/dgraph-io/dgo/v230 v230.0.2-0.20240314155021-7b8d289e37f3 h1:SmlpAiFh
github.com/dgraph-io/dgo/v230 v230.0.2-0.20240314155021-7b8d289e37f3/go.mod h1:N63npbH9PPVitTNUW4xlT66LNsMhqjuz57ZvgUmgATI=
github.com/dgraph-io/gqlgen v0.13.2 h1:TNhndk+eHKj5qE7BenKKSYdSIdOGhLqxR1rCiMso9KM=
github.com/dgraph-io/gqlgen v0.13.2/go.mod h1:iCOrOv9lngN7KAo+jMgvUPVDlYHdf7qDwsTkQby2Sis=
github.com/dgraph-io/gqlparser/v2 v2.1.1/go.mod h1:MYS4jppjyx8b9tuUtjV7jU1UFZK6P9fvO8TsIsQtRKU=
github.com/dgraph-io/gqlparser/v2 v2.2.1 h1:15msK9XEHOSrRqQO48UU+2ZTf1R1U8+tfL9H5D5/eQQ=
github.com/dgraph-io/gqlparser/v2 v2.2.1/go.mod h1:MYS4jppjyx8b9tuUtjV7jU1UFZK6P9fvO8TsIsQtRKU=
github.com/dgraph-io/graphql-transport-ws v0.0.0-20210511143556-2cef522f1f15 h1:X2NRsgAtVUAp2nmTPCq+x+wTcRRrj74CEpy7E0Unsl4=
github.com/dgraph-io/graphql-transport-ws v0.0.0-20210511143556-2cef522f1f15/go.mod h1:7z3c/5w0sMYYZF5bHsrh8IH4fKwG5O5Y70cPH1ZLLRQ=
github.com/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8=
Expand Down Expand Up @@ -202,6 +201,7 @@ github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga
github.com/flosch/pongo2 v0.0.0-20190707114632-bbf5a6c351f4/go.mod h1:T9YF2M40nIgbVgp3rreNmTged+9HrbNTIQf1PsaIiTA=
github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k=
github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw=
github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g=
github.com/frankban/quicktest v1.10.2 h1:19ARM85nVi4xH7xPXuc5eM/udya5ieh7b/Sv+d844Tk=
github.com/frankban/quicktest v1.10.2/go.mod h1:K+q6oSqb0W0Ininfk863uOk1lMy69l/P6txr3mVT54s=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
Expand Down Expand Up @@ -451,6 +451,7 @@ github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFB
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
Expand Down Expand Up @@ -645,6 +646,7 @@ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
github.com/stretchr/testify v1.2.1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
Expand Down Expand Up @@ -698,6 +700,7 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
go.etcd.io/etcd/client/pkg/v3 v3.5.9 h1:oidDC4+YEuSIQbsR94rY9gur91UPL6DnxDCIYd2IGsE=
go.etcd.io/etcd/client/pkg/v3 v3.5.9/go.mod h1:y+CzeSmkMpWN2Jyu1npecjB9BBnABxGM4pN8cGuJeL4=
go.etcd.io/etcd/raft/v3 v3.5.9 h1:ZZ1GIHoUlHsn0QVqiRysAm3/81Xx7+i2d7nSdWxlOiI=
go.etcd.io/etcd/raft/v3 v3.5.9/go.mod h1:WnFkqzFdZua4LVlVXQEGhmooLeyS7mqzS4Pf4BCVqXg=
go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
Expand Down Expand Up @@ -1124,6 +1127,7 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE=
Expand Down
7 changes: 3 additions & 4 deletions graphql/e2e/common/error_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,12 @@
gqlvariables: |
{ "filter": "type was wrong" }
errors:
[
[ { "message": "Variable type provided AuthorFiltarzzz! is incompatible with expected
type AuthorFilter",
"locations": [{ "line": 2, "column": 23}]},
{ "message": "Variable \"$filter\" of type \"AuthorFiltarzzz!\" used in position
expecting type \"AuthorFilter\".",
"locations": [ { "line": 2, "column": 23 } ] },
{ "message": "Variable type provided AuthorFiltarzzz! is incompatible with expected
type AuthorFilter",
"locations": [{ "line": 2, "column": 23}]},
{ "message": "Unknown type \"AuthorFiltarzzz\".",
"locations": [ { "line": 1, "column": 1 } ] } ]

Expand Down
6 changes: 3 additions & 3 deletions graphql/resolve/validate_mutation_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
explanation: "Add mutation expects an array instead of an object"
validationerror:
{ "message":
"input:2: Variable \"$auth\" of type \"AddAuthorInput!\" used in
position expecting type \"[AddAuthorInput!]!\".\ninput:2: Variable type provided AddAuthorInput! is incompatible with expected type
[AddAuthorInput!]!\n" }
"input:2: Variable type provided AddAuthorInput! is incompatible with expected type
[AddAuthorInput!]!\ninput:2: Variable \"$auth\" of type \"AddAuthorInput!\" used in
position expecting type \"[AddAuthorInput!]!\".\n" }


-
Expand Down
4 changes: 2 additions & 2 deletions graphql/schema/rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ import (
)

const (
baseRules = 0
listCoercionRules = 1000
baseRules = -2
listCoercionRules = -1
)

func init() {
Expand Down
2 changes: 1 addition & 1 deletion systest/1million/test-reindex.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function Info {
}

function DockerCompose {
docker-compose -p dgraph "$@"
docker compose -p dgraph "$@"
}

Info "cloning benchmarks repo"
Expand Down
2 changes: 1 addition & 1 deletion systest/21million/test-21million.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function Info {
}

function DockerCompose {
docker-compose -p dgraph "$@"
docker compose -p dgraph "$@"
}
function DgraphLive {
dgraph live "$@"
Expand Down
Loading

0 comments on commit 4072134

Please sign in to comment.