Skip to content

Bump golangci to v1.39.0 #4241

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/test-build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
lint:
runs-on: ubuntu-latest
container:
image: quay.io/cortexproject/build-image:build-image-multiarch-1d2497ff6
image: quay.io/cortexproject/build-image:golangci-update-pr-4241-40550805d
steps:
- name: Checkout Repo
uses: actions/checkout@v2
Expand All @@ -34,7 +34,7 @@ jobs:
test:
runs-on: ubuntu-latest
container:
image: quay.io/cortexproject/build-image:build-image-multiarch-1d2497ff6
image: quay.io/cortexproject/build-image:golangci-update-pr-4241-40550805d
services:
cassandra:
image: cassandra:3.11
Expand All @@ -55,7 +55,7 @@ jobs:
build:
runs-on: ubuntu-latest
container:
image: quay.io/cortexproject/build-image:build-image-multiarch-1d2497ff6
image: quay.io/cortexproject/build-image:golangci-update-pr-4241-40550805d
steps:
- name: Checkout Repo
uses: actions/checkout@v2
Expand Down Expand Up @@ -174,14 +174,14 @@ jobs:
run: |
touch build-image/.uptodate
MIGRATIONS_DIR=$(pwd)/cmd/cortex/migrations
make BUILD_IMAGE=quay.io/cortexproject/build-image:build-image-multiarch-1d2497ff6 TTY='' configs-integration-test
make BUILD_IMAGE=quay.io/cortexproject/build-image:golangci-update-pr-4241-40550805d TTY='' configs-integration-test

deploy_website:
needs: [build, test]
if: (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')) && github.repository == 'cortexproject/cortex'
runs-on: ubuntu-latest
container:
image: quay.io/cortexproject/build-image:build-image-multiarch-1d2497ff6
image: quay.io/cortexproject/build-image:golangci-update-pr-4241-40550805d
steps:
- name: Checkout Repo
uses: actions/checkout@v2
Expand Down Expand Up @@ -218,7 +218,7 @@ jobs:
if: (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')) && github.repository == 'cortexproject/cortex'
runs-on: ubuntu-latest
container:
image: quay.io/cortexproject/build-image:build-image-multiarch-1d2497ff6
image: quay.io/cortexproject/build-image:golangci-update-pr-4241-40550805d
steps:
- name: Checkout Repo
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion build-image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ RUN GOARCH=$(go env GOARCH) && \
chmod +x shfmt && \
mv shfmt /usr/bin

RUN curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b /usr/bin v1.27.0
RUN curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b /usr/bin v1.39.0

RUN GO111MODULE=on go get \
github.com/client9/misspell/cmd/[email protected] \
Expand Down
24 changes: 12 additions & 12 deletions pkg/chunk/purger/purger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,9 +383,9 @@ func TestPurger_Restarts(t *testing.T) {
}

func TestPurger_Metrics(t *testing.T) {
deleteStore, chunkStore, storageClient, purger, registry := setupStoresAndPurger(t)
deleteStore, chunkStore, storageClient, purger1, _ := setupStoresAndPurger(t)
defer func() {
purger.StopAsync()
purger1.StopAsync()
chunkStore.Stop()
}()

Expand All @@ -406,22 +406,22 @@ func TestPurger_Metrics(t *testing.T) {
require.NoError(t, err)

// load new delete requests for processing
require.NoError(t, purger.pullDeleteRequestsToPlanDeletes())
require.NoError(t, purger1.pullDeleteRequestsToPlanDeletes())

// there must be 2 pending delete requests, oldest being 2 days old since its cancellation time is over
require.InDelta(t, float64(2*86400), testutil.ToFloat64(purger.metrics.oldestPendingDeleteRequestAgeSeconds), 1)
require.Equal(t, float64(2), testutil.ToFloat64(purger.metrics.pendingDeleteRequestsCount))
require.InDelta(t, float64(2*86400), testutil.ToFloat64(purger1.metrics.oldestPendingDeleteRequestAgeSeconds), 1)
require.Equal(t, float64(2), testutil.ToFloat64(purger1.metrics.pendingDeleteRequestsCount))

// stop the existing purger
require.NoError(t, services.StopAndAwaitTerminated(context.Background(), purger))
require.NoError(t, services.StopAndAwaitTerminated(context.Background(), purger1))

// create a new purger
purger, registry = setupPurger(t, deleteStore, chunkStore, storageClient)
purger2, registry := setupPurger(t, deleteStore, chunkStore, storageClient)

// load in process delete requests by starting the service
require.NoError(t, services.StartAndAwaitRunning(context.Background(), purger))
require.NoError(t, services.StartAndAwaitRunning(context.Background(), purger2))

defer purger.StopAsync()
defer purger2.StopAsync()

// wait until purger_delete_requests_processed_total starts to show up.
test.Poll(t, 2*time.Second, 1, func() interface{} {
Expand All @@ -432,17 +432,17 @@ func TestPurger_Metrics(t *testing.T) {

// wait until both the pending delete requests are processed.
test.Poll(t, 2*time.Second, float64(2), func() interface{} {
return testutil.ToFloat64(purger.metrics.deleteRequestsProcessedTotal)
return testutil.ToFloat64(purger2.metrics.deleteRequestsProcessedTotal)
})

// wait until oldest pending request age becomes 0
test.Poll(t, 2*time.Second, float64(0), func() interface{} {
return testutil.ToFloat64(purger.metrics.oldestPendingDeleteRequestAgeSeconds)
return testutil.ToFloat64(purger2.metrics.oldestPendingDeleteRequestAgeSeconds)
})

// wait until pending delete requests count becomes 0
test.Poll(t, 2*time.Second, float64(0), func() interface{} {
return testutil.ToFloat64(purger.metrics.pendingDeleteRequestsCount)
return testutil.ToFloat64(purger2.metrics.pendingDeleteRequestsCount)
})
}

Expand Down
4 changes: 1 addition & 3 deletions pkg/util/validation/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ import (
)

// ValidationError is an error returned by series validation.
//
// nolint:golint ignore stutter warning
type ValidationError error
type ValidationError error // nolint: golint ignore stutter warning

// genericValidationError is a basic implementation of ValidationError which can be used when the
// error format only contains the cause and the series.
Expand Down
3 changes: 1 addition & 2 deletions pkg/util/validation/limits_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,7 @@ func TestOverridesManager_GetOverrides(t *testing.T) {

// Update limits for tenant user1. We only update single field, the rest is copied from defaults.
// (That is how limits work when loaded from YAML)
l := Limits{}
l = defaults
l := defaults
l.MaxLabelValueLength = 150

tenantLimits["user1"] = &l
Expand Down