Skip to content
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 dependencies when running code generators. #314

Merged
merged 5 commits into from Jul 16, 2019

Conversation

mattysweeps
Copy link
Contributor

@mattysweeps mattysweeps commented Jul 15, 2019

This PR uses go mod vendor to vendor code-generation dependencies, giving us more reliability.

Goal were:

  1. Use the same version of code-generator that knative uses.
  2. Because of 1., remove all sed hacks when generating code
  3. (Still to test) fix our code incompatibility with watchers

Solution was:

  1. enforce go mod vendor by using replace directives in go.mod to bin k8s.io dependencies as close as we could to k8s version 1.12.9: the version used by knative/pkg and knative/serving.
  2. Update our scripts to utilize the vendor direcotry
  3. Because go mod vendor does not down;pad scripts, we download the code generation scripts manually. This makes me sad.

Other considerations:

  1. Dep cannot be used because we need 2 different versions of knative/pkg, because of our dependency on knative build. Once we move to tekton we might be able to switch to dep, making us more consistent with knative.

Side effects were:

  1. the go mod cache cannot be used with vendored dependencies, causing a massive slowdown in the generation script.

@googlebot googlebot added the cla: yes PR submitter has signed the CLA label Jul 15, 2019
hack/gopath-deps.sh Outdated Show resolved Hide resolved
hack/update-codegen.sh Outdated Show resolved Hide resolved
hack/update-codegen.sh Show resolved Hide resolved
Copy link
Contributor

@josephlewis42 josephlewis42 left a comment

Choose a reason for hiding this comment

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

LGTM

@mattysweeps mattysweeps merged commit 15c95d6 into master Jul 16, 2019
@mattysweeps mattysweeps deleted the fix/code-generator-versions branch July 17, 2019 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes PR submitter has signed the CLA
Projects
None yet
3 participants