-
-
Notifications
You must be signed in to change notification settings - Fork 212
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
Fix: Define backports for autoupdater #3171
base: beta
Are you sure you want to change the base?
Conversation
override fun selectUpdate(updateStream: String, releases: MutableList<GithubRelease>) = when (updateStream) { | ||
"pre" -> findLatestRelease(releases.filter { !it.isDraft && !ModVersion.fromString(it.tagName).isBackport }) | ||
"full" -> findLatestRelease(releases.filter { !it.isDraft && !it.isPrerelease }) | ||
else -> null | ||
} |
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.
You could in theory also just override findLatestRelease to order by the modversion:
override fun findLatestRelease(validReleases: Iterable<GithubRelease>): UpdateData {
return validReleases.asSequence().mapNotNull { findAsset(it) }.maxBy { ModVersion.fromString(it.tagName) }
}
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 would also allow for upgrading to backport releases if no betas have yet been released:
1.0.0 -> 1.0.1 (no 1.1.0 released yet)
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.
Your solution does allow this but it the version comparison that we have it the mod would mean that using this would also try and update users from the stable/backport branch to the betas which is not intended. I guess I can look into our version comparison further but I feel the current solution I have is more than enough and a backport before a beta is rare enough that it is not needed
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.
Im not sure how my change would make users upgrade to betas? The default selectUpdate function already filters for github prereleases, so the findLatestRelease function will not get any betas on the full update stream
override fun selectUpdate(updateStream: String, releases: MutableList<GithubRelease>) = when (updateStream) { | ||
"pre" -> findLatestRelease(releases.filter { !it.isDraft && !ModVersion.fromString(it.tagName).isBackport }) | ||
"full" -> findLatestRelease(releases.filter { !it.isDraft && !it.isPrerelease }) | ||
else -> null | ||
} |
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 would also allow for upgrading to backport releases if no betas have yet been released:
1.0.0 -> 1.0.1 (no 1.1.0 released yet)
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.
Does not currently support upgrading to backports if there have been no betas but there have been backports
What
As far as i understand it, a backport is defined as a version where the beta version (second number) is 0 and the bugfix version (third number) isnt a 0
so
1.1.0 wouldnt be a backport but is a beta
1.0.1 would be a backport but isnt a beta
1.0.0 wouldnt be a backport or a beta
Changelog Fixes