dependabot / dependabot-core

🤖 Dependabot's core logic for creating update PRs.
https://docs.github.com/en/code-security/dependabot
MIT License
4.73k stars 1.02k forks source link

Go: Support workspaces #6012

Open johanneswuerbach opened 2 years ago

johanneswuerbach commented 2 years ago

Is there an existing issue for this?

Feature description

Golang 1.18 introduced the support for workspaces to simplify the management of multiple modules in one repository.

Dependabot could use the go.work file to:

Something similar is already supported in the JS world with lerna https://github.com/dependabot/dependabot-core/pull/197 and yarn.

jeffwidman commented 1 year ago

Can you clarify the scenarios where this would be useful?

I typically refrain from checking a go.work file into git, and most other gophers I know do the same. There's even an issue discussing whether to formalize that recommendation:

If it's not actually checked into VCS, then Dependabot won't be able to bump it...

johanneswuerbach commented 1 year ago

We have several repositories, which contain multiple modules, were we commit go.work files so editor code completion etc. just works.

In those cases dependabot should auto-discover all modules based on the go.work file and ideally also keep dependency versions in-sync.

Drache93 commented 1 year ago

Like the original issue mentioned, Lerna and Yarn already do this for JS. As discussed in that Go proposal @jeffwidman mentioned, the use case where go.work is checked in, is monorepos (not to duplicate that discussion here). In my case, we have multiple applications and their shared libraries in a monorepo.

lucacome commented 1 year ago

I'm interested in this as well. Any plans to implement it?

grzesuav commented 2 months ago

Actually it would be super useful to have it also running go work sync to update all references. Regarding go.work being committed to VCS - this is one way how it implement monorepo in golang