-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add version catalog support for Gradle #6249
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As is this would cover the bulk of projects using version catalogs. But surely as things scale up and out we would see projects that have multiple catalogs or non conventional file layouts in use.
👋 from the Dependabot team. Thanks for this great PR... it is definitely on our radar, although no one has had time to review it just yet. TBH, for myself it may be a few more weeks as I'm juggling a few things here at the beginning of the quarter and this is a larger change that will take a bit of time to review. But if no one else on the team gets to it first, I expect to be able to get to it within a few weeks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is pretty awesome! I made a first pass on reviewing.
My main concern is that when sharing version declarations between multiple dependencies, I think Dependabot may create a different PR for each dependency that uses the reference, all of them with the same contents? Is this correct?
Would it be more representable to look at the gradle lockfile? The |
FWIW: In the 8 years I have been using Gradle, I have never worked on a project that used Gradle lock files. I suspect this is more related to how mobile builds and deployments differ from a backend system CI/CD pipeline. Typically we run tools that scan and monitor the fully resolved tree before releasing. IE snyk.io |
This is because lockfiles was made available with 7.0 at 9 April 2021 so for 6 years and 2 months of those 8 years this feature wasn't available. Added to that, IDEA didn't really support it in the beginning, so maybe bump that to the first 7 of your 8 years. I know it's underused, but that doesn't change anything. It is the only way to avoid false positives, just wanted note that, could be a future improvement. Hopefully some future supply chain poisoning with characteristics that would make it preventable with lockfiles and dependency verification happens, so broad adoption happens. |
Was it really only so recently? Surprised but does explain it. That one has been available for a long time, though likely hard to say how widely used it is outside of netflix. |
I'll be working on this PR next week. Will push up my initial review suggestions, test out the code here a bit more, and in general try move this PR forward. |
@deivid-rodriguez sorry for taking so long to get you back 😓! I've been quite busy all this time. Do you mind if I address your comments? I have some spare time this week so I'd like to keep on working on this pull request. |
No worries and great having you back in this PR :), thanks for addressing my comments. I see that the PR appears as out of date and a lot of old commits appear in its timeline, I think it needs a rebase? Can you answer this question from my first review? I lost context now and I haven't yet got to reviewing this again but at the time I was not clear about it:
|
c6db4d9
to
eceaccf
Compare
That's a great question @deivid-rodriguez , do you mean something like this?
|
Yes, I think that's what I meant. |
You are very right, it does exactly that, I will look into the issue, thanks for the heads up! |
@alcere I had another look at this today and I think this is actually fine. We already have logic in place in the Gradle ecosystem to be able to group PRs together when they are updating a "property" so I think this is ok as is! 🎉 I also reviewed the PR, cleaned up git history and fixed a few bugs while I was at it. Were you planning on pushing any more changes? If not, I can push my cleanup and I think this would be mostly ready! 💪 |
That's great news! Please go ahead! |
4a659b7
to
0e81cb6
Compare
I pushed my changes. These include:
|
If possible, let's please add a test case to cover this #6742 |
0e81cb6
to
63c7a92
Compare
7979c07
to
015d9a8
Compare
015d9a8
to
3b77e98
Compare
3b77e98
to
37797fe
Compare
Hello from the GitHub Android mobile team!
As part of a client apps hackathon we decided to give it a shot and add version catalog support for Gradle projects.
This functionality has been requested by some users here: #3121, and we are planning to start using version catalog as well as soon as Dependabot supports it :P.
We have added support for version catalogs defined using a
toml
file (more info), for libraries and plugins using value versions and referenced versions, so this changes add support for a toml file like:Testing
In order to guide our development we have used the steps defined in here to use the dry-run script pointing to this test repo we created.
Note
We realize that this code won't reach the quality bar to be considered as a candidate to be merged (Ruby is not our field of expertise), but we will be more than happy to react to your feedback and keep working on it!
BIG THANKS
To @jurre who has been helping us on this task, sharing advices, techniques and ideas!
Closes #3121.