Skip to content

Commit

Permalink
Merge branch 'main' into renovate/docker.elastic.co-elasticsearch-ela…
Browse files Browse the repository at this point in the history
…sticsearch-8.x
  • Loading branch information
yurishkuro authored Aug 14, 2024
2 parents 559561b + 3870291 commit dbba738
Show file tree
Hide file tree
Showing 43 changed files with 166 additions and 143 deletions.
2 changes: 1 addition & 1 deletion .github/actions/setup-go-tip/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ runs:
if: steps.download.outputs.success == 'false'
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: 1.22.x
go-version: 1.23.x

- name: Build Go Tip from source
if: steps.download.outputs.success == 'false'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-build-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: 1.22.x
go-version: 1.23.x

- name: Setup Node.js version
uses: ./.github/actions/setup-node.js
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-crossdock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: 1.22.x
go-version: 1.23.x

- name: Export BRANCH variable
uses: ./.github/actions/setup-branch
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-docker-all-in-one.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: 1.22.x
go-version: 1.23.x

- name: Setup Node.js version
uses: ./.github/actions/setup-node.js
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: 1.22.x
go-version: 1.23.x

- name: Setup Node.js version
uses: ./.github/actions/setup-node.js
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-docker-hotrod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: 1.22.x
go-version: 1.23.x

- name: Export BRANCH variable
uses: ./.github/actions/setup-branch
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-e2e-badger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: 1.22.x
go-version: 1.23.x

- name: Run Badger storage integration tests
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-e2e-cassandra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:

- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: 1.22.x
go-version: 1.23.x

- name: Run cassandra integration tests
id: test-execution
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-e2e-elasticsearch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: 1.22.x
go-version: 1.23.x

- uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0
- name: Run ${{ matrix.version.distribution }} integration tests
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-e2e-grpc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: 1.22.x
go-version: 1.23.x

- name: Run gRPC storage integration tests
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-e2e-kafka.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:

- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: 1.22.x
go-version: 1.23.x

- name: Run Kafka integration tests
id: test-execution
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-e2e-memory.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:

- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: 1.22.x
go-version: 1.23.x

- name: Run Memory storage integration tests
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-e2e-opensearch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: 1.22.x
go-version: 1.23.x

- uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-e2e-spm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: 1.22.x
go-version: 1.23.x

- name: Setup Node.js version
uses: ./.github/actions/setup-node.js
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-lint-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:

- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: 1.22.x
go-version: 1.23.x

- name: Print Jaeger version
run: make echo-version
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-lint-protogen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:

- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: 1.22.x
go-version: 1.23.x

- name: Verify Protobuf types are up to date
run: make proto && git diff --name-status --exit-code
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: 1.22.x
go-version: 1.23.x

- name: Setup Node.js version
uses: ./.github/actions/setup-node.js
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:

- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: 1.22.x
go-version: 1.23.x
cache-dependency-path: ./go.sum

# download dependencies separately to keep unit test step's output cleaner
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/fossa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:

- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: 1.22.x
go-version: 1.23.x

- name: Add GOPATH
run: |
Expand Down
5 changes: 4 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,9 @@ linters-settings:
# looks useful, but requires refactoring: "calls to log.Fatal only in main() or init() functions"
- name: deep-exit
disabled: true
# this rule conflicts with nolintlint which does insist on no-space in //nolint
- name: comment-spacings
disabled: true
testifylint:
disable:
- float-compare
Expand All @@ -237,5 +240,5 @@ linters-settings:
- suite-extra-assert-call

run:
go: "1.21"
go: "1.22"
timeout: 20m
36 changes: 28 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,6 @@ nocover:
@echo Verifying that all packages have test files to count in coverage
@scripts/check-test-files.sh $(ALL_PKGS)

.PHONY: goleak
goleak:
@echo Verifying that all packages with tests have goleak in their TestMain
@scripts/check-goleak-files.sh $(ALL_PKGS)

.PHONY: fmt
fmt: $(GOFUMPT)
@echo Running import-order-cleanup on ALL_SRC ...
Expand All @@ -196,12 +191,35 @@ fmt: $(GOFUMPT)
@./scripts/updateLicense.py $(ALL_SRC) $(SCRIPTS_SRC)

.PHONY: lint
lint: $(LINT) goleak
lint: lint-license lint-imports lint-semconv lint-goversion lint-goleak lint-go

