renovatebot / config-help

Please use the Discussions feature of https://github.com/renovatebot/renovate instead
https://github.com/renovatebot/renovate/discussions
MIT License
27 stars 16 forks source link

How to give GitHub App access to GitLab hosted shareable config #536

Closed Jamesking56 closed 4 years ago

Jamesking56 commented 4 years ago

Which Renovate are you using?

WhiteSource Renovate App

Which platform are you using?

GitHub.com

GitLab.com

Have you checked the logs? Don't forget to include them if relevant

https://app.renovatebot.com/dashboard#github/Jamesking56/key-sync/142675027

What would you like to do?

I'm trying to get my GitHub repos to use the same shareable config I use for my GitLab repos but it says it cannot find it.

How do I give Renovate access?

rarkins commented 4 years ago

Is the gitlab preset public or private?

Jamesking56 commented 4 years ago

GitLab preset is private.

I've managed to work around this by creating a private repo on GitHub and use GitLab's repository mirroring feature - that seems to work

rarkins commented 4 years ago

In that case you'd need to add a rule to hostRules with token set plus domainName="gitlab.com". As it would be public github repos, you'd want to encrypt the token field, so something like this:

{
  "hostRules": [{
    "domainName": "gitlab.com",
    "encrypted": {
      "token": "ZBvcEXEUtfWrKRqntoJ58G6flrTMS7mLpNmBq2ge1wKREd49e+Rjs9vN0s/f4pbSNTdkBk9LFXFDLP/ubI4e3eINaJpErM03KNk3PIYLMMCHSL1/uIuaQ7R5FdU5yl5cykh1x6OQQ9kwSsdkB1zzqSHLk1tlHNcNzHN9FZmfENmSn12mGCsq2SnUBjB3KwlEmCCfRj1DF6oH/QWQIHfhhtEnEx/tlb8P5uhYrWaN8nkZOLmeFyLnm/aOIeUf59DEnjt5tKyevHc3JUfZMbxZI8QJfSnxkXw9yopEcvqWJPGaYmf1ejrbBu80x3pcrVQq8DIAPjgYpITR96Z/YQdHdw=="
    }
  }]
}
stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed soon if no further activity occurs.

Jamesking56 commented 4 years ago

I'll give this a go and report back :+1:

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed soon if no further activity occurs.

Jamesking56 commented 4 years ago

I tried this and it doesn't work, GitLab seems to be giving Renovate a 404:

https://app.renovatebot.com/dashboard#github/Jamesking56/key-sync/145059411

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed soon if no further activity occurs.

Jamesking56 commented 4 years ago

Not stale https://github.com/renovatebot/config-help/issues/536#issuecomment-590424027

rarkins commented 4 years ago

@Jamesking56 I think you'll need to replicate and debug this locally using the CLI.

When a gitlab preset is in use, it calls glGot: https://github.com/renovatebot/renovate/blob/b78b5f48a143ff9d056a4314c3d530f5c9119984/lib/config/presets/gitlab.ts#L49

It then calls our util got: https://github.com/renovatebot/renovate/blob/b78b5f48a143ff9d056a4314c3d530f5c9119984/lib/platform/gitlab/gl-got-wrapper.ts#L20

And our util got should automatically add any hostRules token it finds: https://github.com/renovatebot/renovate/blob/b78b5f48a143ff9d056a4314c3d530f5c9119984/lib/util/got/host-rules.ts#L30

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed soon if no further activity occurs.