-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 silently ignores config if RENOVATE_CONFIG_FILE points to a non-existing file or config.js throws on evaluation #7620
Comments
@rarkins: thanks for accepting the bug report But I think this issue should be prioritized, because the incomplete checks in Line 18 in c2ebd71
renovate itself, meaning that at least in both mentioned cases (if RENOVATE_CONFIG_FILE points to a non-existing file or the configured config.js file throws on evaluation) renovate silently ignores the config and proceeds only with what is left (default config, project-specific config etc.)
This may lead to configured functionality not working and larger portions of config not being applied as expected, without further notice (at least if no debug logging is enabled). |
Alternative 1: debug and find out which type of error is being thrown, add it to the clause Alternative 2: work out if there's a specific error for "file not found" and flip the logic so that we ignore if that's thrown but error for all others |
I'd like to take this one. |
I checked on my Ubuntu VM, and
If it can't find
So, my plan for fixing this issue:
renovate/lib/workers/global/config/parse/file.ts Lines 24 to 27 in 789caad
Check if we have a
Else check for
Else ignore the error. |
Yes, @olegkrivtsov Please defer this issue until we get this merged: |
Yes, but maybe it's already solved - pleases verify |
🎉 This issue has been resolved in version 31.11.5 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
What Renovate type, platform and version are you using?
latest renovate version on self-hosted GitLab instance
Describe the bug
When running
renovate-config-validator
on the followingconfig.js
file (which throws on evaluation if CI_API_V4_URL is undefined):it incorrectly prints
instead of failing and/or re-throwing the exception thrown by the (incorrect) config.js file.
The same happens if we set the
RENOVATE_CONFIG_FILE
env variable to a non-existing filename.I would expect that
renovate-config-validator
also throws or fails in this case.This is because of
renovate/lib/config/file.ts
Line 18 in c2ebd71
only checking for errors of type
SyntaxError
and proceeding silently on all other types of errors (evaluation exceptions, fileNotFound exception etc.)The text was updated successfully, but these errors were encountered: