Repository navigation
Renovate tries to query authenticated gerrit version url in initPlatform before setting up host rules causing Unauthorized error #39969
How are you running Renovate?Self-hosted Renovate Which platform you running Renovate on?Other (please specify) Which version of Renovate are you using?42.47.0 Please tell us more about your question or problemThis recent PR, #39223, breaks gerrit because it tries to get the gerrit version using an authenticated gerrit url before the host rules have been applied. Specifically, the PR added code in the gerrit specific initPlatform renovate/lib/modules/platform/index.ts Lines 42 to 48 in 5a212d2 that calls this renovate/lib/modules/platform/gerrit/index.ts Lines 84 to 99 in 5a212d2 but that all happens before it sets up the host rules later on in initPlatform renovate/lib/modules/platform/index.ts Lines 86 to 87 in 5a212d2 so the gerrit api call fails with an Unauthorized error This can be replicated by setting up any normal gerrit instance with renovate Logs (if relevant)No response |
Replies: 2 comments 5 replies
|
I cannot reproduce this issue. How do you configure Gerrit credentials? Here's how I do it: module.exports = {
platform: 'gerrit',
endpoint: 'https://review.gerrithub.io/',
username: process.env.GERRIT_USERNAME,
password: process.env.GERRIT_PASSWORD,
} |
|
@travisshivers, just wanted to say that I run into the same. Big thanks to you for raising the problem and fixing it via #39970. |
With the gitlab platform, for the api calls it makes during initPlaform, it explicitly passes authentication information which isn't currently done in the gerrit one.
renovate/lib/modules/platform/gitlab/index.ts
Lines 146 to 150 in 5a212d2
Are you setting the env
RENOVATE_X_PLATFORM_VERSIONin your setup?We can solve this issue with gerrit by explicitly passing the authentication information. I've made a PR doing this and it fixes the issue for me: #39970