-
Notifications
You must be signed in to change notification settings - Fork 2k
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
vendor with go mod #3387
vendor with go mod #3387
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3387 +/- ##
=======================================
Coverage 56.35% 56.35%
=======================================
Files 304 304
Lines 26830 26830
=======================================
Hits 15121 15121
Misses 10789 10789
Partials 920 920 |
c094e3a
to
eb67226
Compare
eb67226
to
3b4c191
Compare
Why is the filename |
Creating |
Thanks for explanation, could you add this background to the comment lines of |
Good idea! @crazy-max would you mind doing that please? I'll update moby/swarmkit#3046 also. |
@errordeveloper Yes sure! |
FWIW: I recalled we also had #3139 pending, but that never was finished / completed. I recalled I had a branch on my machine (but it may have still been "work in progress", as it was a quick "let's rip the remaining bits out as well" frenzy). Removing those k8s bits also helps reducing the list of dependencies considerably, so I just rebased that branch, and opened a draft PR to see what it would look like; #3389 (and if CI succeeds 😂) |
3b4c191
to
cefa164
Compare
cefa164
to
9c54383
Compare
Looks like this is good to go! |
Also opened docker/docker-ce-packaging#611 to do a quick check if the packaging scripts don't blow up 👍 |
9c54383
to
cb0968d
Compare
scripts/vendor
Outdated
if [ ! -x "$(command -v modvendor)" ]; then | ||
echo "modvendor not found. Install with 'go install github.com/goware/modvendor@v0.5.0'" | ||
exit 1 | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd recommend doing something similar to moby/swarmkit@a46370c, that way tools versions can be tracked in a separate go.mod
file and will not interfere with actual runtime dependencies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep sounds better with go build tools, will make some changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hum will do that in a follow-up actually, there are other tools that would need the same behavior like goversioninfo
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall! Just a few nits.
caef84b
to
fc57f10
Compare
dcd21b4
to
f49c568
Compare
f49c568
to
baeb3cd
Compare
vendor.mod linguist-language=Go-Module | ||
vendor.sum linguist-language=Go-Checksums |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@errordeveloper Just stylish stuff you can add to match the proper language using gitattributes:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
@crazy-max should we request a review from someone who can merge this? |
./scripts/vendor validate | ||
|
||
.PHONY: mod-outdated | ||
mod-outdated: ## check outdated dependencies |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not yet in use, correct? (more of a "local dependabot check")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes this is only intended for local check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sample output:
$ DISABLE_WARN_OUTSIDE_CONTAINER=1 make mod-outdated
./scripts/vendor outdated
+ go-mod-outdated -update -direct
+ go list -mod=vendor -mod=readonly -modfile=vendor.mod -u -m -json all
+--------------------------------------+-----------------------------------------------------+------------------------------------+--------+------------------+
| MODULE | VERSION | NEW VERSION | DIRECT | VALID TIMESTAMPS |
+--------------------------------------+-----------------------------------------------------+------------------------------------+--------+------------------+
| github.com/containerd/console | v1.0.2 | v1.0.3 | true | true |
| github.com/containerd/containerd | v1.5.5 | v1.5.8 | true | true |
| github.com/creack/pty | v1.1.11 | v1.1.17 | true | true |
| github.com/docker/docker | v20.10.3-0.20210811141259-343665850e3a+incompatible | v20.10.12+incompatible | true | true |
| github.com/google/go-cmp | v0.2.0 | v0.5.6 | true | true |
| github.com/mitchellh/mapstructure | v1.3.2 | v1.4.3 | true | true |
| github.com/moby/buildkit | v0.8.2-0.20210615162540-9f254e18360a | v0.9.3 | true | true |
| github.com/opencontainers/image-spec | v1.0.1 | v1.0.2 | true | true |
| github.com/spf13/cobra | v1.1.3 | v1.3.0 | true | true |
| github.com/tonistiigi/fsutil | v0.0.0-20210609172227-d72af97c0eaf | v0.0.0-20211208191308-f95797418e48 | true | true |
| github.com/tonistiigi/go-rosetta | v0.0.0-20200727161949-f79598599c5d | v0.0.0-20201102221648-9ba854641817 | true | true |
| golang.org/x/sys | v0.0.0-20210823070655-63515b42dcdf | v0.0.0-20211216021012-1d35b9e2eb4e | true | true |
| golang.org/x/term | v0.0.0-20201117132131-f5c789dd3221 | v0.0.0-20210927222741-03fcf44c2211 | true | true |
| golang.org/x/text | v0.3.3 | v0.3.7 | true | true |
| k8s.io/api | v0.16.9 | v0.23.0 | true | true |
| k8s.io/apimachinery | v0.16.9 | v0.23.0 | true | true |
| k8s.io/client-go | v0.16.9 | v1.5.2 | true | true |
+--------------------------------------+-----------------------------------------------------+------------------------------------+--------+------------------+
baeb3cd
to
4675cee
Compare
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
4675cee
to
caa31d9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@tonistiigi PTAL
PTAL @tonistiigi @silvin-lubecki @tiborvass thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
let's bring this one in |
follow-up #3308
vendoring with go modules with nearly zero diff (ref moby/swarmkit#3046).
cc @thaJeztah @errordeveloper
Signed-off-by: CrazyMax crazy-max@users.noreply.github.com