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-config-validator reports "INFO: Config validated successfully" when no config exists #16025

Open
Konafets opened this issue Jun 12, 2022 · 13 comments · Fixed by #23815
Labels
core:config Related to config capabilities and presets good first issue Suitable for new contributors priority-4-low Low priority, unlikely to be done unless it becomes important to more people type:bug Bug fix of existing functionality

Comments

@Konafets
Copy link

How are you running Renovate?

Mend Renovate hosted app on github.com

If you're self-hosting Renovate, tell us what version of Renovate you run.

32.83.2

Please select which platform you are using if self-hosting.

No response

If you're self-hosting Renovate, tell us what version of the platform you run.

No response

Was this something which used to work for you, and then stopped?

I never saw this working

Describe the bug

I wanted to recreate the on-boarding PR on Gitlab via PR. I did not merge the first onboarding PR, so I do not have any renovate related config file and since its a JAVA project, no package.json. But when I run renovate-config-validator it reports:

INFO: Config validated successfully

I expected either it tells me that there is no config file and/or offers to create one with basic settings.

Relevant debug logs

No response

Have you created a minimal reproduction repository?

No reproduction repository

@Konafets Konafets added priority-5-triage status:requirements Full requirements are not yet known, so implementation should not be started type:bug Bug fix of existing functionality labels Jun 12, 2022
@PhilipAbed
Copy link
Collaborator

PhilipAbed commented Jun 12, 2022

  • Hi, please elaborate, what do you mean by renovate-config-validator?
  • and can you please send all debug logs?
  • could this be related to the requireConfig?
  • you mentioned recreate could it be that you still have some cached config?, or using a global one somehow?

i believe re-creating the on-boarding PR could be problematic on the app side with the same repository name cause of cache , maybe just add the renovate.json manually, or try changing the repository name it could be cached on the app side too.
I'm not sure how to clean app cache, or how long does it take to refresh

@Konafets
Copy link
Author

Hi,

I installed Renovate Bot app in github.com and gave permissions to one repo. RB created the on-boarding PR. Beside that I had another PR, which already updated some of the dependencies, RB would like to update as well.

Here I read that I should rename the onboarding PR from "Configure Renovate" to "Configure Renovate - old" and wait that RB creates a new one. I did, but RB did not created a new one, so I keep searching and found these instructions https://docs.renovatebot.com/getting-started/installing-onboarding/#reconfigure-via-pr. I installed RB globally via NPM and executed renovate-config-validator with the hope that might help in terms to create an onboarding commit locally. To my surprise it told my that my configuration was validated successfully which is weird since I do not have a RB configuration file.

TLDR: The CLI app renovate-config-validator seems not to check if a configuration file exist in the current directory.

@PhilipAbed PhilipAbed added auto:reproduction A minimal reproduction is necessary to proceed priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others priority-5-triage and removed priority-5-triage priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others labels Jun 13, 2022
@github-actions
Copy link
Contributor

Hi there,

Get your issue fixed faster by creating a minimal reproduction. This means a repository dedicated to reproducing this issue with the minimal dependencies and config possible.

Before we start working on your issue we need to know exactly what's causing the current behavior. A minimal reproduction helps us with this.

To get started, please read our guide on creating a minimal reproduction.

We may close the issue if you, or someone else, haven't created a minimal reproduction within two weeks. If you need more time, or are stuck, please ask for help or more time in a comment.

Good luck,

The Renovate team

@PhilipAbed
Copy link
Collaborator

PhilipAbed commented Jun 13, 2022

i believe you should have this parameter, and thats where the config is found, RENOVATE_CONFIG_FILE

@PhilipAbed
Copy link
Collaborator

C:\tests\renovateTutorial>renovate-config-validator
DEBUG: Using RE2 as regex engine
DEBUG: Checking for config file in C:\tests\renovateTutorial/config.js
DEBUG: No config file found on disk - skipping
INFO: Config validated successfully

@rarkins
Copy link
Collaborator

rarkins commented Jun 13, 2022

So the question is: if no config file is found, then should we exit successfully or unsuccessfully?

@PhilipAbed
Copy link
Collaborator

PhilipAbed commented Jun 13, 2022

@rarkins
if the config file is not found we are just Merging the other default configs in, and the validation is successful anyway,
But because we are running from the script it doesn't pass through the requireConfig check, we do that when Onboarding pr..
so its just OK to keep going in a real repo run, it's a script issue only

@Konafets
Copy link
Author

Maybe you could add an additional info, that the current path does not contain a configuration file.

@PhilipAbed PhilipAbed added reproduction:confirmed priority-4-low Low priority, unlikely to be done unless it becomes important to more people and removed auto:reproduction A minimal reproduction is necessary to proceed priority-5-triage labels Jun 13, 2022
@PhilipAbed
Copy link
Collaborator

PhilipAbed commented Jun 13, 2022

we might just need to add config.requireConfig=required and file not found => exit code "-1" with error message maybe

file.ts -> line 70

    } else {
      // istanbul ignore next: we can ignore this
      logger.debug('No config file found on disk - skipping');
      //---------------------------- we can add this, but i'm not sure it won't hurt any other flow :D
      if(config.requireConfig === "required"){
        logger.fatal('No Config File Found ');
        process.exit(1);
      }
    }

@rarkins
Copy link
Collaborator

rarkins commented Jun 13, 2022

I think it will always be true if there's no config

@rarkins
Copy link
Collaborator

rarkins commented Feb 24, 2023

Resolution: fail if no config file found at all

@rarkins rarkins added good first issue Suitable for new contributors status:ready and removed status:requirements Full requirements are not yet known, so implementation should not be started labels Feb 24, 2023
@HonkingGoose HonkingGoose added the core:config Related to config capabilities and presets label Jul 19, 2023
@HonkingGoose
Copy link
Collaborator

I'm re-opening this issue because we reverted the PR that closed this issue:

@HonkingGoose HonkingGoose reopened this Nov 19, 2023
@viceice
Copy link
Member

viceice commented Nov 20, 2023

I think it should only fail if the strict flag is used

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core:config Related to config capabilities and presets good first issue Suitable for new contributors priority-4-low Low priority, unlikely to be done unless it becomes important to more people type:bug Bug fix of existing functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants