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

Ability to ignore alpha/beta versions #311

Closed
tasomaniac opened this issue Dec 26, 2020 · 6 comments
Closed

Ability to ignore alpha/beta versions #311

tasomaniac opened this issue Dec 26, 2020 · 6 comments
Assignees

Comments

@tasomaniac
Copy link

Is your feature request related to a problem? Please describe.

The update comments on versions.properties are really helpful. But in case we never use alpha versions in a project, alpha version updates are not really useful.

Describe the solution you'd like

Provide a mechanism to disable checking for alpha builds.

Versions plugin has similar functionality: https://github.com/ben-manes/gradle-versions-plugin#revisions

@LouisCAD LouisCAD self-assigned this Jan 3, 2021
@jmfayard
Copy link
Member

jmfayard commented May 18, 2021

I have implemented this feature in #347

But one of us is not sure yet if it's right and we don't want to ship a bad API
That's why your feedback would be really appreciated
@bjonnh @moritzruth @msiemens @simonbasle @brewin @Sh4dowSoul

This is how it would work to ignore all non-stable releases

refreshVersions {
    rejectVersionIf {
        candidate.stabilityLevel != StabilityLevel.Stable
    }
}

Same but for retrofit you want all versions

refreshVersions {
    rejectVersionIf {
       if (moduleId.group == "com.square.retrofit") false
       else candidate.stabilityLevel != StabilityLevel.Stable
    }
}

Same but you want to see all updates for the key version.coroutines

refreshVersions {
    rejectVersionIf {
        versionKey != "version.kotlinx.coroutines" && candidate.stabilityLevel != StabilityLevel.Stable
    }
}

Or maybe you want to see alpha versions if you are already using an alpha version, otherwise you want to see only stable versions

refreshVersions {
    rejectVersionIf {
        candidate.stabilityLevel.isLessStableThan(current.stabilityLevel)
    }
}

Questions:

Does that feel right?

Does that solve your use cases?

If not, what are they?

@simonbasle
Copy link

that filter api seems good to me. caveat: I have only _evaluated _the plugin so far, not yet made the jump. but yeah, it was definitely annoying to see unstable version comments and this looks like a good improvement.

@jmfayard
Copy link
Member

jmfayard commented May 18, 2021

FYI we have two sister projects with refreshVersions already setup if you want to evaluate it

https://github.com/jmfayard/kotlin-cli-starter
https://github.com/LouisCAD/kotlin-libraries-playground

this is what refreshVersionsIf in action looks liks
LouisCAD/kotlin-libraries-playground@e3838f1

@jmfayard
Copy link
Member

Interesting feedback from Ben Manes here

ben-manes/gradle-versions-plugin#519 (comment)

@LouisCAD
Copy link
Member

Indeed, I think this research and insights will help a lot in designing the feature in refreshVersions.

@LouisCAD
Copy link
Member

Hello, version 0.20.0 is out and brings the rejectVersionIf { … } predicate, with an API that makes it easy to filter by stability level if you need that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants