1

We have a project with 3 git repositories, let's call them backend, ui and library, hosted at gitlab.com/mycompany. These build quite happily.

I am trying to move the three repos into one, so we now have gitlab.com/mycompany/everything, containing everything/ui, everything/backend and everything/components that have the same content as their respective separate repos. With some suitable tweaks to paths, the .gitlab-ci.yml scripts are almost working, except the Go build (backend) fails because it is trying to download our own packages from gitlab. It never did this with one repo.

The build step happens in a docker runner using a custom image.

The error looks something like:

go: finding module for package gitlab.com/mycompany/backennd/modules/sigproc/bandvaluerangegen
go: finding module for package gitlab.com/mycompany/backend/modules/sigproc/bandnoiseestimator
go: gitlab.com/mycompany/backend/chaining/builder imports
    gitlab.com/mycompany/backend/modules/sigproc/bandnoiseestimator: no matching versions for query "latest"
go: gitlab.com/mycompany/everything/chaining/builder imports
    gitlab.com/mycompany/everything/modules/sigproc/bandvaluerangegen: no matching versions for query "latest"

I know such deeply nested packages are not every Go user's cup of tea, but they work for us and more importantly have been building successfully before this move.

Things I have tried:

  • Adding this to the build step. With this, it does at least get to github, but still can't find the package and anyway tries to download the main branch version which isn't what we would want.

    - git config --global url."https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.com/".insteadOf https://gitlab.com/
    - go env -w GOPRIVATE=gitlab.com/${CI_PROJECT_NAMESPACE}
    
  • Moving the go.mod file from everything/backend to everything, updating all the imports accordingly from "gitlab.com/mycompany/backend/..." to "gitlab.com/mycompany/everything/backend/...". Made no apparent difference.

  • building locally with all caches cleaned and with my SSH key files for Gitlab access moved out of the way, it builds fine, giving further evidence that it's not trying to download these packages when building locally.

1
  • Could it be somehow related to go modules cache (locally)? Commented 15 hours ago

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.