renovatebot / config-help

Please use the Discussions feature of https://github.com/renovatebot/renovate instead
https://github.com/renovatebot/renovate/discussions
MIT License
27 stars 16 forks source link

ignore Docusaurus v2.0.0-alpha.f37987f32 type PRs #1014

Closed HonkingGoose closed 3 years ago

HonkingGoose commented 3 years ago

Which Renovate are you using?

WhiteSource Renovate App

Which platform are you using?

GitHub.com

Have you checked the logs? Don't forget to include them if relevant

I don't think the logs are relevant for now.

What would you like to do?

Background

Docusaurus v2 are now publishing "canary" releases:

Make new fixes accessible to power users as soon as they get merged, by publishing a npm version under the "canary" dist tag.

See PR 3827, at the Docusaurus GitHub repo to get the inside view on what they're doing there.

What I want

The new "canary" release process that Docusaurus uses causes Renovate to open a PR for those canary releases. These PRs eat into my build minutes for the website, and I don't want to have really rough dev-work in production anyways. I only want the mainline "human-approved" releases.

The pattern for the canary releases seems to be the same as for the normal releases, with the exception that they use a commit hash instead of a version number.

Versions I want/don't want

Yes please No thanks
v2.0.0-alpha.69 or v2.0.0 v2.0.0-alpha.f37987f32

Example wanted PR:

https://github.com/RoostingGeese/git-gosling/pull/90

Example unwanted PRs:

https://github.com/RoostingGeese/git-gosling/pull/96 https://github.com/RoostingGeese/git-gosling/pull/95 https://github.com/RoostingGeese/git-gosling/pull/91

Main question:

I guess I'm looking for a regex that can filter out the unwanted branches...

It would be way cleaner if I could tell the Renovate bot to ignore the npm "canary" dist tag versions, but I haven't found this in the docs. I'm thinking that the ignore npm tagged version thing might also warrant a proper feature request at the renovatebot/renovate repository... πŸ˜„

My current config:

Copy/pasted from https://github.com/RoostingGeese/git-gosling/blob/main/renovate.json

{
  "extends": ["config:base"],
  "lockFileMaintenance": {
    "enabled": true
  },
  "dependencyDashboard": true
}
rarkins commented 3 years ago

You can define a package rule with allowedVersions to either allow only a pattern you want or disallow a pattern you don't.

HonkingGoose commented 3 years ago

Regex problems

I've not been able to get the regex working, I think I'm doing something wrong. The Renovate bot was complaining as well. I'm trying to match only the v2.0.0 release OR v2.0.0-alpha.69 releases.

{
  "extends": ["config:base"],
  "lockFileMaintenance": {
    "enabled": true
  },
  "dependencyDashboard": true,
  "packageRules": [
    {
      "packagePatterns": ["^@docusaurus"],
      "allowedVersions": "/v2.0.0(-alpha.(\d\d)|)"
    }
  ]
}

dependencyDashboardApproval workaround

Because I could not get it working, I'm now using the dependencyDashboardApproval workflow for the Docusaurus packages instead:

{
  "extends": ["config:base"],
  "lockFileMaintenance": {
    "enabled": true
  },
  "dependencyDashboard": true,
  "packageRules": [
    {
      "packagePatterns": ["^@docusaurus"],
      "dependencyDashboardApproval": true
    }
  ]
}

This is still not optimal, but it's the best that I could get going for now... 😞

viceice commented 3 years ago

wrong regex, try this:

{
  "extends": ["config:base"],
  "lockFileMaintenance": {
    "enabled": true
  },
  "dependencyDashboard": true,
  "packageRules": [
    {
      "packagePatterns": ["^@docusaurus"],
      "allowedVersions": "/^v\\d+\\.\\d+\\.\\d+(-alpha\\.(\\d+))?$/"
    }
  ]
}

edit: missing/more escape

viceice commented 3 years ago

Maybe you should better use followTag


{
  "extends": ["config:base"],
  "lockFileMaintenance": {
    "enabled": true
  },
  "dependencyDashboard": true,
  "packageRules": [
    {
      "packagePatterns": ["^@docusaurus"],
      "followTag": "latest"
    }
  ]
}
rarkins commented 3 years ago

I think he's after next tag, not latest:

image

Problem is you then need to switch back from that config later once it hits 2.0.0 stable.

A simpler allowVersions could be !/(alpha|beta|rc)\.[a-z0-9]{7,}/

viceice commented 3 years ago

nope, you are on wrong npm package, he has https://www.npmjs.com/package/@docusaurus/core and https://www.npmjs.com/package/@docusaurus/preset-classic where the latest points to 2.0.0-alpha.69 πŸ˜‰

rarkins commented 3 years ago

OK, that's some unfortunately tagging then. I'd recommend to stick to allowedVersions patterns considering that.

viceice commented 3 years ago

yeah, i think the docusaurus v2 package is a forward only package to pull in the new scoped packages

HonkingGoose commented 3 years ago

I'll try @viceice's better regex and see if that does the trick in filtering out the unwanted PRs. 🀞

HonkingGoose commented 3 years ago

I can confirm the new regex from @viceice is working. Jay! πŸŽ‰

The Docusuaurus v2 project has made some new canary releases, and Renovate ignored those releases.

Closing this issue, as it seems to be resolved now. πŸ˜„ Thanks for all the help and input!