.PHONY: lint-license
lint-license:
@echo Verifying that all files have license headers
@./scripts/updateLicense.py $(ALL_SRC) $(SCRIPTS_SRC) > $(FMT_LOG)
@[ ! -s "$(FMT_LOG)" ] || (echo "License check failures, run 'make fmt'" | cat - $(FMT_LOG) && false)

.PHONY: lint-imports
lint-imports:
@echo Verifying that all Go files have correctly ordered imports
@./scripts/import-order-cleanup.py -o stdout -t $(ALL_SRC) > $(IMPORT_LOG)
@[ ! -s "$(FMT_LOG)" -a ! -s "$(IMPORT_LOG)" ] || (echo "License check or import ordering failures, run 'make fmt'" | cat - $(FMT_LOG) $(IMPORT_LOG) && false)
@[ ! -s "$(IMPORT_LOG)" ] || (echo "Import ordering failures, run 'make fmt'" | cat - $(IMPORT_LOG) && false)

.PHONY: lint-semconv
lint-semconv:
./scripts/check-semconv-version.sh

.PHONY: lint-goversion
lint-goversion:
./scripts/check-go-version.sh

.PHONY: lint-goleak
lint-goleak:
@echo Verifying that all packages with tests have goleak in their TestMain
@scripts/check-goleak-files.sh $(ALL_PKGS)

.PHONY: lint-go
lint-go: $(LINT)
$(LINT) -v run

.PHONY: build-examples
Expand Down Expand Up @@ -475,8 +493,10 @@ init-submodules:

MOCKERY_FLAGS := --all --disable-version-string
.PHONY: generate-mocks
# TODO remove GODEBUG=gotypesalias=0
# once this is fixed: https://github.com/vektra/mockery/issues/803
generate-mocks: $(MOCKERY)
$(MOCKERY)
GODEBUG=gotypesalias=0 $(MOCKERY)

.PHONY: certs
certs:
Expand Down
2 changes: 1 addition & 1 deletion cmd/collector/app/handler/grpc_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func (c *batchConsumer) consume(ctx context.Context, batch *model.Batch) error {
})
if err != nil {
if errors.Is(err, processor.ErrBusy) {
return status.Errorf(codes.ResourceExhausted, err.Error())
return status.Error(codes.ResourceExhausted, err.Error())
}
c.logger.Error("cannot process spans", zap.Error(err))
return err
Expand Down
2 changes: 1 addition & 1 deletion cmd/collector/app/span_processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ func TestSpanProcessorCountSpan(t *testing.T) {
time.Second,
time.Millisecond,
)
assert.Greater(t, p.spansProcessed.Load(), uint64(0))
assert.Positive(t, p.spansProcessed.Load())
}

