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

Renovate / Add support for renovate.config.js #2445

Closed
wants to merge 1 commit into from

Conversation

Djiit
Copy link

@Djiit Djiit commented Apr 8, 2020

As the preferred way for using Renovate with their official Github Action is to use a .js file instead of a json, we should add renovate.js and renovate.config.js.

Changes proposed:

  • Add

@JimiC
Copy link
Member

JimiC commented Apr 8, 2020

This also adds support for renovate.config.json. Don't know if this is wanted.

@Djiit
Copy link
Author

Djiit commented Apr 8, 2020

Nope. How can I prevent it ?

@JimiC
Copy link
Member

JimiC commented Apr 8, 2020

Both need to be added in extensions instead.

@JimiC
Copy link
Member

JimiC commented Apr 8, 2020

But it conflicts with https://docs.renovatebot.com/configuration-options/.
Do you have any link that supports your claim?

@Djiit
Copy link
Author

Djiit commented Apr 8, 2020

Yes sure. A .JS file is used by their official Github Action : https://github.com/vidavidorra/github-action-renovate (strange it is not yet under their renovate org, but anyway they sent me here in this comment : renovatebot/renovate#5881 (comment))

As the preferred way for using Renovate with their official Github Action is to use a `.js` file instead of a `json`, we should add `renovate.js` and `renovate.config.js`.
@Djiit
Copy link
Author

Djiit commented Apr 8, 2020

Updated the commit with your suggestions

@JimiC
Copy link
Member

JimiC commented Apr 8, 2020

I ended up digging into Renovate code (something I didn't want to do).
According to their code-base:
These are the supported config file names: https://github.com/renovatebot/renovate/blob/master/lib/config/app-strings.ts
which are checked here: https://github.com/renovatebot/renovate/blob/master/lib/workers/repository/init/config.ts#L38

But they also use several other config parsers, one of which is a file parser -> https://github.com/renovatebot/renovate/blob/master/lib/config/index.ts#L50

Now if you follow the code you will end up in the file config parser -> https://github.com/renovatebot/renovate/blob/master/lib/config/file.ts which in this line https://github.com/renovatebot/renovate/blob/master/lib/config/file.ts#L15 they use require (commonjs module loader) to load a json from a js file.

This is how they do it which is unconventional if you ask me.

Bottom line, either ask them to officially support js config files or change the GitHub Action implementation.

@Djiit
Copy link
Author

Djiit commented Apr 8, 2020

Allright :). Thanks for your complete anwser. I'll close this.

@Djiit Djiit closed this Apr 8, 2020
@JimiC
Copy link
Member

JimiC commented Apr 8, 2020

Furthermore, the renovate Github Action should not use that "hack" and let renovate load the configuration from an official supported file, in my opinion.

@JimiC
Copy link
Member

JimiC commented Apr 8, 2020

Reading the entrypoint.sh of https://github.com/renovatebot/github-action/blob/master/src/entrypoint.sh the action doesn't work if you don't specify a configuration path.
And it forces you to use a js file.
Totally unconventional.

@JimiC
Copy link
Member

JimiC commented Apr 8, 2020

This https://github.com/renovatebot/github-action/blob/master/src/entrypoint.sh#L21 should definitely be changed to support the official config filenames.

@Djiit
Copy link
Author

Djiit commented Apr 8, 2020

Hey, yes I totally agree with you. nvm, I'll reopen a PR here if things change on their side :)

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

Successfully merging this pull request may close these issues.

None yet

2 participants