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(gradle): Support for gradle consistent versions plugin #19182

Merged
merged 54 commits into from
Dec 8, 2022

Conversation

janhoy
Copy link
Contributor

@janhoy janhoy commented Nov 30, 2022

Changes

Support for plugin gradle-consistent-versions by Palantir

Context

See #8017

Documentation (please check one with an [x])

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

May also need website update

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

Small test repo: https://github.com/janhoy/gradle-consistent

Much larger, realistic test repo: https://github.com/cominvent/solr-playground

Signed-off-by: Jan Høydahl janhoy@users.noreply.github.com

Closes #8017

Fixes renovatebot#8017

Signed-off-by: Jan Høydahl <janhoy@users.noreply.github.com>
Signed-off-by: Jan Høydahl <janhoy@users.noreply.github.com>
Signed-off-by: Jan Høydahl <janhoy@users.noreply.github.com>
Signed-off-by: Jan Høydahl <janhoy@users.noreply.github.com>
@janhoy janhoy changed the title Support for consistent versions plugin by Palantir feat(gradle): Support for gradle consistent versions plugin Nov 30, 2022
@rarkins rarkins requested a review from Churro November 30, 2022 06:37
@janhoy
Copy link
Contributor Author

janhoy commented Nov 30, 2022

A question - it is fairly easy to parse what lines in versions.props are test dependencies (below a certain header at the bottom). Would it make sense to tag those as depType = devDependencies for some reason?

@rarkins
Copy link
Collaborator

rarkins commented Nov 30, 2022

A question - it is fairly easy to parse what lines in versions.props are test dependencies (below a certain header at the bottom). Would it make sense to tag those as depType = devDependencies for some reason?

devDependencies is a term from npm, which you don't need to use. Instead, using depType=test would be fine and we could adjust any presets we have to include that term if we need

lib/modules/manager/gradle/artifacts.ts Outdated Show resolved Hide resolved
lib/modules/manager/gradle/artifacts.ts Show resolved Hide resolved
lib/modules/manager/gradle/extract.spec.ts Outdated Show resolved Hide resolved
lib/modules/manager/gradle/extract.spec.ts Outdated Show resolved Hide resolved
lib/modules/manager/gradle/extract.spec.ts Outdated Show resolved Hide resolved
janhoy and others added 16 commits December 1, 2022 19:10
Co-authored-by: Johannes Feichtner <Churro@users.noreply.github.com>
Signed-off-by: Jan Høydahl <janhoy@users.noreply.github.com>
Signed-off-by: Jan Høydahl <janhoy@users.noreply.github.com>
…po top-level

Signed-off-by: Jan Høydahl <janhoy@users.noreply.github.com>
Signed-off-by: Jan Høydahl <janhoy@users.noreply.github.com>
- support projects in sub folders (monorepo)
- don't check for existence until you see versions.props
- explicitly skip versions.lock
- more compact tests, uses fsMock dict trick and shorter example buildfiles

Signed-off-by: Jan Høydahl <janhoy@users.noreply.github.com>
Signed-off-by: Jan Høydahl <janhoy@users.noreply.github.com>
Signed-off-by: Jan Høydahl <janhoy@users.noreply.github.com>
Signed-off-by: Jan Høydahl <janhoy@users.noreply.github.com>
Signed-off-by: Jan Høydahl <janhoy@users.noreply.github.com>
Signed-off-by: Jan Høydahl <janhoy@users.noreply.github.com>
- Use literal glob string as group name
- Use same logic as palantir for * -> .*?
- Resolve lock deps in order
  1. first exact match from prop
  2. then longest glob string (most specific group)
  3. all the way to shortest/least specific
- We construct the regex once per glob, hoping to gain some speed

Signed-off-by: Jan Høydahl <janhoy@users.noreply.github.com>
Also fix bug in glob test

Signed-off-by: Jan Høydahl <janhoy@users.noreply.github.com>
Signed-off-by: Jan Høydahl <janhoy@users.noreply.github.com>
Signed-off-by: Jan Høydahl <janhoy@users.noreply.github.com>
Signed-off-by: Jan Høydahl <janhoy@users.noreply.github.com>
@janhoy
Copy link
Contributor Author

janhoy commented Dec 2, 2022

I think this is getting somewhere. Remaining is the plugin detection issue at #19182 (comment)

…on in all build files

Signed-off-by: Jan Høydahl <janhoy@users.noreply.github.com>
Signed-off-by: Jan Høydahl <janhoy@users.noreply.github.com>
Signed-off-by: Jan Høydahl <janhoy@users.noreply.github.com>
Signed-off-by: Jan Høydahl <janhoy@users.noreply.github.com>
Signed-off-by: Jan Høydahl <janhoy@users.noreply.github.com>
Signed-off-by: Jan Høydahl <janhoy@users.noreply.github.com>
Signed-off-by: Jan Høydahl <janhoy@users.noreply.github.com>
Signed-off-by: Jan Høydahl <janhoy@users.noreply.github.com>
@janhoy
Copy link
Contributor Author

janhoy commented Dec 6, 2022

I have seen that output, which suggests that no deps are extracted. But locally they all pass, i.e. they are non-null. There must be some difference in local and CI environment..

Found it after realizing it was the Node14 tests failing and I ran Node16 locally. Debugggin in Node14 locally unveiled that it does not support String.replaceAll().

Signed-off-by: Jan Høydahl <janhoy@users.noreply.github.com>
Signed-off-by: Jan Høydahl <janhoy@users.noreply.github.com>
@Churro
Copy link
Collaborator

Churro commented Dec 6, 2022

Could you please undo your changes to yarn.lock? Otherwise LGTM

Churro
Churro previously approved these changes Dec 6, 2022
@Churro Churro requested a review from viceice December 6, 2022 23:27
@rarkins rarkins enabled auto-merge (squash) December 8, 2022 08:40
@rarkins rarkins merged commit 0d9aaed into renovatebot:main Dec 8, 2022
@renovate-release
Copy link
Collaborator

🎉 This PR is included in version 34.52.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 8, 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.

Gradle support for secondary versions.props file
5 participants