Skip to content
This repository has been archived by the owner on May 18, 2021. It is now read-only.

Ensure we always build from vendored deps, and test for mod tidy #176

Merged
merged 2 commits into from
Jul 10, 2019

Conversation

nickatsegment
Copy link
Contributor

@nickatsegment nickatsegment commented Jul 9, 2019

I noticed that our vendored deps are way out of date. This PR causes CI to build from vendored deps by default, and also checks that the vendored deps are complete.

Building from vendored deps ensures we know and have the exact code we intended.

The CI runs for this PR show how it would fail tests:

go: downloading github.com/danieljoos/wincred v1.0.1
...
git tree is dirty after tidying and vendoring modules
ensure go.mod and go.sum are tidy and vendor is checked in
On branch ensure-vendor-build
Untracked files:
  (use "git add <file>..." to include in what will be committed)

	vendor/github.com/99designs/keyring/.travis.yml
...
	vendor/golang.org/x/sys/windows/

nothing added to commit but untracked files present (use "git add" to track)
Exited with code 1
mkdir -p dist
GOOS=linux GOARCH=amd64 GO111MODULE=on go build -mod=vendor -ldflags='-X "main.Version=v0.21.0-9-g344f6fe"' -o dist/aws-okta-v0.21.0-9-g344f6fe-linux-amd64
build github.com/segmentio/aws-okta: cannot load github.com/alessio/shellescape: open /go/src/github.com/segmentio/aws-okta/vendor/github.com/alessio/shellescape: no such file or directory
Makefile:25: recipe for target 'dist/aws-okta-v0.21.0-9-g344f6fe-linux-amd64' failed
make: *** [dist/aws-okta-v0.21.0-9-g344f6fe-linux-amd64] Error 1
Exited with code 2

@nickatsegment nickatsegment force-pushed the ensure-vendor-build branch 6 times, most recently from 7fc98e7 to 344f6fe Compare July 9, 2019 21:06
@nickatsegment nickatsegment marked this pull request as ready for review July 9, 2019 21:12
@nickatsegment nickatsegment force-pushed the ensure-vendor-build branch from 7fc98e7 to e6998d5 Compare July 9, 2019 23:16
Copy link
Contributor

@boggsboggs boggsboggs left a comment

Choose a reason for hiding this comment

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

Cool. I don't really know how go modules work, but this seems like a well thought out change

@nickatsegment nickatsegment merged commit 8fb2332 into master Jul 10, 2019
@nickatsegment nickatsegment deleted the ensure-vendor-build branch July 10, 2019 17:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants