Renovate: Go private modules custom host support

Created on 7 Apr 2019  路  8Comments  路  Source: renovatebot/renovate

Add support for custom hosts just like has been added for github.com in #3495. i.e. look up all hosts with platform=go and then add each to the docker run command.

Also see #3202 for further discussions

gomod priority-4-low feature

Most helpful comment

Sure 馃檪

module github.COMPANY.io/ORG1/SERVICE-NAME

go 1.13

require (
    github.com/go-chi/chi v4.0.3+incompatible
    github.com/prometheus/client_golang v1.5.1 // indirect
    github.COMPANY.io/ORG2/go-errors/v3 v3.0.0
    github.COMPANY.io/ORG2/go-http/v8 v8.0.0
    github.COMPANY.io/ORG2/go-httpmetrics/v2 v2.0.0
    github.COMPANY.io/ORG2/go-jwt/v5 v5.0.0
    github.COMPANY.io/ORG2/go-log/v4 v4.0.0
)

All 8 comments

This probably means adding an API to hostRules like "getHostNamesByType" that accepts hostType as input and returns a list of hostnames of all rules that include hostType and either a hostName or baseUrl.

Hi. It's currently impossible for me to start using renovate bot unless this issue is fixed since most of our dependencies are hosted on GitHub enterprise. Just writing hoping the priority of the issue will be increased 馃檪

@lindell so you have dependencies on other repos within the same GHE host? in other words no extra config would be needed on your part - Renovate just needs to pass its GHE token to go?

@rarkins I think that one part would be to pass the GHE token:
https://github.com/renovatebot/renovate/blob/master/lib/manager/gomod/artifacts.ts#L23

But the problem originates here:
https://github.com/renovatebot/renovate/blob/master/lib/datasource/go/index.ts#L25
Where renovate tries to fetch the information as if it is a pure go modules server.

TRACE: No go-source header found (repository=xxx/xxxxxx)

Since it tries to fetch it as if it was hosted at a go modules server. I guess workaround could be to use a go modules proxy server such as athens but setting that up is not an options right now.

There might also be further problems with fetching the release notes if here:
https://github.com/renovatebot/renovate/blob/master/lib/datasource/github-releases/index.ts#L39
But I could be mistaken since I haven't tested that yet.

Thanks. Yes, we need to treat it as a fit/GitHub source and not a regular go source. Can you give an example of your go.mod entry for local dependencies?

Sure 馃檪

module github.COMPANY.io/ORG1/SERVICE-NAME

go 1.13

require (
    github.com/go-chi/chi v4.0.3+incompatible
    github.com/prometheus/client_golang v1.5.1 // indirect
    github.COMPANY.io/ORG2/go-errors/v3 v3.0.0
    github.COMPANY.io/ORG2/go-http/v8 v8.0.0
    github.COMPANY.io/ORG2/go-httpmetrics/v2 v2.0.0
    github.COMPANY.io/ORG2/go-jwt/v5 v5.0.0
    github.COMPANY.io/ORG2/go-log/v4 v4.0.0
)

As I mentioned earlier https://github.com/renovatebot/renovate/issues/4601 , this just need to use native tools, example:

go list -m -u -json all

see:
https://blog.golang.org/using-go-modules
https://golang.org/pkg/cmd/go/internal/list/

The ability to add a custom config for the git already exists at the moment:

.gitconfig

[url "https://oauth2:[email protected]/"]
        insteadOf = https://gitlab.lolcal.loc/

:tada: This issue has been resolved in version 23.35.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jgarec picture jgarec  路  3Comments

zephraph picture zephraph  路  3Comments

Siilwyn picture Siilwyn  路  4Comments

OmgImAlexis picture OmgImAlexis  路  4Comments

ptbrowne picture ptbrowne  路  3Comments