Skip to content

[release/1.2 backport] Switch from gometalinter to golangci-lint - #4061

Merged
fuweid merged 4 commits into
containerd:release/1.2from
thaJeztah:1.2_backport_golang_ci_lint
Feb 27, 2020
Merged

fuweid merged 4 commits into
containerd:release/1.2from
thaJeztah:1.2_backport_golang_ci_lint

Conversation

@thaJeztah

Copy link
Copy Markdown
Member

backport of:

Signed-off-by: Maksym Pavlenko <[email protected]>
(cherry picked from commit ef7f46e)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah thaJeztah changed the title [release/1.2] Switch from gometalinter to golangci-lint [release/1.2 backport] Switch from gometalinter to golangci-lint Feb 26, 2020
@thaJeztah

This comment has been minimized.

@thaJeztah
thaJeztah force-pushed the 1.2_backport_golang_ci_lint branch from da45a25 to 38be30b Compare February 26, 2020 22:53
Comment thread content/local/store.go Outdated
Comment on lines 549 to 553

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These were fixed as part of #3160 in master, but that was a bigger change (#3191 could've been used, but it wasn't merged in favour of the other one 😂)

@thaJeztah

This comment has been minimized.

@thaJeztah
thaJeztah force-pushed the 1.2_backport_golang_ci_lint branch from 38be30b to a5d62cc Compare February 27, 2020 10:42
@thaJeztah

Copy link
Copy Markdown
Member Author

Failure on Windows is

Details
[00:10:41] --- FAIL: TestContentClient (8.07s)
[00:10:41]     --- PASS: TestContentClient/Writer (0.15s)
[00:10:41]     --- PASS: TestContentClient/UpdateStatus (0.04s)
[00:10:41]     --- PASS: TestContentClient/CommitExists (0.09s)
[00:10:41]     --- PASS: TestContentClient/Resume (0.06s)
[00:10:41]     --- PASS: TestContentClient/ResumeTruncate (0.71s)
[00:10:41]     --- PASS: TestContentClient/ResumeDiscard (0.67s)
[00:10:41]     --- PASS: TestContentClient/ResumeCopy (0.71s)
[00:10:41]     --- PASS: TestContentClient/ResumeCopySeeker (0.69s)
[00:10:41]     --- PASS: TestContentClient/ResumeCopyReaderAt (0.74s)
[00:10:41]     --- PASS: TestContentClient/SmallBlob (0.05s)
[00:10:41]     --- PASS: TestContentClient/Labels (0.06s)
[00:10:41]     --- PASS: TestContentClient/CrossNamespaceAppend (0.10s)
[00:10:41]     --- PASS: TestContentClient/CrossNamespaceShare (0.07s)
[00:10:41]     --- FAIL: TestContentClient/CommitErrorState (3.92s)
[00:10:41]         testsuite.go:101: Cleanup failed: unknown
[00:10:41]             github.com/containerd/containerd/errdefs.init.ializers
[00:10:41]             	C:/gopath/src/github.com/containerd/containerd/errdefs/errors.go:39
[00:10:41]             runtime.main
[00:10:41]             	C:/go/src/runtime/proc.go:188
[00:10:41]             runtime.goexit
[00:10:41]             	C:/go/src/runtime/asm_amd64.s:1337
[00:10:41]             remove C:\Program Files\containerd\root-test\io.containerd.content.v1.content\ingest\9101c5f249b4cb38a50dddda86a787c09f31099573c87c525fc50774ac21d05d\.tmp-updatedat170951157: The process cannot access the file because it is being used by another process.
[00:10:41]             github.com/containerd/containerd/errdefs.FromGRPC
[00:10:41]             	C:/gopath/src/github.com/containerd/containerd/errdefs/grpc.go:98
[00:10:41]             github.com/containerd/containerd/content/proxy.(*proxyContentStore).Abort
[00:10:41]             	C:/gopath/src/github.com/containerd/containerd/content/proxy/content_store.go:187
[00:10:41]             github.com/containerd/containerd.newContentStore.func2
[00:10:41]             	C:/gopath/src/github.com/containerd/containerd/content_test.go:60
[00:10:41]             github.com/containerd/containerd/content/testsuite.makeTest.func1.1
[00:10:41]             	C:/gopath/src/github.com/containerd/containerd/content/testsuite/testsuite.go:100
[00:10:41]             github.com/containerd/containerd/content/testsuite.makeTest.func1
[00:10:41]             	C:/gopath/src/github.com/containerd/containerd/content/testsuite/testsuite.go:121
[00:10:41]             testing.tRunner
[00:10:41]             	C:/go/src/testing/testing.go:865
[00:10:41]             runtime.goexit
[00:10:41]             	C:/go/src/runtime/asm_amd64.s:1337
[00:10:41]             failed to abort c1-commiterror-state
[00:10:41]             github.com/containerd/containerd.newContentStore.func2
[00:10:41]             	C:/gopath/src/github.com/containerd/containerd/content_test.go:61
[00:10:41]             github.com/containerd/containerd/content/testsuite.makeTest.func1.1
[00:10:41]             	C:/gopath/src/github.com/containerd/containerd/content/testsuite/testsuite.go:100
[00:10:41]             github.com/containerd/containerd/content/testsuite.makeTest.func1
[00:10:41]             	C:/gopath/src/github.com/containerd/containerd/content/testsuite/testsuite.go:121
[00:10:41]             testing.tRunner
[00:10:41]             	C:/go/src/testing/testing.go:865
[00:10:41]             runtime.goexit
[00:10:41]             	C:/go/src/runtime/asm_amd64.s:1337
remove C:\Program Files\containerd\root-test\io.containerd.content.v1.content\ingest\9101c5f249b4cb38a50dddda86a787c09f31099573c87c525fc50774ac21d05d\.tmp-updatedat170951157: 
The process cannot access the file because it is being used by another process.

