Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Add github action to update go dependencies #693

Merged
merged 3 commits into from
Sep 21, 2020

Conversation

darkowlzz
Copy link
Contributor

This adds a new github action to update go dependencies and create a PR with the changes.
The action is scheduled to run daily and can also be triggered manually from the github
actions tab. It uses branch go-deps-patch for creating PR.

Github action can't run make target autogen, which uses go-in-docker internally due to
the interactive flags. It results in error:

the input device is not a TTY

To keep the existing behavior of go-in-docker, this PR changes go-autogen to work
outside of container environment.

go-autogen make target expects the code generation tools to be available in /go/bin/. This
isn't true when running without the docker environment created by go-in-docker target.
To be able to run the code generation along with dependency updates on host directly, vendor
the code generation tools using the tools.go approach.
Refer https://github.com/golang/go/wiki/Modules#how-can-i-track-tool-dependencies-for-a-module

This helps avoid changing the mod file while installing the tools with go get and the need to
perform a cleanup at the end. It helps ensure that the vendored code-generation tools will always
reproduce the same results for everyone.

This is required to be able to update dependencies without usind docker
in github actions.
Vendoring the code-generation tools and running them with go run helps
avoid running go get to install the tools and updating the mod file
with unused dependencies.
Run `make go-autogen` and create a PR for any updated files.
Schedule to run daily and also enable an option to trigger it manually
on demand for creating PR that updates go dependencies.
This uses branch `go-deps-patch` to create the PR and automatically
deletes it once the PR is closed or merged.
@darkowlzz darkowlzz added the area/dependency Issues or PRs related to dependency changes label Sep 21, 2020
@stealthybox stealthybox merged commit 27117b0 into weaveworks:master Sep 21, 2020
@darkowlzz darkowlzz deleted the vendor-tools branch September 25, 2020 18:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/dependency Issues or PRs related to dependency changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants