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

feat!: categories #16534

Merged
merged 153 commits into from
Jul 4, 2023
Merged

feat!: categories #16534

merged 153 commits into from
Jul 4, 2023

Conversation

secustor
Copy link
Collaborator

@secustor secustor commented Jul 11, 2022

Changes

This PR adds categories to managers and implements a matcher for package rules.

Context

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please tick one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

https://github.com/secustor/renovate_autodiscoverfilter

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.

What are your thoughts on whether to remove languages in favour of categories?

docs/usage/configuration-options.md Outdated Show resolved Hide resolved
lib/constants/category.ts Outdated Show resolved Hide resolved
lib/constants/category.ts Outdated Show resolved Hide resolved
@secustor
Copy link
Collaborator Author

What are your thoughts on whether to remove languages in favor of categories?

I think we should remove it as it basically does the same, but is more flexible. If we want to group tags together we could replace tags with labels ( key/value pairs) and allow matches to them.

e.g:
language:jvm to match specifically managers with a language=jvm label
language:* / language:/.+/ match all managers which have a language tag

use-case: deactivate all activity of Renovate except renovating actual source code

{
  "packageRules": [
    {
       "matchCategories": ["language:!/.+/"],
       "enabled": "false"
    }
  ]
}

That way we can prevent name collisions and give the user more match options.

From a migration standpoint the steps would be as following:

  1. merge this PR
  2. Replace languages with categories in the docs and website
  3. Add waning to the DependencyIssue and PRs if matchLanguages is used
  4. After some time remove the language in a breaking release

@secustor secustor requested a review from rarkins July 12, 2022 15:30
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.

packageRules using matchCategories can only be applied after extraction? e.g. you cannot use categories to change how the extraction config itself looks?

lib/constants/category.ts Outdated Show resolved Hide resolved
lib/constants/category.ts Outdated Show resolved Hide resolved
@secustor
Copy link
Collaborator Author

packageRules using matchCategories can only be applied after extraction? e.g. you cannot use categories to change how the extraction config itself looks?

No, I haven't been aware of this. So this is also the case currently for matchLanguages, which I have modeled matchCategories after?

lib/constants/category.ts Outdated Show resolved Hide resolved
@rarkins
Copy link
Collaborator

rarkins commented Sep 5, 2022

Thoughts on removing languages/matchLanguages at the same time? I think we could migrate it reasonably successfully.

@secustor
Copy link
Collaborator Author

secustor commented Sep 6, 2022

I think we should implement in parallel at first and deprecate language settings as we try to reduce migration code.

From a technical standpoint there is no reason which would prevent this, but we have changes which does not map one to one.
Such a case is the docker category which is not applied the same as the docker programming language https://github.com/renovatebot/renovate/pull/16534/files#diff-3a57948c086543a7aaafd693e336ed8b566d6a93804fab7d7f2f27af39aaadddR5

docs/usage/configuration-options.md Outdated Show resolved Hide resolved
docs/usage/configuration-options.md Outdated Show resolved Hide resolved
lib/config/options/index.ts Outdated Show resolved Hide resolved
tools/docs/manager.ts Outdated Show resolved Hide resolved
docs/usage/configuration-options.md Outdated Show resolved Hide resolved
lib/constants/category.ts Outdated Show resolved Hide resolved
lib/modules/manager/github-actions/index.ts Show resolved Hide resolved
lib/constants/category.ts Show resolved Hide resolved
docs/usage/configuration-options.md Outdated Show resolved Hide resolved
docs/usage/configuration-options.md Outdated Show resolved Hide resolved
docs/usage/configuration-options.md Outdated Show resolved Hide resolved
docs/usage/configuration-options.md Outdated Show resolved Hide resolved
docs/usage/configuration-options.md Show resolved Hide resolved
docs/usage/configuration-options.md Outdated Show resolved Hide resolved
docs/usage/configuration-options.md Outdated Show resolved Hide resolved
docs/usage/configuration-options.md Outdated Show resolved Hide resolved
HonkingGoose
HonkingGoose previously approved these changes Dec 15, 2022
Copy link
Collaborator

@HonkingGoose HonkingGoose left a comment

Choose a reason for hiding this comment

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

I'm happy with the Markdown docs.

I'll let the maintainers review the code. 😉

@rarkins rarkins requested a review from viceice December 16, 2022 12:37
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.

Any preview of how the autogenerated docs will look?

docs/usage/configuration-options.md Outdated Show resolved Hide resolved
docs/usage/configuration-options.md Show resolved Hide resolved
lib/modules/manager/helmv3/index.ts Outdated Show resolved Hide resolved
lib/modules/manager/npm/index.ts Show resolved Hide resolved
@rarkins rarkins changed the title feat: introduce categories for managers and packageRules to match them feat: categories Dec 17, 2022
@rarkins rarkins requested a review from viceice July 1, 2023 13:00
Copy link
Member

@viceice viceice left a comment

Choose a reason for hiding this comment

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

readded comment

Copy link
Collaborator

@HonkingGoose HonkingGoose left a comment

Choose a reason for hiding this comment

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

I've read the changed docs, but I don't know if the changes are good or bad.

@rarkins
Copy link
Collaborator

rarkins commented Jul 3, 2023

I think this is the coverage analysis for this PR: https://app.codecov.io/gh/renovatebot/renovate/pull/16534

@secustor secustor requested a review from viceice July 3, 2023 17:12
viceice
viceice previously approved these changes Jul 3, 2023
Copy link
Member

@viceice viceice left a comment

Choose a reason for hiding this comment

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

otherwise LGTM

lib/config/migrations/custom/package-rules-migration.ts Outdated Show resolved Hide resolved
viceice
viceice previously approved these changes Jul 4, 2023
@rarkins rarkins dismissed viceice’s stale review July 4, 2023 08:58

The merge-base changed after approval.

# Conflicts:
#	docs/usage/configuration-options.md
#	lib/config/migrations/custom/package-rules-migration.ts
#	lib/config/presets/internal/config.ts
#	lib/config/types.ts
#	lib/util/package-rules/matchers.ts
@rarkins rarkins requested a review from viceice July 4, 2023 09:26
@rarkins rarkins merged commit a28b7e2 into renovatebot:v36 Jul 4, 2023
33 checks passed
@secustor secustor deleted the implement_category branch July 4, 2023 10:12
rarkins added a commit that referenced this pull request Jul 4, 2023
Co-authored-by: Rhys Arkins <rhys@arkins.net>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
rarkins pushed a commit that referenced this pull request Jul 4, 2023
Closes #13953

Co-authored-by: Rhys Arkins <rhys@arkins.net>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

BREAKING CHANGE: languages are now called categories instead
rarkins pushed a commit that referenced this pull request Jul 4, 2023
Closes #13953

Co-authored-by: Rhys Arkins <rhys@arkins.net>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

BREAKING CHANGE: languages are now called categories instead
rarkins pushed a commit that referenced this pull request Jul 4, 2023
Closes #13953

Co-authored-by: Rhys Arkins <rhys@arkins.net>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

BREAKING CHANGE: languages are now called categories instead
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
breaking Breaking change, requires major version bump
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace programming language with categories
6 participants