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

fix: Add validations for aliases #6426

Merged
merged 5 commits into from Jun 4, 2020

Conversation

adusumillipraveen
Copy link
Contributor

Currently aliases for helm-requirements is failing when configured during nested json validation.

INFO: Repository has invalid config
{
  "error": {
    "configFile": ".github/renovate.json",
    "validationError": "The renovate configuration file contains some invalid settings",
    "validationMessage": "Invalid configuration option: helm-requirements.aliases.stable"
  }

Closes https://github.com/renovatebot/config-help/issues/679

@adusumillipraveen adusumillipraveen changed the title Make Aliases freeChoice as it fails validation Bug: Make Aliases freeChoice as it fails validation Jun 3, 2020
@adusumillipraveen adusumillipraveen changed the title Bug: Make Aliases freeChoice as it fails validation fix: Make Aliases freeChoice as it fails validation Jun 3, 2020
@adusumillipraveen
Copy link
Contributor Author

@rarkins any thoughts on this PR ? I am not sure if this is the right fix, but happy to contribute if you can guide me.

@rarkins
Copy link
Collaborator

rarkins commented Jun 4, 2020

@adusumillipraveen we don't actually do the validation you're seeing using a JSON validator - it's an internal tool with a bit more config awareness. So unfortunately I think the solution is instead to add aliases awareness to https://github.com/renovatebot/renovate/blob/master/lib/config/validation.ts

We should check:

  • aliases is an object
  • The object is one deep
  • values of each field are valid URIs

@adusumillipraveen
Copy link
Contributor Author

@adusumillipraveen we don't actually do the validation you're seeing using a JSON validator - it's an internal tool with a bit more config awareness. So unfortunately I think the solution is instead to add aliases awareness to https://github.com/renovatebot/renovate/blob/master/lib/config/validation.ts

We should check:

  • aliases is an object
  • The object is one deep
  • values of each field are valid URIs

Thanks @rarkins , i pushed a commit to add specific validations for aliases along with some tests. Please review.

@adusumillipraveen adusumillipraveen changed the title fix: Make Aliases freeChoice as it fails validation fix: Add validations for aliases Jun 4, 2020
Copy link
Collaborator

@rarkins rarkins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check if we can reuse the existing is module for url validation

lib/config/validation.ts Outdated Show resolved Hide resolved
@rarkins rarkins merged commit 0e21892 into renovatebot:master Jun 4, 2020
@adusumillipraveen adusumillipraveen deleted the patch-1 branch June 4, 2020 13:51
@renovate-release
Copy link
Collaborator

🎉 This PR is included in version 20.25.7 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants