Maintenance guide - ankidroid/Anki-Android GitHub Wiki
Updating the main strings from Git to Crowdin is a pretty delicate thing. Uploading an empty string.xml for instance would delete all translations. And uploading changed strings delete as well all translations. This is the desired behavior in most cases, but when just some English typos are corrected this shouldn't destroy all translations.
In this case, it's necessary to:
- rebuild a download package at first (option "r" in script [currently broken])
- download all translations (update-translations.py)
- upload the changed strings
- reupload the translations (option "t" and language "all").
Ensure there are no failures in the unit test workflow (scheduled daily).
Monitor dependabot PRs that come in against the dependency-updates branch.
Ongoing: Dependabot opens PRs targeting dependency-updates. If they pass CI and look good, a maintainer merges them into that branch (keeping the individual Dependabot commits for now). Leave dependency-updates alone between batch landings — there is no post-merge sync back from main.
Agent-ready checklist. Title the PR Dependency updates YYYYMMDD (today’s date).
-
Rebase
dependency-updatesonto currentmainand force-push (git push --force-with-lease). Git should skip the previous batch commit as already applied (same patch-id / empty replay). Only new Dependabot commits should remain. Do not squash yet — keep commits separate so a bad bump can still be dropped easily. -
Open a draft PR from
dependency-updates→main(or update the existing batch PR back to draft if needed). Apply thesquash-mergelabel. Multi-commit + that label intentionally trips the Squash merge merge-requirements check; we start as draft so that expected failure does not block verifying the rest of CI, and so commits can still be dropped if a bump is bad. -
Monitor CI on that draft until everything except the Squash merge check is green. Treat that one failure as expected until after the local squash. If any other check fails, fix or drop the offending Dependabot commit(s) on
dependency-updates, force-push, and wait for CI again. -
Squash locally on
dependency-updatesinto one commit. Start the message withDependency Updates YYYYMMDD, then append each included commit’s full subject and body in chronological order. Force-push todependency-updates(git push --force-with-lease). -
Undraft the PR, remove the
squash-mergelabel, then enable auto-merge so it uses the normal merge queue. Do not squash-merge via the GitHub UI intomain— the branch is already one commit with the desired message, and the UI is poor at preserving it.
That terminates the batch. After it lands, leave dependency-updates as-is. The next batch starts again at step 1.
Handling package.json/yarn.lock conflicts
- Rebase locally onto
mainuntil it stops with a conflict - Run
yarn installlocally (which rebuilds the lock) - Amend the updated files into the commit which the rebase stopped on
- Continue the rebase
on yarn.lock
yarn.lockis just a rendering of the current install based onpackage.json, so oncepackage.jsonis fixed (or if it is simply "good to go" already), "rendering" a new lockfile is almost an afterthought I like to have it committed for reference as semver means deps can "slip" in a range and there are sometimes problems, but I don't consider it some semantically-informative thing
-- Mike
If dependabot needs configuration changes (to ignore a dependency or a version), the configuration should be done in the .github/dependabot.yaml file, not via any UI interaction. The difference is that the YAML config is reviewable text while the UI modifies some opaque database and thus is not manageable or reviewable.
https://github.com/ankidroid/Anki-Android/compare/v2.24.0alpha2...v2.24.0alpha3
- 8c352ec3de068ef8c42dfd343408afae234b9812 needs to be applied if bisecting before 2.19alpha10
Patch
Subject: [PATCH] Remove "app.brant.amazonappstorepublisher" plugin
---
Index: AnkiDroid/build.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/AnkiDroid/build.gradle b/AnkiDroid/build.gradle
--- a/AnkiDroid/build.gradle (revision d4d48b920c763668c4608994c6852f343782a966)
+++ b/AnkiDroid/build.gradle (date 1763096652934)
@@ -2,7 +2,6 @@
// Gradle plugin portal
alias(libs.plugins.tripletPlay)
alias(libs.plugins.android.application)
- alias(libs.plugins.amazonappstorepublisher)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.parcelize)
alias(libs.plugins.kotlin.serialization)
@@ -248,13 +247,6 @@
track.set('alpha')
}
-amazon {
- securityProfile = file("${homePath}/src/AnkiDroid-Amazon-Publish-Security-Profile.json")
- applicationId = "amzn1.devportal.mobileapp.524a424d314931494c55383833305539"
- pathToApks = [ file("./build/outputs/apk/amazon/release/AnkiDroid-amazon-universal-release.apk") ]
- replaceEdit = true
-}
-
// Install Git pre-commit hook for Ktlint
tasks.register('installGitHook', Copy) {
from new File(rootProject.rootDir, 'pre-commit')
Index: gradle/libs.versions.toml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
--- a/gradle/libs.versions.toml (revision d4d48b920c763668c4608994c6852f343782a966)
+++ b/gradle/libs.versions.toml (date 1763096652902)
@@ -1,7 +1,6 @@
[versions]
acra = '5.11.3'
-amazonappstorepublisher = "0.1.0"
-androidGradlePlugin = "8.4.0"
+androidGradlePlugin = "8.5.1"
androidxActivity = "1.9.0"
androidxAnnotation = "1.7.1"
androidxAppCompat = "1.7.0-beta01"
@@ -159,8 +158,6 @@
android-application = { id = "com.android.application", version.ref = "androidGradlePlugin" }
android-library = { id = "com.android.library", version.ref = "androidGradlePlugin" }
-amazonappstorepublisher = { id = "app.brant.amazonappstorepublisher", version.ref = "amazonappstorepublisher" }
-
tripletPlay = { id = "com.github.triplet.play", version.ref = "triplet" }
Index: settings.gradle.kts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/settings.gradle.kts b/settings.gradle.kts
--- a/settings.gradle.kts (revision d4d48b920c763668c4608994c6852f343782a966)
+++ b/settings.gradle.kts (date 1763096652931)
@@ -3,15 +3,6 @@
google()
gradlePluginPortal()
mavenCentral()
- maven(url = "https://jitpack.io") // only needed for the "amazonappstorepublisher" plugin
- }
- resolutionStrategy {
- // TODO try to find another plugin for this functionality?
- eachPlugin {
- if (requested.id.id == "app.brant.amazonappstorepublisher") {
- useModule("com.github.BrantApps.gradle-amazon-app-store-publisher:amazonappstorepublisher:master-SNAPSHOT")
- }
- }
}
}
- Download and extract
z-proguard-mappings.tar.gzfrom the relevant build in Releases - Run
retrace- macOS command:
pbpaste | "${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/retrace" "/Users/davidallison/Downloads/proguard-ad-2-23-a6/build/outputs/mapping/fullRelease/mapping.txt" | sed "1d" | pbcopy
- macOS command:
git clone https://github.com/ankidroid/Anki-Android.wiki.git