Skip to content

Commit

Permalink
Go 1.23 support, go-algorand-sdk dependency on develop commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
gmalouf committed Nov 14, 2024
1 parent e0fc340 commit 16d46ae
Show file tree
Hide file tree
Showing 17 changed files with 172 additions and 329 deletions.
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2.1

orbs:
go: circleci/go@1.7.3
go: circleci/go@1.12.0
slack: circleci/slack@4.7.1
codecov: codecov/codecov@3.2.4

Expand All @@ -18,7 +18,7 @@ workflows:
name: test_with_go_<< matrix.go_version >>
matrix: &go-version-matrix
parameters:
go_version: ["1.21.10"]
go_version: ["1.23.3"]

circleci_build_and_test_nightly:
triggers:
Expand All @@ -33,7 +33,7 @@ workflows:
context: lamprey-secrets
matrix: &go-version-matrix
parameters:
go_version: ["1.21.10"]
go_version: ["1.23.3"]
- indexer_vs_algod_nightly:
name: nightly_test_indexer_vs_algod
context: lamprey-secrets
Expand Down Expand Up @@ -135,7 +135,7 @@ commands:
steps:
- run:
name: Install golangci-lint
command: go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.53.2
command: go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.62.0

run_e2e_tests:
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.5.3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: git fetch --force --tags

- name: go dependency
uses: actions/setup-go@v4.0.1
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-type-category.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
name: Check PR Category and Type
steps:
- name: Checking for correct number of required github pr labels
uses: mheap/github-action-required-labels@v2
uses: mheap/github-action-required-labels@v5
with:
mode: exactly
count: 1
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3.5.3
uses: actions/checkout@v4
with:
fetch-depth: 0 # required for new-from-rev option in .golangci.yml
- name: Install specific golang
uses: actions/setup-go@v4.0.1
uses: actions/setup-go@v5
with:
go-version: '1.21.10'
go-version: '1.23.3'
- name: reviewdog-golangci-lint
uses: reviewdog/action-golangci-lint@v2.6.1
uses: reviewdog/action-golangci-lint@v2.6.2
with:
go_version_file: go.mod
golangci_lint_version: "v1.58.0"
golangci_lint_version: "v1.62.0"
golangci_lint_flags: "-c .golangci.yml --allow-parallel-runners"
reporter: "github-pr-check"
tool_name: "Lint Errors"
Expand All @@ -30,18 +30,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3.5.3
uses: actions/checkout@v4
with:
fetch-depth: 0 # required for new-from-rev option in .golangci.yml
- name: Install specific golang
uses: actions/setup-go@v4.0.1
uses: actions/setup-go@v5
with:
go-version: '1.21.10'
go-version: '1.23.3'
- name: reviewdog-golangci-lint
uses: reviewdog/action-golangci-lint@v2.6.1
uses: reviewdog/action-golangci-lint@v2.6.2
with:
go_version_file: go.mod
golangci_lint_version: "v1.58.0"
golangci_lint_version: "v1.62.0"
golangci_lint_flags: "-c .golangci-warnings.yml --allow-parallel-runners"
reporter: "github-pr-check"
tool_name: "Lint Warnings"
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ idb/postgres/internal/schema/setup_postgres_sql.go: idb/postgres/internal/schema
cd idb/postgres/internal/schema && go generate

idb/mocks/IndexerDb.go: idb/idb.go
go install github.com/vektra/mockery/v2@v2.20.0
go install github.com/vektra/mockery/v2@v2.47.0
cd idb && mockery --name=IndexerDb

