Skip to content

vendor: call vndr to remove useless pkgs and update vendor#3759

Merged
estesp merged 1 commit intocontainerd:masterfrom
fuweid:me-update-vendor
Oct 21, 2019
Merged

vendor: call vndr to remove useless pkgs and update vendor#3759
estesp merged 1 commit intocontainerd:masterfrom
fuweid:me-update-vendor

Conversation

@fuweid
Copy link
Member

@fuweid fuweid commented Oct 18, 2019

Signed-off-by: Wei Fu [email protected]

@fuweid fuweid changed the title vendor: call vndr to remove and update vendor vendor: call vndr to remove useless pkgs and update vendor Oct 18, 2019
@estesp
Copy link
Member

estesp commented Oct 18, 2019

Hmm, there may be other ways to provide these scripts, but vndr is removing a couple files that we refer to in our README.md: https://github.com/containerd/containerd#enabling-command-auto-completion

@fuweid
Copy link
Member Author

fuweid commented Oct 18, 2019

Hmm, there may be other ways to provide these scripts, but vndr is removing a couple files that we refer to in our README.md: https://github.com/containerd/containerd#enabling-command-auto-completion

Thanks! But why CI pass without any error? 😂

@codecov-io
Copy link

Codecov Report

Merging #3759 into master will increase coverage by 3.42%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3759      +/-   ##
==========================================
+ Coverage   41.98%   45.41%   +3.42%     
==========================================
  Files         131      118      -13     
  Lines       14536    11644    -2892     
==========================================
- Hits         6103     5288     -815     
+ Misses       7525     5449    -2076     
+ Partials      908      907       -1
Flag Coverage Δ
#linux 45.41% <ø> (ø) ⬆️
#windows ?
Impacted Files Coverage Δ
remotes/docker/fetcher.go 42.5% <0%> (-7.5%) ⬇️
remotes/docker/auth.go 63.82% <0%> (-3.97%) ⬇️
remotes/docker/status.go 21.42% <0%> (-3.58%) ⬇️
remotes/docker/errdesc.go 28.12% <0%> (-2.65%) ⬇️
remotes/docker/errcode.go 47.61% <0%> (-1.6%) ⬇️
platforms/cpuinfo.go 3.77% <0%> (-0.85%) ⬇️
log/context.go 36.84% <0%> (-0.66%) ⬇️
remotes/docker/handler.go 22.38% <0%> (-0.09%) ⬇️
errdefs/grpc.go 77.46% <0%> (-0.04%) ⬇️
remotes/docker/pusher.go 0% <0%> (ø) ⬆️
... and 75 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 9c86b8f...074b453. Read the comment docs.

@estesp
Copy link
Member

estesp commented Oct 18, 2019

@fuweid they are not used for build; we just need to probably copy them somewhere so packagers and users can have ctr command completion support if they want to. I cheated in our README.md docs and just referenced their existing path in ./vendor/github.com... because for some reason vndr hadn't removed them when they were initially added.

@thaJeztah
Copy link
Member

Could be a different version of vndr was used; do we pin the version of vndr?

@thaJeztah
Copy link
Member

🤔 last commit in vndr master was 2 months ago 🤷‍♂️

@jterry75
Copy link
Contributor

@thaJeztah - Can we not use modules?

@thaJeztah
Copy link
Member

Lots of problems still with go modules

@estesp
Copy link
Member

estesp commented Oct 19, 2019

I've proposed to move the autocomplete files to contrib/in #3766

Copy link
Member

@estesp estesp left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

Think I found why vndr now removes these go files (see my comment)

LGTM

@@ -1,267 +0,0 @@
package errcode
Copy link
Member

Choose a reason for hiding this comment

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

I think these became no longer necessary after commit 901bcb2 (#3728)

Could it be that the vendor validation doesn't run unless vendor.conf was modified? If so, that would explain why CI didn't catch the problem (ran into a similar issue in moby/moby, and have a PR there to force the vendor check, even if vendor.conf wasn't updated); moby/moby#40050

Copy link
Member Author

Choose a reason for hiding this comment

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

sure~

@fuweid
Copy link
Member Author

fuweid commented Oct 21, 2019

Thanks for @estesp and @thaJeztah ! sorry for late reply.

Interesting thing is that the travis CI will remove the vendor, call vndr to fetch all the packages and check diff. https://github.com/containerd/project/blob/master/script/validate/vendor.

It should be fail...

@fuweid
Copy link
Member Author

fuweid commented Oct 21, 2019

I think the travis_wait doesn't return error code

https://travis-ci.org/containerd/containerd/jobs/600526882

/home/travis/.travis/functions: line 553: 20897 Terminated              travis_jigger "${!}" "${timeout}" "${cmd[@]}"
The command "travis_wait ../project/script/validate/vendor" exited with 0.
0.39s$ git --no-pager diff
diff --git a/vendor/github.com/docker/distribution/registry/api/errcode/errors.go b/vendor/github.com/docker/distribution/registry/api/errcode/errors.go
deleted file mode 100644
index 4c35b87..0000000
--- a/vendor/github.com/docker/distribution/registry/api/errcode/errors.go
+++ /dev/null
@@ -1,267 +0,0 @@
-package errcode
-
-import (
-	"encoding/json"
-	"fmt"
-	"strings"
-)
-
-// ErrorCoder is the base interface for ErrorCode and Error allowing
-// users of each to just call ErrorCode to get the real ID of each
-type ErrorCoder interface {
-	ErrorCode() ErrorCode
-}
-
-// ErrorCode represents the error type. The errors are serialized via strings
-// and the integer format may change and should *never* be exported.
-type ErrorCode int

==> "travis_wait ../project/script/validate/vendor" exited with 0.

@thaJeztah
Copy link
Member

Ouch! That ain't good; good catch!

@fuweid
Copy link
Member Author

fuweid commented Oct 21, 2019

@thaJeztah ignore my last comment. That travis_wait can return the error code.

The root cause is about shell quote

root@ubuntu-xenial ~/g/s/g/c/containerd# git status --porcelain vendor go.mod go.sum                                                                                                                                                          129 me-for-vendor-check-testing-!
 D vendor/github.com/docker/distribution/registry/api/errcode/errors.go
 D vendor/github.com/docker/distribution/registry/api/errcode/handler.go
 D vendor/github.com/docker/distribution/registry/api/errcode/register.go
 M vendor/github.com/opencontainers/runc/README.md
 D vendor/github.com/urfave/cli/autocomplete/bash_autocomplete
 D vendor/github.com/urfave/cli/autocomplete/zsh_autocomplete

root@ubuntu-xenial ~/g/s/g/c/containerd# git status --porcelain "vendor go.mod go.sum"                                                                                                                                                            me-for-vendor-check-testing-!
root@ubuntu-xenial ~/g/s/g/c/containerd#

In project, we should not add quote to check diff.

But it should be fter this one pr and #3766 merged.

@thaJeztah
Copy link
Member

thaJeztah commented Oct 21, 2019

ha! of course; it's looking for a file named vendor go.mod go.sum

@fuweid
Copy link
Member Author

fuweid commented Oct 21, 2019

@estesp
Copy link
Member

estesp commented Oct 21, 2019

Merging now that we've solved the problem with the git diff invocation--otherwise I think we will have lots of broken CI on the vndr mismatch!

@estesp estesp merged commit 3e3c5fe into containerd:master Oct 21, 2019
@fuweid fuweid deleted the me-update-vendor branch April 22, 2020 11:34
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.

5 participants