-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add Go module support for pipelines. #1607
Conversation
/hold |
Looks really good. The only "question"/"worry" I've got is on the removal of the
All that said, I am fine with whatever we choose, but we should probably do the same on all project then. /cc @chmouel @bobcatfish @imjasonh @dibyom PS: I feel I am a bit biased when talking about go modules 😝 |
Do you need to be online for every In general this looks like it should be 'better than dep on balance'. I'd be happy to move dashboard and webhooks over to go modules after a few weeks of waiting for pipeline to iron out any major gotchas. A cautious +1 from me. |
Just the first. Modules are cached locally at |
I have a slight preference for keeping |
/test pull-tekton-pipeline-build-tests |
Is this for reciprocal licenses? If so, go-license takes care of this and puts code into My preference is to omit the vendor directory.
The most compelling argument to keep vendor for me is compatibility with older Go versions, but vendor support exists since 1.11 (released 2018/08). I'm not sure about pipelines, but triggers requires Go >= 1.13, so I don't think we really need to worry about this too much. |
Some dependencies (hashicorp/lru) require us to include the source code, not just the licenses. |
Yup! We're on the same page. =] go-licenses copies anything that is identified as reciprocal to third_party/. |
Paging @wlynch @imjasonh @vdemeester have you spoken any further on this issue? As Jason mentioned offline the other day now's a good time to get moving on this since the latest release has just gone out and we're not scrambling to get a new one ready. Given that go-licenses seems to do what we want with source code and license files I see a couple options:
Either way it'd be great to get on the blessed go module path. |
b6b7744
to
2e2f77c
Compare
I'd like to submit this before more version changes/updates happen, so I'm going to proceed with #2. Like you said, we can continue discussing keeping the vendor directory after we switch to modules. |
The following is the coverage report on pkg/.
|
Right, let's go for keeping the |
The following is the coverage report on pkg/.
|
The following is the coverage report on pkg/.
|
/test pull-tekton-pipeline-integration-tests |
48ddd32
to
63a13b0
Compare
The following is the coverage report on pkg/.
|
The following is the coverage report on pkg/.
|
/test pull-tekton-pipeline-build-tests |
This enables Go modules and removes the vendor directory from the repository. NOTE: highly recommend viewing this change with `git diff master -- ':!third_party' ':!vendor'` Notable changes: - Removes use of dep in favor of Go modules. - Removes vendor directory. As a result, switches license notice generation to go-license. - Forks code generation scripts from respective k8s/knative sources to allow module aware imports. (I want to fix this upstream sometime in the future, but for now this is as best as we can do). - Unsymlinks config/300-imagecache.yaml, since go mod vendor will only copy package dependencies. - Wraps `logger.Sync()` calls in func that explicitly ignores the returned error to make golangci-lint happy. - Replace kodata/VENDOR-LICENSE symlinks with symlink to third_party. This should not result in any change of functionality. Fixes tektoncd#1315, tektoncd#1538
The following is the coverage report on pkg/.
|
/unhold |
/hold cancel |
oooohhh it is green 💚 |
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
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 😎
/cc @imjasonh @bobcatfish @sbwsg @dibyom @afrittoli
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vdemeester The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/lgtm 🤞 |
This was something previously brought up in tektoncd#1607, but was deferred to allow for continued discussion. Pros of making this change: * Reduces size of incoming PRs when new dependencies are used. * Removes confusion around source of truth for dependencies (e.g. vendor vs mod). This was an issue that tektoncd#1763 solved by pinning to vendor, this will solve the same problem differently by always deferring to the version in go.mod. * Allows easier use of upstream and dependent types without the use of vendor - see https://gist.github.com/wlynch/325293bc3fbc488d3b3d319f3a93bbea for an example of why this is difficult today. Risks of making this change: * Dependencies will not be present in initial clone. They will be fetched dynamicly when needed, which may cause workflow distruptions. * This breaks compatibility with older versions of Go (though for certain projects like triggers, we already require Go >= 1.13). Third-party obligations (for things like making source available in images) have already been addressed in tektoncd#1607. As with tektoncd#1607, this change is more easily viewed by running `git diff master -- ':!third_party' ':!vendor'`
Changes
This enables Go modules and removes the vendor directory from the
repository.
NOTE: highly recommend viewing this change with
git diff master -- ':!third_party' ':!vendor'
Notable changes:
generation to go-license.
allow module aware imports. (I want to fix this upstream sometime in
the future, but for now this is as best as we can do).
This should not result in any change of functionality.
Fixes #1315, #1538
This change is dependent on tektoncd/plumbing#121. The only difference is the removal of the replace line in go.mod. Otherwise this should be good to go.
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
See the contribution guide for more details.
Double check this list of stuff that's easy to miss:
cmd
dir, please updatethe release Task to build and release this image.
Reviewer Notes
If API changes are included, additive changes must be approved by at least two OWNERS and backwards incompatible changes must be approved by more than 50% of the OWNERS, and they must first be added in a backwards compatible way.
Release Notes