dependabot-core icon indicating copy to clipboard operation
dependabot-core copied to clipboard

[Gradle] Handle plugin version variables without string interpolation

Open Flexicon opened this issue 2 years ago • 4 comments

Fixes #4127

This change allows direct variables in place of versions to be used in Gradle Plugins scope without the need to redundantly interpolate them in a string.


This PR addresses the following issue:

Does not work - versions are ignored by Dependabot:

plugins {
    val kotlinVersion = "1.7.0"
    kotlin("jvm") version kotlinVersion
    kotlin("plugin.spring") version kotlinVersion
}

Works as a workaround - versions are picked up correctly:

plugins {
    val kotlinVersion = "1.7.0"
    kotlin("jvm") version "$kotlinVersion"
    kotlin("plugin.spring") version "$kotlinVersion"
}

Flexicon avatar Jul 14 '22 11:07 Flexicon

@brrygrdn any chance to get some eyes on this one? 🙏

Flexicon avatar Jul 26 '22 10:07 Flexicon

Done @jeffwidman ✅

Flexicon avatar Sep 22 '22 14:09 Flexicon

Thanks! Looks like tests are still failing though?

Also, can you explain why the tests need the length changed? I assumed originally that was related to a regex change capturing an additional character which gets parsed out, but since it's no longer doing that, makes me realize I don't know why the length change is/isn't needed?

jeffwidman avatar Sep 22 '22 16:09 jeffwidman

Yeah I see that, I'll take a look later and try and fix it. It's been a few months so my memory is a bit hazy.

I assumed originally that was related to a regex change capturing an additional character which gets parsed out

That was exactly the intention at the time. I'll have to dig in and check why it's not working anymore.

Flexicon avatar Sep 22 '22 16:09 Flexicon

Hey @jeffwidman, finally had some time to look into it. Turns out I messed up on the rebase and had a question mark in the wrong place for the regex.

Should be good to go now 👌

Flexicon avatar Sep 26 '22 07:09 Flexicon

@jeffwidman @bdragon any chance for another review 🙏🏻 The MR had to be updated with master again.

Flexicon avatar Sep 27 '22 10:09 Flexicon

Sorry @Flexicon I was offline the past few days. Looks like @Nishnha has you covered though!

jeffwidman avatar Sep 28 '22 20:09 jeffwidman