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

Go modules - vendoring support #2580

Closed
rarkins opened this issue Sep 29, 2018 · 19 comments · Fixed by #3191
Closed

Go modules - vendoring support #2580

rarkins opened this issue Sep 29, 2018 · 19 comments · Fixed by #3191
Assignees
Labels
manager:gomod Go Modules priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others type:feature Feature (new functionality)

Comments

@rarkins
Copy link
Collaborator

rarkins commented Sep 29, 2018

Third step for go modules support - updating vendor/ directory along with go.mod and go.sum.

@rarkins rarkins added type:feature Feature (new functionality) blocked priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others manager:gomod Go Modules labels Sep 29, 2018
@rarkins rarkins mentioned this issue Sep 29, 2018
@rarkins rarkins added ready and removed blocked labels Oct 1, 2018
@rarkins
Copy link
Collaborator Author

rarkins commented Oct 17, 2018

Waiting on #2431

@rarkins
Copy link
Collaborator Author

rarkins commented Oct 17, 2018

I think we would need to run an additional go mod vendor command.

I'm not sure whether to run it with the source code present or not. It would be easier to just run it in the cloned dir which already had vendor/ files but takes a lot longer with source code present.

Also, ideally we could update the vendoring for just one of the modules, not others which may not be relevant to the PR.

@rarkins rarkins added blocked and removed ready labels Oct 25, 2018
@paultyng
Copy link
Contributor

paultyng commented Nov 7, 2018

If you have the code it would also be useful to run a go mod tidy as some dependencies may no longer be necessary with a version bump I think?

@rarkins
Copy link
Collaborator Author

rarkins commented Nov 7, 2018

@paultyng yes, we can do that too - although I have some doubts about whether everyone would want that. Unless everyone else in the project has diligently tidied the checksum file then you’ll see Renovate’s tidying removing a confusing number of lines unrelated to the actual PR’s changes to go.mod. Russ Cox’s opinion seems to be that users shouldn’t fixate too much on “old” lines in go.sum.

@rarkins
Copy link
Collaborator Author

rarkins commented Nov 8, 2018

go mod tidy also seems to have at least one bug right now too: golang/go#27868

@paultyng
Copy link
Contributor

paultyng commented Nov 8, 2018

Good point, vendoring is definitely the priority.

@rarkins
Copy link
Collaborator Author

rarkins commented Nov 8, 2018

@paultyng do you have any public repo requiring vendoring that I can use to test with when we implement?

@paultyng
Copy link
Contributor

Any of our apps in https://github.com/hashicorp or https://github.com/terraform-providers vendor (not our libraries). Specifically you could look at https://github.com/terraform-providers/terraform-provider-newrelic which was the one I was playing with for automatic PR creation.

@paultyng
Copy link
Contributor

paultyng commented Feb 5, 2019

@rarkins any news on this? I would happily upgrade to Pro (if we aren't already) to use this with all our Go repos.

@rarkins
Copy link
Collaborator Author

rarkins commented Feb 6, 2019

@paultyng I think this one can be completed pretty soon actually. Thanks for the reminder!

@rarkins
Copy link
Collaborator Author

rarkins commented Feb 8, 2019

@paultyng FYI here is an example from the work in progress: renovate-tests/terraform-provider-newrelic#14

@paultyng
Copy link
Contributor

paultyng commented Feb 8, 2019

This is great! Will it be optional whether you want a tidy, a vendor, or both?

@bflad
Copy link

bflad commented Feb 8, 2019

@rarkins awesome!! Very excited for this. Great work.

@rarkins
Copy link
Collaborator Author

rarkins commented Feb 8, 2019

I thought vendor should run every time if there’s a vendor/modules.txt, would you agree? Tidying would be optional

@paultyng
Copy link
Contributor

paultyng commented Feb 8, 2019

@rarkins yeah that sounds reasonable to me!

rarkins added a commit that referenced this issue Feb 11, 2019
Detects if a `vendor/modules.txt` is present and runs `go mod vendor` if so. Requires gitFs to work.

Closes #2580
@rarkins rarkins removed the review label Feb 11, 2019
@renovate-bot
Copy link
Collaborator

🎉 This issue has been resolved in version 14.16.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@adamdecaf
Copy link

How does this get enabled for a project? I recently had renovatebot update modules, but not vendor/. (See: moov-io/ach#490)

I'm not seeing configuration options to force go mod vendor either: https://renovatebot.com/docs/configuration-options/#gomod

@rarkins
Copy link
Collaborator Author

rarkins commented Mar 1, 2019

@adamdecaf right now I am doing the switch manually and check the logs every day or two for repos that need it. I switched all of moov-io/ over now so the next time you rebase that PR you should see the results. BTW you can always check renovatebot.com/dashboard for logs.

@adamdecaf
Copy link

Oh cool! I didn't know about renovatebot.com/dashboard, thanks!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
manager:gomod Go Modules priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others type:feature Feature (new functionality)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants