Build all modules and in obs directly from this repo #23

Manually merged
adamm merged 0 commits from jzerebecki/autogits:build-all into main 2025-07-10 10:11:49 +02:00
Owner

Build all modules and in obs directly from this repo

Build each go module in a subpackage.


Merge all go.mod into a top level one


Rename bots-common to common

to make it match the name it is imported as

Build all modules and in obs directly from this repo Build each go module in a subpackage. --- Merge all go.mod into a top level one --- Rename bots-common to common to make it match the name it is imported as
jzerebecki added 1 commit 2025-04-02 17:47:11 +02:00
Owner

Thanks. I will look how we can fix this need for so many vendor files. Ideally, you should be able to merge these go.mod files and generate one vendor tarball. Anything else is not required there, except the go.sum. I don't know why that service wants to package sources that are just in different directories or why it even needs tarballs. It should download the go stuff based on go.sum.

https://faun.pub/understanding-go-mod-and-go-sum-5fd7ec9bcc34

It will also create a go.sum file which maintains the checksum so when you run the project again it will not install all packages again. But use the cache which is stored inside $GOPATH/pkg/mod directory (module cache directory).

go.sum is a generated file you don’t have to edit or modify this file.

Thanks. I will look how we can fix this need for so many vendor files. Ideally, you should be able to merge these go.mod files and generate one vendor tarball. Anything else is not required there, except the go.sum. I don't know why that service wants to package sources that are just in different directories or why it even needs tarballs. It should download the go stuff based on go.sum. https://faun.pub/understanding-go-mod-and-go-sum-5fd7ec9bcc34 > It will also create a go.sum file which maintains the checksum so when you run the project again it will not install all packages again. But use the cache which is stored inside $GOPATH/pkg/mod directory (module cache directory). > > go.sum is a generated file you don’t have to edit or modify this file.
Owner
~/go/pkg/mod/github.com/go-openapi/validate v0.24.0 h1:LdfDKwNbpB6Vn40xhTdNZAnfLECL81w+VX3BumrGD58=

->
~/go/pkg/mod/github.com/go-openapi/validate\@v0.24.0/

done. It's basically go get and then tarball the directories for the service.

``` ~/go/pkg/mod/github.com/go-openapi/validate v0.24.0 h1:LdfDKwNbpB6Vn40xhTdNZAnfLECL81w+VX3BumrGD58= -> ~/go/pkg/mod/github.com/go-openapi/validate\@v0.24.0/ ``` done. It's basically `go get` and then tarball the directories for the service.
Owner

I'm mainly complaining about this go_modules service that seems to be doing funny things...

I'm mainly complaining about this go_modules service that seems to be doing funny things...
Owner

ok, so , it uses go mod vendor probably and that is not so smart and vendors modules that are not only from remote but also relative paths.

ok, so , it uses `go mod vendor` probably and that is not so smart and vendors modules that are not only from remote but also relative paths.
jzerebecki force-pushed build-all from 98d2871578 to cf002ec6b3 2025-04-02 18:35:26 +02:00 Compare
Author
Owner

Rebased and added go.sum file that was missing which fixed vendoring for one module.

Rebased and added go.sum file that was missing which fixed vendoring for one module.
Author
Owner

Yes, it uses go mod vendor. Maybe with a top level go.mod and sums file go mod vendor would have no reason to copy the local path as it is not a different go.mod anymore?

In adamm/autogits#20 (comment) you said that one needs to go generate to be able to create the vendor tar balls for workflow-direct and workflow-pr.

Which the code specifies to need mockgen, but that does not seem to be packaged in Factory, correct? Would you be willing to commit the generated files in this repo?

Yes, it uses go mod vendor. Maybe with a top level go.mod and sums file go mod vendor would have no reason to copy the local path as it is not a different go.mod anymore? In https://src.opensuse.org/adamm/autogits/pulls/20#issuecomment-14027 you said that one needs to go generate to be able to create the vendor tar balls for workflow-direct and workflow-pr. Which the code specifies to need mockgen, but that does not seem to be packaged in Factory, correct? Would you be willing to commit the generated files in this repo?
Owner

mockgen is for go generate. Maybe it should be packaged for Factory then 😉. Should probably go to devel:languages:go and just expose the mockgen tool there.

https://github.com/uber-go/mock

mockgen is for `go generate`. Maybe it should be packaged for Factory then 😉. Should probably go to `devel:languages:go` and just expose the mockgen tool there. https://github.com/uber-go/mock
jzerebecki force-pushed build-all from cf002ec6b3 to 2ed4f0d05f 2025-04-04 11:11:03 +02:00 Compare
jzerebecki changed title from WIP: Build all go modules each in a subpackage to Build all modules and in obs directly from this repo 2025-04-04 11:15:36 +02:00
Author
Owner

Merged the go.mod, which fixed the copied local module.

Merged the go.mod, which fixed the copied local module.
adamm manually merged commit 009cc88d54 into main 2025-04-04 13:06:58 +02:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: git-workflow/autogits#23