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(config): filePatterns #34615

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

RahulGautamSingh
Copy link
Collaborator

@RahulGautamSingh RahulGautamSingh commented Mar 4, 2025

Changes

  • Migrate fileMatch to filePatterns
  • Add glob pattern support

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 select one)

I have verified these changes via:

Co-authored-by: Sebastian Poxhofer <secustor@users.noreply.github.com>
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
secustor
secustor previously approved these changes Mar 5, 2025
@RahulGautamSingh RahulGautamSingh requested a review from viceice March 5, 2025 20:54
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.

there are some more samples, which can be simplified by using glob, otherwise LGTM

Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
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.

we can do the regex to glob changes in a followup pr of cause

@viceice
Copy link
Member

viceice commented Mar 6, 2025

needs update because of:

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.

Partial review done. Please note each of the suggested changes and apply them widely to the whole PR. e.g. ^foo$ patterns should always just be foo.

secustor
secustor previously approved these changes Mar 12, 2025
`fileMatch` is used by Renovate to know which files in a repository to parse and extract.
`fileMatch` patterns in the user config are added to the default values and do not replace them.
The default `fileMatch` patterns cannot be removed, so if you need to include or exclude specific paths then use the `ignorePaths` or `includePaths` configuration options.
`filePatterns` tells Renovate which repository files to parse and extract.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
`filePatterns` tells Renovate which repository files to parse and extract.
`filePatterns` were formerly known as `fileMatch`, and regex-only.
`filePatterns` instead supports regex or glob patterns, and any existing config containing `fileMatch` patterns will be automatically migrated.
Do not use the below guide for `fileMatch` if you are using an older version of Renovate.
`filePatterns` tells Renovate which repository files to parse and extract.

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.

Sorry, I've had a change of opinion on something here. Instead of migrating + improving the regexes by converting them to glob, we should instead do the minimal work and keep them as regex.

In other words:

  • Keep all default fileMatch values as regex, simply add / ... / wrappers to existing ones (do not change any to glob in this PR)
  • Also do the same for any config presets such as the workarounds
  • For docs examples, it's OK to keep the glob changes if preferred
  • Make regex to glob changes later, in more easily verifiable batches

@RahulGautamSingh
Copy link
Collaborator Author

RahulGautamSingh commented Mar 13, 2025

Make regex to glob changes later, in more easily verifiable batches

Sure. I was thinking the same but went on as suggestions kept coming

Btw, for making the verification easier & reliable, I was thinking of adding tests to each manager. The test will check if the fileMatch values work with their corresponding filenames or not. This way, when we switch to glob any faulty globs will be caught by a failed test.

@rarkins
Copy link
Collaborator

rarkins commented Mar 13, 2025

I don't think we need any new tests yet

Copy link
Collaborator

@secustor secustor left a comment

Choose a reason for hiding this comment

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

Conflict and a lot of conversations should not be solved.

@RahulGautamSingh
Copy link
Collaborator Author

Conflict and a lot of conversations should not be solved.

Reverted he changes as per this comment. Will replace regex with glob in future Prs

secustor
secustor previously approved these changes Mar 16, 2025
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate fileMatch to filePatterns and support matchRegexOrGlobList
6 participants