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: mavenPropertyVersions regexManager #24425

Merged
merged 3 commits into from
Sep 21, 2023

Conversation

rombert
Copy link
Contributor

@rombert rombert commented Sep 14, 2023

Changes

Adds a new regexManager that can be used for properties defined in pom.xml Maven files.

Context

#21495

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:

  • 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

@rarkins rarkins requested a review from Churro September 14, 2023 16:45
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.

isn't this something the maven manager should support out of the box? 🤔

lib/config/presets/internal/regex-managers.ts Outdated Show resolved Hide resolved
@rombert
Copy link
Contributor Author

rombert commented Sep 14, 2023

isn't this something the maven manager should support out of the box? 🤔

Good question. These properties are actually consumed by other plug-ins, which are not visible to the maven dependency manager. Not sure if they could be. Two examples I am aware of:

@rombert rombert requested a review from viceice September 14, 2023 20:29
Copy link
Collaborator

@Churro Churro left a comment

Choose a reason for hiding this comment

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

isn't this something the maven manager should support out of the box? 🤔

It does:

const propsNode = project.childNamed('properties');
const props: Record<string, MavenProp> = {};
if (propsNode?.children) {
for (const propNode of propsNode.children as XmlElement[]) {
const key = propNode.name;
const val = propNode?.val?.trim();
if (key && val) {
const fileReplacePosition = propNode.position;
props[key] = { val, fileReplacePosition, packageFile };
}
}
}
result.mavenProps = props;

I guess it's really about those special cases @rombert mentioned, where properties are defined but not consumed by dependencies.

lib/config/presets/internal/regex-managers.ts Outdated Show resolved Hide resolved
@rombert rombert requested a review from Churro September 19, 2023 15:12
@rarkins rarkins enabled auto-merge September 21, 2023 05:16
@rarkins rarkins added this pull request to the merge queue Sep 21, 2023
Merged via the queue into renovatebot:main with commit ebcc608 Sep 21, 2023
@renovate-release
Copy link
Collaborator

🎉 This PR is included in version 36.100.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@rombert rombert deleted the feature/maven-regexp-manager-preset branch September 21, 2023 08:05
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 22, 2023
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.

5 participants