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(replacements): add replacements:gradle-wrapper-validation-action #31645

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

Conversation

mueller-ma
Copy link
Contributor

Changes

See Readme at https://github.com/gradle/wrapper-validation-action for more information.

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:

  • 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

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.

We normally don't want to do "replacements"
When the change is breaking. An alternative here is to met the user update to v3 and then migrate them

@mueller-ma
Copy link
Contributor Author

Now the user needs to update to version 3 before the replacement happens.

"description": "gradle/wrapper-validation-action got renamed to gradle/actions/wrapper-validation",
"packageRules": [
{
"matchCurrentVersion": "/3(\\.\\d+\\.\\d+)?/",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is the intent to allow either 3 or e.g. 3.2.10? and not e.g. 3.2?

Copy link
Collaborator

Choose a reason for hiding this comment

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

The code started with:

        "matchCurrentVersion": "3",

I asked if that would match all possible versions in the 3 range:

Our developers docs list the rules for replacement presets:

Rules for replacement presets

  1. Replacement PRs should ideally propose a replacement only once the user is on a compatible version, by specifying a compatible matchCurrentVersion constraint
  2. If no compatible replacement upgrade is possible, it's acceptable to propose an incompatible one (e.g. a major version upgrade)
  3. Replacements should update the user to the first recommended version of the new dependency and not include any new changes - whether breaking or not - if they can be avoided, in short: pin the new version

If possible, replacement presets should give the user a replacement version that is functionally identical to the last version under the old name.
We only want a user's tests to fail because of broken references to the old package name, and not because the maintainer(s) changed the behavior of the package.

The key phrase in the docs is:

Replacement PRs should ideally propose a replacement only once the user is on a compatible version, by specifying a compatible matchCurrentVersion constraint

So then the question is, is just being on any version 3 of the program good enough for a user to quickly merge the replacement PR? Or does the user need to be on the last version of the old package?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So then the question is, is just being on any version 3 of the program good enough for a user to quickly merge the replacement PR? Or does the user need to be on the last version of the old package?

@HonkingGoose I think it's good replace the dependency when on any version 3.

Copy link
Collaborator

Choose a reason for hiding this comment

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

OK but should it be "matchCurrentVersion": "/^3\\.", ? Note the ^ to enforce it at the start of the line, and the mandatory . (assumes that there will always be some precision to the version and not just `"3" itself, is that safe?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

OK but should it be "matchCurrentVersion": "/^3\\.", ? Note the ^ to enforce it at the start of the line, and the mandatory . (assumes that there will always be some precision to the version and not just `"3" itself, is that safe?)

Suggested change
"matchCurrentVersion": "/3(\\.\\d+\\.\\d+)?/",
"matchCurrentVersion": "/^3\\.",

This suggestion is the copy/pasted code from @rarkins. I don't know if it's a good idea to apply the suggestion...

I'll let the maintainers decide what to do with the code. 😉

Copy link
Collaborator

Choose a reason for hiding this comment

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

The current one allows 3, 30, 3d, etc. Is careful validation necessary to prevent these?

@rarkins rarkins added the auto:inactive-pr PR has become inactive and we want to prompt the submitter label Feb 7, 2025
Copy link
Contributor

github-actions bot commented Feb 7, 2025

Hi there,

This PR appears to have been inactive for a while. Please let us know if you are still working on it, or if we can close it for now.

Thanks, the Renovate team

@HonkingGoose HonkingGoose added the maintainer-input-needed Awaiting feedback from a maintainer label Feb 9, 2025
@HonkingGoose HonkingGoose requested a review from rarkins February 9, 2025 13:53
@rarkins rarkins removed the auto:inactive-pr PR has become inactive and we want to prompt the submitter label Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintainer-input-needed Awaiting feedback from a maintainer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants