purpleidea / mgmt

Next generation distributed, event-driven, parallel config management!
https://purpleidea.com/tags/mgmtconfig/
GNU General Public License v3.0
3.58k stars 311 forks source link

lib: Move to go modules with regret #671

Closed purpleidea closed 2 years ago

purpleidea commented 2 years ago

I'm incredibly annoyed that go modules are being forced onto us, as the old system with vendor/ and git submodules worked great. Unfortunately, so much FUD around git submodules, even by well-known, highly paid engineers has caused this solution to be deemed most unacceptable.

So much for the golang compatibility promise-- turns out it doesn't apply to the useful parts that we actually care about like this.

Thanks to frebib for his help with this suffering.

Tips:

topic: Capitalized message with no trailing period

or:

topic, topic2: Capitalized message with no trailing period

make gofmt      # formats the entire project correctly

or format a single golang file correctly:

gofmt -w yourcode.go
git checkout master
git pull origin master
git checkout your-feature
git rebase master
git push your-remote your-feature
hub pull-request    # or submit with the github web ui
# make changes based on reviews...
git add -p      # add new changes
git commit --amend  # combine with existing commit
git push your-remote your-feature -f
# now ping @purpleidea in the github PR since it doesn't notify us automatically

Thanks for contributing to mgmt and welcome to the team!

purpleidea commented 2 years ago

@frebib

frebib commented 2 years ago

https://github.com/frebib/mgmt/commits/feat/go-mod-fixes Here are my fixes. Please look over the last commit as I removed anything that seemed no longer applicable. Feel free to exclude any of my removals as you see fit, then hopefully we can get this merged

frebib commented 2 years ago

~You're also going to want to remove the rest of .gitmodules because any partial vendor directory will (probably) confuse go-mod. It'll either be ignored outright or cause build failures depending on how you invoke go build -mod=???~ Updated my branch

purpleidea commented 2 years ago

Nice, you rebased on top. Fantastic. Will look later tonight.

frebib commented 2 years ago

I found that with go modules, gometalinter fails to install, for some reason. You may need this commit to make the tests pass https://github.com/frebib/mgmt/commit/8fde6aaac75b740fa646d8301510acaffe3fb4d6

purpleidea commented 2 years ago

Replaced by https://github.com/purpleidea/mgmt/pull/674