dependabot / gomodules-extracted

This code was originally used in dependabot-core, but has since been removed. See Readme for details.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Update extracted go modules

jamezrin opened this issue · comments

Current extracted implementation of Go Modules is outdated and has some buggy behaviour.
I suggest to re-extract the current implementation and update this repo and anything that depends on it.

Currently, we use the go modules helper and dependabot has problems updating a specific dependency, something that doesn't happen with native go modules in go 1.12.5.

Stacktrace of dependabot failing

Fetching go_modules dependency files for user/repo
Parsing dependencies information
  - Updating github.com/go-kit/kit…/open/dependabot/vendor/ruby/2.6.0/gems/dependabot-go_modules-0.107.38/lib/dependabot/go_modules/file_updater/go_mod_updater.rb:94:in `handle_subprocess_error': go: finding github.com/go-kit/kit v0.9.0 (Dependabot::DependencyFileNotParseable)
go: downloading github.com/go-kit/kit v0.9.0
go: extracting github.com/go-kit/kit v0.9.0
build github.com/user/repo: cannot load github.com/go-kit/kit: cannot find module providing package github.com/go-kit/kit
	from /open/dependabot/vendor/ruby/2.6.0/gems/dependabot-go_modules-0.107.38/lib/dependabot/go_modules/file_updater/go_mod_updater.rb:59:in `block (2 levels) in updated_go_sum_content'
	from /open/dependabot/vendor/ruby/2.6.0/gems/dependabot-common-0.107.38/lib/dependabot/shared_helpers.rb:141:in `with_git_configured'
	from /open/dependabot/vendor/ruby/2.6.0/gems/dependabot-go_modules-0.107.38/lib/dependabot/go_modules/file_updater/go_mod_updater.rb:51:in `block in updated_go_sum_content'
	from /open/dependabot/vendor/ruby/2.6.0/gems/dependabot-common-0.107.38/lib/dependabot/shared_helpers.rb:37:in `block (2 levels) in in_a_temporary_directory'
	from /open/dependabot/vendor/ruby/2.6.0/gems/dependabot-common-0.107.38/lib/dependabot/shared_helpers.rb:37:in `chdir'
	from /open/dependabot/vendor/ruby/2.6.0/gems/dependabot-common-0.107.38/lib/dependabot/shared_helpers.rb:37:in `block in in_a_temporary_directory'
	from /usr/local/lib/ruby/2.6.0/tmpdir.rb:93:in `mktmpdir'
	from /open/dependabot/vendor/ruby/2.6.0/gems/dependabot-common-0.107.38/lib/dependabot/shared_helpers.rb:34:in `in_a_temporary_directory'
	from /open/dependabot/vendor/ruby/2.6.0/gems/dependabot-go_modules-0.107.38/lib/dependabot/go_modules/file_updater/go_mod_updater.rb:50:in `updated_go_sum_content'
	from /open/dependabot/vendor/ruby/2.6.0/gems/dependabot-go_modules-0.107.38/lib/dependabot/go_modules/file_updater.rb:29:in `updated_dependency_files'
	from ./dependabot_script.rb:182:in `block in <main>'
	from ./dependabot_script.rb:121:in `each'
	from ./dependabot_script.rb:121:in `<main>'

go.mod file in user/repo

module github.com/user/repo

go 1.12

require (
	github.com/user/repo1 v0.0.0-20190330214741-eddf924cad02
	github.com/user/repo2 v0.0.0-20190330203204-d206a5439aa6
	github.com/BurntSushi/toml v0.3.1 // indirect
	github.com/alicebob/gopher-json v0.0.0-20180125190556-5a6b3ba71ee6 // indirect
	github.com/alicebob/miniredis v2.5.0+incompatible
	github.com/dgrijalva/jwt-go v3.2.0+incompatible
	github.com/erizocosmico/flagga v1.0.0
	github.com/erizocosmico/flaggax v1.0.0
	github.com/garyburd/redigo v1.6.0
	github.com/go-kit/kit v0.8.0
	github.com/gomodule/redigo v2.0.0+incompatible // indirect
	github.com/gorilla/mux v1.7.0
	github.com/inconshreveable/mousetrap v1.0.0 // indirect
	github.com/pkg/errors v0.8.1
	github.com/prometheus/client_golang v0.9.2
	github.com/sony/gobreaker v0.0.0-20181109014844-d928aaea92e1
	github.com/spf13/cobra v0.0.3
	github.com/spf13/pflag v1.0.3 // indirect
	github.com/yuin/gopher-lua v0.0.0-20190206043414-8bfc7677f583 // indirect
	golang.org/x/net v0.0.0-20190225153610-fe579d43d832
)

Updating it locally works without a problem, did go get -u github.com/go-kit/kit and the dependency got updated to v0.9.0 just fine. Also patched the go.mod file myself (replaced v0.8.0 with v0.9.0) and ran go mod tidy, and the dependency got updated once again, without a problem.

Thanks! I'll take a look at re-extracting.

Thank you @hmarr for fixing this, much appreciated!