-
Notifications
You must be signed in to change notification settings - Fork 170
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
Adding a locally generated changelog. #1355
Conversation
- Adds a last_version_code_viewed, that gets updated in the DB, and compared against the current version to show the changelog. This means we never have to manually update that column again. - Add a generate_changelog.sh script that uses git-cliff. It copies the changelog into code assets, which can be done before the release. - Fixes #1272
@@ -300,15 +300,6 @@ val MIGRATION_21_22 = | |||
} | |||
} | |||
|
|||
val MIGRATION_22_21 = |
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.
I removed all these down migrations since they were useless.
|
||
fun Context.getVersionCode(): Int = |
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.
That's one way to do it. Another is through BuildConfig, you can enable it in the gradle build it's a static class containing all the info of the build
@@ -24,6 +24,7 @@ data class AppSettings( | |||
defaultValue = "0", | |||
) | |||
val themeColor: Int, | |||
// TODO get rid of this column next time you regenerate the app |
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.
Why next time? why cant we drop it already?
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.
android SQLite can't drop columns, you have to regenerate the entire table. Should probably be done at some point, but probably when we go over all the columns and everything we need to refactor.
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.
We have done this before, see when I changed the default of a column
name = "last_version_code_viewed", | ||
defaultValue = "0", | ||
) | ||
val lastVersionCodeViewed: Int, |
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.
I would probably have made a separate table for this. It's not really a app setting. But this is fine
val res = API.httpClient.newCall(req).execute() | ||
_changelog.value = res.body.string() | ||
Log.d("jerboa", "Getting RELEASES.md from assets...") | ||
val releasesStr = ctx.assets.open("RELEASES.md").bufferedReader().use { it.readText() } |
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.
I rather have this logic in the viewmodel. Just pass a stream or string.
I see that we did this before but we shouldn't have
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.
I'll try to refactor that now.
|
||
@WorkerThread | ||
suspend fun updateChangelog() { | ||
withContext(Dispatchers.IO) { |
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.
I removed this withContext
when I moved this to the viewmodel. It didn't seem to have any effect.
last_version_code_viewed
rather thanchangelog_viewed
for showing the changelog #1272