# check that all packages (except tests) compile
Expand Down
4 changes: 2 additions & 2 deletions api/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ func (si *ServerImplementation) LookupApplicationBoxByIDAndName(ctx echo.Context

if len(boxes) == 0 { // this is an unexpected situation as should have received a sql.ErrNoRows from fetchApplicationBoxes's err
msg := fmt.Sprintf("%s: round=?=%d, appid=%d, boxName=%s", ErrFailedLookingUpBoxes, round, applicationID, encodedBoxName)
return indexerError(ctx, fmt.Errorf(msg))
return indexerError(ctx, errors.New(msg))
}

if appid != generated.ApplicationId(applicationID) {
Expand Down Expand Up @@ -668,7 +668,7 @@ func (si *ServerImplementation) SearchForApplicationBoxes(ctx echo.Context, appl

if len(boxes) == 0 { // this is an unexpected situation as should have received a sql.ErrNoRows from fetchApplicationBoxes's err
msg := fmt.Sprintf("%s: round=?=%d, appid=%d", errFailedSearchingBoxes, round, applicationID)
return indexerError(ctx, fmt.Errorf(msg))
return indexerError(ctx, errors.New(msg))
}

if appid != generated.ApplicationId(applicationID) {
Expand Down
2 changes: 1 addition & 1 deletion api/handlers_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1531,7 +1531,7 @@ func TestFetchBlockWithOptions(t *testing.T) {
}

for _, tc := range testCases {
t.Run(fmt.Sprintf(tc.name), func(t *testing.T) {
t.Run(tc.name, func(t *testing.T) {
c, api, rec := setupReq("/v2/blocks/:round-number", "round-number", "1")
if tc.name == "default" {
err = api.LookupBlock(c, 1, generated.LookupBlockParams{})
Expand Down
10 changes: 5 additions & 5 deletions config/datadir_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ func TestAlgodArgsForDataDirNetDoesNotExist(t *testing.T) {
func TestAlgodArgsForDataDirTokenDoesNotExist(t *testing.T) {
dir, err := os.MkdirTemp("", "datadir")
if err != nil {
t.Fatalf(err.Error())
t.Fatal(err.Error())
}
err = os.WriteFile(filepath.Join(dir, "algod.net"), []byte("127.0.0.1:8080"), fs.ModePerm)
if err != nil {
t.Fatalf(err.Error())
t.Fatal(err.Error())
}
defer os.RemoveAll(dir)
_, _, _, err = AlgodArgsForDataDir(dir)
Expand All @@ -34,15 +34,15 @@ func TestAlgodArgsForDataDirTokenDoesNotExist(t *testing.T) {
func TestAlgodArgsForDataDirSuccess(t *testing.T) {
dir, err := os.MkdirTemp("", "datadir")
if err != nil {
t.Fatalf(err.Error())
t.Fatal(err.Error())
}
err = os.WriteFile(filepath.Join(dir, "algod.net"), []byte("127.0.0.1:8080"), fs.ModePerm)
if err != nil {
t.Fatalf(err.Error())
t.Fatal(err.Error())
}
err = os.WriteFile(filepath.Join(dir, "algod.token"), []byte("abc123"), fs.ModePerm)
if err != nil {
t.Fatalf(err.Error())
t.Fatal(err.Error())
}
defer os.RemoveAll(dir)
netAddr, token, lastmod, err := AlgodArgsForDataDir(dir)
Expand Down
2 changes: 1 addition & 1 deletion e2e_tests/docker/indexer-filtered/e2e-read/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG GO_IMAGE=golang:1.21.10
ARG GO_IMAGE=golang:1.23.3
FROM $GO_IMAGE

RUN echo "Go image: $GO_IMAGE"
Expand Down
2 changes: 1 addition & 1 deletion e2e_tests/docker/indexer-filtered/e2e-write/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG GO_IMAGE=golang:1.21.10
ARG GO_IMAGE=golang:1.23.3
FROM $GO_IMAGE
ARG CHANNEL=stable
ARG CI_E2E_FILENAME
Expand Down
2 changes: 1 addition & 1 deletion e2e_tests/docker/indexer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG GO_IMAGE=golang:1.21.10
ARG GO_IMAGE=golang:1.213.3
FROM $GO_IMAGE
ARG CHANNEL=stable

Expand Down
40 changes: 18 additions & 22 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
module github.com/algorand/indexer/v3

go 1.21
go 1.23

toolchain go1.21.10
toolchain go1.23.3

require (
github.com/algorand/avm-abi v0.2.0
github.com/algorand/go-algorand-sdk/v2 v2.6.0
github.com/algorand/go-algorand-sdk/v2 v2.2.1-0.20241114170414-874d2110dae4
github.com/algorand/go-codec/codec v1.1.10
github.com/algorand/oapi-codegen v1.12.0-algorand.0
github.com/davecgh/go-spew v1.1.1
Expand All @@ -15,11 +15,11 @@ require (
github.com/jackc/pgerrcode v0.0.0-20201024163028-a0d42d470451
github.com/jackc/pgx/v4 v4.18.2
github.com/jarcoal/httpmock v1.2.0
github.com/labstack/echo-contrib v0.11.0
github.com/labstack/echo/v4 v4.9.1
github.com/labstack/echo-contrib v0.17.1
github.com/labstack/echo/v4 v4.12.0
github.com/orlangure/gnomock v0.31.0
github.com/pmezard/go-difflib v1.0.0
github.com/prometheus/client_golang v1.11.1
github.com/prometheus/client_golang v1.19.0
github.com/sirupsen/logrus v1.9.3
github.com/spf13/cobra v1.3.0
github.com/spf13/pflag v1.0.5
Expand Down Expand Up @@ -48,7 +48,6 @@ require (
github.com/go-openapi/swag v0.22.3 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
Expand All @@ -61,33 +60,30 @@ require (
github.com/jackc/pgtype v1.14.0 // indirect
github.com/jackc/puddle v1.3.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/kr/pretty v0.3.0 // indirect
github.com/labstack/gommon v0.4.0 // indirect
github.com/labstack/gommon v0.4.2 // indirect
github.com/lib/pq v1.10.9 // indirect
github.com/magiconair/properties v1.8.5 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/moby/docker-image-spec v1.3.1 // indirect
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.0.2 // indirect
github.com/pelletier/go-toml v1.9.4 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.26.0 // indirect
github.com/prometheus/procfs v0.6.0 // indirect
github.com/rogpeppe/go-internal v1.8.0 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.53.0 // indirect
github.com/prometheus/procfs v0.13.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/spf13/afero v1.6.0 // indirect
github.com/spf13/cast v1.4.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/stretchr/objx v0.5.2 // indirect
github.com/subosito/gotenv v1.2.0 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasttemplate v1.2.1 // indirect
github.com/valyala/fasttemplate v1.2.2 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 // indirect
go.opentelemetry.io/otel v1.28.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.28.0 // indirect
Expand All @@ -96,12 +92,12 @@ require (
go.opentelemetry.io/otel/trace v1.28.0 // indirect
go.uber.org/multierr v1.10.0 // indirect
go.uber.org/zap v1.27.0 // indirect
golang.org/x/crypto v0.27.0 // indirect
golang.org/x/crypto v0.29.0 // indirect
golang.org/x/net v0.29.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.25.0 // indirect
golang.org/x/text v0.18.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/sync v0.9.0 // indirect
golang.org/x/sys v0.27.0 // indirect
golang.org/x/text v0.20.0 // indirect
golang.org/x/time v0.5.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20241015192408-796eee8c2d53 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53 // indirect
google.golang.org/grpc v1.67.1 // indirect
Expand Down
Loading

0 comments on commit 16d46ae

Please sign in to comment.