for i := 0; i < 10000; i++ {
Expand Down
4 changes: 2 additions & 2 deletions cmd/ingester/app/consumer/deadlock_detector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func TestNoClosingSignalIfMessagesProcessedInInterval(t *testing.T) {
w := f.startMonitoringForPartition(1)

w.incrementMsgCount()
assert.Zero(t, len(w.closePartitionChannel()))
assert.Empty(t, w.closePartitionChannel())
w.close()
}

Expand Down Expand Up @@ -160,6 +160,6 @@ func TestApiCompatibilityWhenDeadlockDetectorDisabled(t *testing.T) {

w.incrementMsgCount()
w.incrementAllPartitionMsgCount()
assert.Zero(t, len(w.closePartitionChannel()))
assert.Empty(t, w.closePartitionChannel())
w.close()
}
5 changes: 3 additions & 2 deletions cmd/query/app/apiv3/grpc_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package apiv3

import (
"context"
"errors"
"fmt"

"github.com/gogo/protobuf/types"
Expand Down Expand Up @@ -59,11 +60,11 @@ func (h *Handler) GetTrace(request *api_v3.GetTraceRequest, stream api_v3.QueryS
func (h *Handler) FindTraces(request *api_v3.FindTracesRequest, stream api_v3.QueryService_FindTracesServer) error {
query := request.GetQuery()
if query == nil {
return status.Errorf(codes.InvalidArgument, "missing query")
return status.Error(codes.InvalidArgument, "missing query")
}
if query.GetStartTimeMin() == nil ||
query.GetStartTimeMax() == nil {
return fmt.Errorf("start time min and max are required parameters")
return errors.New("start time min and max are required parameters")
}

queryParams := &spanstore.TraceQueryParameters{
Expand Down
13 changes: 7 additions & 6 deletions cmd/query/app/apiv3/http_gateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package apiv3

import (
"errors"
"fmt"
"io"
"net/http"
Expand Down Expand Up @@ -105,7 +106,7 @@ func TestHTTPGatewayTryHandleError(t *testing.T) {
gw.Logger = logger
w = httptest.NewRecorder()
const e = "some err"
assert.True(t, gw.tryHandleError(w, fmt.Errorf(e), http.StatusInternalServerError))
assert.True(t, gw.tryHandleError(w, errors.New(e), http.StatusInternalServerError))
assert.Contains(t, log.String(), e, "logs error if status code is 500")
assert.Contains(t, string(w.Body.String()), e, "writes error message to body")
}
Expand All @@ -118,7 +119,7 @@ func TestHTTPGatewayOTLPError(t *testing.T) {
const simErr = "simulated error"
gw.returnSpansTestable(nil, w,
func(_ []*model.Span) (ptrace.Traces, error) {
return ptrace.Traces{}, fmt.Errorf(simErr)
return ptrace.Traces{}, errors.New(simErr)
},
)
assert.Contains(t, w.Body.String(), simErr)
Expand All @@ -138,7 +139,7 @@ func TestHTTPGatewayGetTraceErrors(t *testing.T) {
const simErr = "simulated error"
gw.reader.
On("GetTrace", matchContext, matchTraceID).
Return(nil, fmt.Errorf(simErr)).Once()
Return(nil, errors.New(simErr)).Once()

r, err = http.NewRequest(http.MethodGet, "/api/v3/traces/123", nil)
require.NoError(t, err)
Expand Down Expand Up @@ -247,7 +248,7 @@ func TestHTTPGatewayFindTracesErrors(t *testing.T) {
gw := setupHTTPGatewayNoServer(t, "", tenancy.Options{})
gw.reader.
On("FindTraces", matchContext, qp).
Return(nil, fmt.Errorf(simErr)).Once()
Return(nil, errors.New(simErr)).Once()

gw.router.ServeHTTP(w, r)
assert.Contains(t, w.Body.String(), simErr)
Expand All @@ -260,7 +261,7 @@ func TestHTTPGatewayGetServicesErrors(t *testing.T) {
const simErr = "simulated error"
gw.reader.
On("GetServices", matchContext).
Return(nil, fmt.Errorf(simErr)).Once()
Return(nil, errors.New(simErr)).Once()

r, err := http.NewRequest(http.MethodGet, "/api/v3/services", nil)
require.NoError(t, err)
Expand All @@ -276,7 +277,7 @@ func TestHTTPGatewayGetOperationsErrors(t *testing.T) {
const simErr = "simulated error"
gw.reader.
On("GetOperations", matchContext, qp).
Return(nil, fmt.Errorf(simErr)).Once()
Return(nil, errors.New(simErr)).Once()

r, err := http.NewRequest(http.MethodGet, "/api/v3/operations?service=foo&span_kind=server", nil)
require.NoError(t, err)
Expand Down
6 changes: 3 additions & 3 deletions cmd/query/app/http_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -428,9 +428,9 @@ func TestSearchByTraceIDNotFound(t *testing.T) {

func TestSearchByTraceIDFailure(t *testing.T) {
ts := initializeTestServer(t)
whatsamattayou := "https://youtu.be/WrKFOCg13QQ"
whatsamattayou := "whatsamattayou"
ts.spanReader.On("GetTrace", mock.AnythingOfType("*context.valueCtx"), mock.AnythingOfType("model.TraceID")).
Return(nil, fmt.Errorf(whatsamattayou)).Once()
Return(nil, errors.New(whatsamattayou)).Once()

var response structuredResponse
err := getJSON(ts.server.URL+`/api/traces?traceID=1`, &response)
Expand Down Expand Up @@ -763,7 +763,7 @@ func TestMetricsReaderError(t *testing.T) {
tc.mockedQueryMethod,
mock.AnythingOfType("*context.valueCtx"),
mock.AnythingOfType(tc.mockedQueryMethodParamType),
).Return(tc.mockedResponse, fmt.Errorf(tc.wantErrorMessage)).Once()
).Return(tc.mockedResponse, errors.New(tc.wantErrorMessage)).Once()

// Test
var response metrics.MetricFamily
Expand Down
Loading

0 comments on commit dbba738

Please sign in to comment.