Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mend Renovate CE 6.x overwrites some of the config.js attributes #371

Open
GreyTeardrop opened this issue Oct 17, 2023 · 9 comments
Open

Comments

@GreyTeardrop
Copy link

Hi Renovate team!

Thank you for maintaining and enhancing self-hosted Renovate.

We use the Helm chart provided by you to deploy Renovate CE and GitHub application to integrate it with GitHub. We've recently upgraded to version 6.x and discovered some changes in its behavior. After some investigation, it looks like Renovate now unconditionally overwrites some of the config attributes set via the renovate.config Helm attribute and propagated through the config.js volume.

In particular, it seems to overwrite the gitAuthor and onboardingConfig attributes. It now unconditionally sets gitAuthor to the detected GitHub application used for integration

DEBUG: Detected config in env RENOVATE_CONFIG
       "config": {
         "dependencyDashboardFooter": "\n- [ ] <!-- manual job -->Check this box to trigger a request for Renovate to run again on this repository\n",
         "endpoint": "https://api.github.com/",
         "gitAuthor": "<our GitHub app name>[bot]@users.noreply.github.com",
         "platform": "github",
         "repositories": [...],
         "token": "***********",
         "username": "<our GitHub app name>[bot]"
       }

and then

DEBUG: Env config
       "config": {
         "dependencyDashboardFooter": "\n- [ ] <!-- manual job -->Check this box to trigger a request for Renovate to run again on this repository\n",
         "endpoint": "https://api.github.com/",
         "gitAuthor": "<our GitHub app name>@users.noreply.github.com",
         "platform": "github",
         "repositories": [...],
         "token": "***********",
         "username": "<our GitHub app name>",
         "hostRules": [],
         "binarySource": "install",
         "onboardingConfig": {
           "$schema": "https://docs.renovatebot.com/renovate-schema.json",
           "extends": ["config:recommended"]
         }
       }

It totally makes sense that gitAuthor is defaulted to the GitHub application name, but it was unexpected that the explicitly set value is now ignored. Should this be documented?

As for the onboarding config, it seems to come from the renovate-ce container image and, being an env, seems to take precedence over anything set in the config file

> docker image inspect ghcr.io/mend/renovate-ce:6.3.0-full | jq '.[].Config.Env'
[
  "PATH=/home/ubuntu/bin:/home/ubuntu/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
  "BASH_ENV=/usr/local/etc/env",
  "ENV=/usr/local/etc/env",
  "HOME=/home/ubuntu",
  "RENOVATE_BINARY_SOURCE=install",
  "RENOVATE_ONBOARDING_CONFIG={\"$schema\":\"https://docs.renovatebot.com/renovate-schema.json\",\"extends\":[\"config:recommended\"]}"
]
@PhilipAbed
Copy link
Contributor

PhilipAbed commented Oct 17, 2023

Thanks for reporting.

In order to change Git Author, you can be override it using the RENOVATE_GIT_AUTHOR env var, same goes for the RENOVATE_ONBOARDING_CONFIG.

we will document this.

@GreyTeardrop
Copy link
Author

Thank you, @PhilipAbed!

I assume the same applies to other configuration options discovered in the env config like binarySource or dependencyDashboardFooter?

@PhilipAbed
Copy link
Contributor

yes.

@colinodell
Copy link
Contributor

As for the onboarding config, it seems to come from the renovate-ce container image and, being an env, seems to take precedence over anything set in the config file

I spent hours today trying to figure out why the extends part of my onboardingConfig was being ignored by Renovate. It turns out that RENOVATE_ONBOARDING_CONFIG is set as a default env var on the container, and thus its extends was taking precedence over mine. They only way to stop this is for me to move my configuration out of config.js and into my own RENOVATE_ONBOARDING_CONFIG env var for this one config field. This was very difficult to figure out, and the solution doesn't feel great.

Would you consider removing the RENOVATE_ONBOARDING_CONFIG env var from the container?

@colinodell
Copy link
Contributor

(Alternatively, explicitly setting RENOVATE_ONBOARDING_CONFIG to an empty string seems to be a valid workaround to stop the default behavior)

@rarkins
Copy link
Member

rarkins commented Nov 15, 2023

I can think of two possible solutions:

  1. Only set the env if it's undefined by the user, or
  2. Use RENOVATE_CONFIG for defaults so that they are overridable via individual env

@mikaello
Copy link
Contributor

mikaello commented Nov 30, 2023

Shouldn't this be a part of the migration guide? I have also been struggling for a couple of hours now with the migration, and the root cause was this environment variable.

@mhuijgen
Copy link

(Alternatively, explicitly setting RENOVATE_ONBOARDING_CONFIG to an empty string seems to be a valid workaround to stop the default behavior)

It seems if I set this to an empty string in my docker-compose file used to start renovate-ce it will also result in the combined config having an empty onboardingConfig setting. So this does not seem to work for me. Quite annoying undocumented behavior this.

@rarkins
Copy link
Member

rarkins commented Feb 23, 2024

In the next major release we'll stop populating RENOVATE_ONBOARDING_CONFIG by default

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants