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.47k stars 2.3k forks source link

Renovate reopens the configure MR if config missing (GitLab) #874

Closed Phyks closed 7 years ago

Phyks commented 7 years ago

Hi,

I am using Renovate through Heroku (free plan, with Heroku scheduler) for one of my FOSS project hosted on Gitlab.

I set it up 10 days ago, and everything was working smoothly. I just closed the "Configure Renovate MR" as the default configuration was fine for me and I did not specifically want to merge renovate-specific configuration in my repo. As far as I understand, closing this onboarding MR should make Renovate run with its default configuration, and it should handle it fine. It did for about a week.

This weekend, it opened a new "Configure Renovate" MR. Is there any reason for Renovate to do it, just as if I just started using it. Is there any reason for it to do so?

Thanks!

rarkins commented 7 years ago

I suspect it's related to same recent %2F branch escaping issues we've been seeing. Which version of GitLab are you running?

Phyks commented 7 years ago

I am running GitLab Community Edition 10.0.2. The MRs can be seen at https://framagit.org/bnjbvr/kresus/merge_requests/469 and https://framagit.org/bnjbvr/kresus/merge_requests/492 in case it can be useful. :)

rarkins commented 7 years ago

Could you try running at debug and attach the logs, or email them to me (firstname@lastname.net)? Please try this before you close or merge MR#492. I think you run something like heroku config:set LOG_LEVEL=debug

Renovate is meant to detect the existing "Configure Renovate" MR and not require a renovate.json or renovate config in package.json. But if you get tired of waiting for a fix then adding "renovate": {}," to your root package.json would be the quickest way to make this Configure Renovate go away.

rarkins commented 7 years ago

By the way, it's particularly confusing that it worked for a while (i.e. raised proper MRs) but then reverted back to Configure Renovate. Also I would have expected that if it reverted to Configure Renovate then it would also delete the other MRs, so it's doubling confusing. Are you aware of any changes to the GitLab install recently?

Phyks commented 7 years ago

I sent you the debug logs by email. Ok for the workaround!

Not sure about the Gitlab install. Apart from upgrades, I don't think there were any major changes lately. I will ask the admins and let you know.

rarkins commented 7 years ago

Thanks I received the logs.

I think I know what the problem is now. GitLab's API does not allow us to search MRs by title (e.g. "Configure Renovate") so instead the best we can do is search for a full list of all MRs created by our account, and check the results after we receive them if one of them has that title. The problem comes because GitLab paginates its results so once you have started using renovate and the number of MRs it has created exceeds the size of the pagination, we then "miss" the original Configure Renovate MR.

Full fix = add pagination support to the findPr function Workaround = add empty renovate config to your package.json

I suggest though that you consider setting your renovate config to be:

  "renovate": { "extends: [":app"] }

This ":app" preset contains smarter settings than Renovate's defaults, because they are a little more opinionated. As an example, with this preset you will see all babel monorepo dependencies combined into one MR, and same with react.

Also, I think that in the next major release of Renovate I will make renovate config mandatory, i.e. need at least an empty {} so that we're not hunting for a Configure Renovate MR forever.

Phyks commented 7 years ago

Sure, this small renovate config sounds fair to add :)

Would you have some docs about existing presets and the exact things that are included in each of them? I could not find it in the wiki or on the website :/

Thanks!

rarkins commented 7 years ago

Sorry for the delay, I missed this:

Would you have some docs about existing presets and the exact things that are included in each of them? I could not find it in the wiki or on the website :/

Unfortunately there's not much in the docs yet apart from this: https://renovateapp.com/docs/configuration-reference/config-presets

All the presets I have created or accepted from others are within subdirectories here: https://github.com/singapore/renovate-config/tree/master/packages

Each preset should have a "description" field which.. describes it in plain english. The idea was that then these presets become somewhat "self documenting" as a result. I plan to index them and add a search function to the renovateapp.com website so if people are after certainly functionality then they can search and find any existing presets that match.

Phyks commented 7 years ago

No worries, thanks for the links! :) -- Phyks

Le 12 octobre 2017 08:04:24 UTC-07:00, Rhys Arkins notifications@github.com a écrit :

Sorry for the delay, I missed this:

Would you have some docs about existing presets and the exact things that are included in each of them? I could not find it in the wiki or on the website :/

Unfortunately there's not much in the docs yet apart from this: https://renovateapp.com/docs/configuration-reference/config-presets

All the presets I have created or accepted from others are within subdirectories here: https://github.com/singapore/renovate-config/tree/master/packages

Each preset should have a "description" field which.. describes it in plain english. The idea was that then these presets become somewhat "self documenting" as a result. I plan to index them and add a search function to the renovateapp.com website so if people are after certainly functionality then they can search and find any existing presets that match.