renovatebot / renovate

Home of the Renovate CLI: Cross-platform Dependency Automation by Mend.io
https://mend.io/renovate
GNU Affero General Public License v3.0
17.62k stars 2.32k forks source link

Go modules self-hosted private modules support #3497

Closed rarkins closed 2 years ago

rarkins commented 5 years ago

When running in self-hosted mode, add support for the local server just like has been added for github.com in #3495. i.e. add the host's token to the docker run command in addition to github.com.

Also see #3202 for further discussions

diagonalfish commented 4 years ago

(Moved comment from incorrect issue)

This feature would be extremely helpful for the self-hosted instance I'm trying to set up for my team - we have a private Github EE server where we host internal Go libraries that are currently inaccessible.

TRACE: No go-source header found (repository=myusername/privaterepo)
       "depName": "git.company.com/private-org/private-module"
INFO: Failed to look up dependency git.company.com/private-org/private-module (repository=myusername/privaterepo, packageFile=go.mod, dependency=git.company.com/private-org/private-module )

Renovate certainly still has its uses without this, but with the internal Go ecosystem we're building with lots of private repos/modules this would be a really helpful feature.

bastianeicher commented 3 years ago

Very similar situation for me. I use self-hosted Renovate on Azure DevOps. Updating private NuGet and Maven dependencies using hostRules in config.js works great. But for private Go dependencies I get:

TRACE: No go-source or go-import header found (repository=myproj/source-repo)
       "goModule": "dev.azure.com/myorg/myproj/_git/dependency-repo.git"
DEBUG: Failed to look up dependency dev.azure.com/myorg/myproj/_git/dependency-repo.git (repository=myproj/source-repo, packageFile=go.mod, dependency=dev.azure.com/myorg/myproj/_git/dependency-repo.git)

I also tried running this before running Renovate, but with no success:

echo "machine dev.azure.com\nlogin apikey\npassword $(System.AccessToken)" >> ~/.netrc
git config --global http.https://dev.azure.com.extraheader "Authorization: bearer $(System.AccessToken)"

I was wondering: The URLs I am using (ending in .git) are already the "real" VCS URLs and not websites that need to be resolved using the go-source or go-import meta tags. Couldn't Renovate simply fall back to directly using the URL as-is, rather than returning null? https://github.com/renovatebot/renovate/blob/0fa01062f9a766fdc122e87f34bbc5af5646a9e0/lib/datasource/go/index.ts#L95-L97

rarkins commented 2 years ago

I'm not sure if this is fixed already, or will be fixed by #13477, or if it will still remain open

Chumper commented 2 years ago

This should be fixed with the current golang implementation already. The PR you mentioned will provide the basic to also support git@... for other languages like python.