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

lint and warn when a packageRule object has both matchUpdateTypes AND allowedVersions #9172

Closed
HonkingGoose opened this issue Mar 17, 2021 · 4 comments
Labels
priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others status:requirements Full requirements are not yet known, so implementation should not be started type:feature Feature (new functionality)

Comments

@HonkingGoose
Copy link
Collaborator

What would you like Renovate to be able to do?

A user was trying to exclude certain Docusaurus v2 releases with this config:

"packageRules": [
    {
      "description": "Allow mainline @docusaurus releases, ignore canary releases",
      "groupName": "docusaurus monorepo",
      "matchSourceUrlPrefixes": ["https://github.com/facebook/docusaurus"],
      "matchUpdateTypes": ["major", "minor", "patch"],
      "allowedVersions": "!/\\b([a-f0-9]{9})?$/"
    }
  ]

Renovate still opened PRs to update to the canary releases. The user asked why it was not working.

@rarkins then said (emphasis mine):

You can't mix matchUpdateTypes with allowedVersions in the same package rule. It's something we should try to lint and warn about, but we don't yet. The reason is because versions filtering is done the step before we know the update type. So by the time you. know the update type and match the rule, it's too late to apply the allowedVersions rule. I don't think that extra line achieves anything though and can be removed.

So the requirement is:

IF a packageRule object
HAS matchUpdateTypes AND allowedVersions
THEN warn user that this is not a valid combination by raising a config warning issue on their repo.

Did you already have any implementation ideas?

I'll let the Renovate developers figure out how to implement this. 😉

@HonkingGoose HonkingGoose added priority-5-triage status:requirements Full requirements are not yet known, so implementation should not be started type:feature Feature (new functionality) priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others and removed priority-5-triage labels Mar 17, 2021
@HonkingGoose
Copy link
Collaborator Author

@rarkins does PR #9649 resolve this issue? Or do we need extra code to resolve this?

@rarkins rarkins closed this as completed Apr 22, 2021
@rarkins rarkins reopened this Apr 22, 2021
@HonkingGoose
Copy link
Collaborator Author

@rarkins Thank you for fixing this. 😄 ❤️

@rarkins
Copy link
Collaborator

rarkins commented Apr 22, 2021

Thanks for documenting it in an issue!

@renovate-release
Copy link
Collaborator

🎉 This issue has been resolved in version 25.1.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others status:requirements Full requirements are not yet known, so implementation should not be started type:feature Feature (new functionality)
Projects
None yet
Development

No branches or pull requests

3 participants