Looks to be a flaky test, tracked in #3701

@thaJeztah

Copy link
Copy Markdown
Member Author

opened a backport with a possible fix for the flaky Windows test #4067

thaJeztah and others added 3 commits February 27, 2020 12:19
```
GOGC=75 golangci-lint run
services\containers\service.go:97:2: unreachable: unreachable code (govet)
	return nil
	^
content\local\store.go:549:75: nilness: impossible condition: nil != nil (govet)
		if writeTimestampFile(filepath.Join(path, "startedat"), startedAt); err != nil {
		                                                                        ^
content\local\store.go:553:75: nilness: impossible condition: nil != nil (govet)
		if writeTimestampFile(filepath.Join(path, "updatedat"), startedAt); err != nil {
		                                                                        ^
signals.go:29: File is not `goimports`-ed (goimports)
	"github.com/opencontainers/image-spec/specs-go/v1"
task.go:44: File is not `goimports`-ed (goimports)
	"github.com/opencontainers/image-spec/specs-go/v1"
container_opts_unix.go:37: File is not `goimports`-ed (goimports)
	"github.com/opencontainers/image-spec/specs-go/v1"
runtime/v1/linux/runtime.go:44: File is not `goimports`-ed (goimports)
	"github.com/containerd/containerd/runtime/v1"
```

Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Maksym Pavlenko <[email protected]>
(cherry picked from commit 2b521e2)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Michael Crosby <[email protected]>
(cherry picked from commit 3bc9975)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah
thaJeztah force-pushed the 1.2_backport_golang_ci_lint branch from a5d62cc to 598f7a7 Compare February 27, 2020 11:21
@codecov-io

codecov-io commented Feb 27, 2020 •

Copy link
Copy Markdown

Codecov Report

Merging #4061 into release/1.2 will decrease coverage by 3.67%.
The diff coverage is 0%.

Impacted file tree graph

@@               Coverage Diff               @@
##           release/1.2    #4061      +/-   ##
===============================================
- Coverage        47.86%   44.19%   -3.68%     
===============================================
  Files               91      100       +9     
  Lines             8484    10848    +2364     
===============================================
+ Hits              4061     4794     +733     
- Misses            3689     5314    +1625     
- Partials           734      740       +6
Flag Coverage Δ
#linux 47.86% <0%> (ø) ⬆️
#windows 41% <0%> (?)
Impacted Files Coverage Δ
content/local/store.go 48.51% <0%> (-5.03%) ⬇️
snapshots/native/native.go 43.3% <0%> (-10%) ⬇️
metadata/snapshot.go 45.8% <0%> (-8.96%) ⬇️
archive/tar.go 44.08% <0%> (-7.32%) ⬇️
metadata/containers.go 47.97% <0%> (-6.62%) ⬇️
content/local/writer.go 58.65% <0%> (-5.55%) ⬇️
metadata/images.go 57.57% <0%> (-4.99%) ⬇️
archive/tar_opts.go 28.57% <0%> (-4.77%) ⬇️
archive/compression/compression.go 58.69% <0%> (-4.7%) ⬇️
... and 58 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4fcbc81...598f7a7. Read the comment docs.

@thaJeztah
thaJeztah marked this pull request as ready for review February 27, 2020 11:50
@thaJeztah

Copy link
Copy Markdown
Member Author

All green now 👍

@estesp @dmcgowan @fuweid PTAL

@estesp estesp left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fuweid fuweid left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fuweid
fuweid merged commit 8091447 into containerd:release/1.2 Feb 27, 2020
@thaJeztah
thaJeztah deleted the 1.2_backport_golang_ci_lint branch February 27, 2020 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants