0
0
mirror of https://github.com/ankidroid/Anki-Android.git synced 2024-09-20 03:52:15 +02:00
Commit Graph

221 Commits

Author SHA1 Message Date
David Allison
130a38ea09 chore(issue-template): Add link to Anki Forums
This is to reduce the number of upstream issues we receive

A discussion on issue 15810 caused this suggestion
2024-03-08 20:58:07 +00:00
David Allison
3079cac037 chore(ci): translation sync: link activity stream 2024-03-08 18:52:11 +00:00
David Allison
8089fa058f chore(pr-template): make 'Fixes' more intuitive
A number of new users were filling out the template incorrectly

I feel the `#` and comment makes it more obvious what is expected
2024-03-03 09:38:31 +00:00
David Allison
de8f902826 build(ci): lintVitalFullRelease
This is run on publish, and can fail

So it should also be run on a normal lint check

Issue 15741
2024-03-01 19:55:32 +00:00
David Allison
4c3730b52b docs(ci): prettier manual run instructions 2024-02-29 13:04:25 +00:00
David Allison
5ad2157345 fix(ci): disable cache on all runners
cache is corrupt on both macOS and Ubuntu. Disable it so CI works again

follow-on from 6768519cbb

issue:

```
* What went wrong:
Execution failed for task ':AnkiDroid:testPlayDebugUnitTest'.
> A build operation failed.
      Immutable workspace contents have been modified: /home/runner/.gradle/caches/transforms-4/f46cf63d0a549c8bc814e25133f449eb. These workspace directories are not supposed to be modified once they are created. Deleting the directory in question can allow the content to be recreated.
   > Immutable workspace contents have been modified: /home/runner/.gradle/caches/transforms-4/f46cf63d0a549c8bc814e25133f449eb. These workspace directories are not supposed to be modified once they are created. Deleting the directory in question can allow the content to be recreated.
```
2024-02-26 20:22:17 +00:00
lukstbit
6a41697449 Change milestone target for PRs and issues to 2.18 2024-02-25 09:47:30 +00:00
Mike Hardy
94c7773065
chore: log the actual error if PR creation fails during string sync
error code 422 does not seem to be matching as the workflow
is finishing with an error when the PR exists

I would prefer it to finish cleanly even if the PR exists so I want
to see what the error is
2024-02-20 11:19:01 -05:00
David Allison
7126f995e1 ci: add 'strings' label for SearchPreferences
added in dc75687938

Issue 15453
2024-02-18 01:48:37 +00:00
Mike Hardy
6768519cbb
test(ci): disable gradle cache on windows runner
this may hopefully be reverted in the future but right now there
are persistent cache corruption issues with gradle caching on windows
involving part of immutable cache being mutated
2024-02-15 11:57:32 -05:00
Mike Hardy
40bfa67012
test(ci): use contains to detect os in more stable manner 2024-02-15 11:52:50 -05:00
dependabot[bot]
9e7738fb3d chore(deps): bump webfactory/ssh-agent from 0.8.0 to 0.9.0
Bumps [webfactory/ssh-agent](https://github.com/webfactory/ssh-agent) from 0.8.0 to 0.9.0.
- [Release notes](https://github.com/webfactory/ssh-agent/releases)
- [Changelog](https://github.com/webfactory/ssh-agent/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webfactory/ssh-agent/compare/v0.8.0...v0.9.0)

---
updated-dependencies:
- dependency-name: webfactory/ssh-agent
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-07 02:33:50 +00:00
Mike Hardy
7fee019cf2 test(ci, unit): configure windows pagefile correctly
- use new v1.4 tag that updates action to node 20 to quiet warning
- use C: drive since D: has issues (#15372)
2024-02-02 17:45:08 +00:00
Mike Hardy
0ee9f1d9bb test(ci): use ubuntu for emulator tests
the new public runners have nested virt, and our emulator runner not
only should run well on it, they document to do exactly the changes
I did here before reading their documentation ;-)
2024-02-02 17:44:21 +00:00
dependabot[bot]
9afbaafc8d chore(deps): migrate to gradle/actions/setup-gradle 3
> As of v3 this action has been superceded by gradle/actions/setup-gradle. Any workflow that uses gradle/gradle-build-action@v3 will transparently delegate to gradle/actions/setup-gradle@v3.

https://github.com/gradle/gradle-build-action/releases/tag/v3.0.0-rc.1

----
previous dependabot info:

Bumps [gradle/gradle-build-action](https://github.com/gradle/gradle-build-action) from 2 to 3.
- [Release notes](https://github.com/gradle/gradle-build-action/releases)
- [Commits](https://github.com/gradle/gradle-build-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: gradle/gradle-build-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-02 06:49:21 -05:00
dependabot[bot]
c8715ebd09 chore(deps): bump nick-invision/retry from 2 to 3
Bumps [nick-invision/retry](https://github.com/nick-invision/retry) from 2 to 3.
- [Release notes](https://github.com/nick-invision/retry/releases)
- [Changelog](https://github.com/nick-fields/retry/blob/master/.releaserc.js)
- [Commits](https://github.com/nick-invision/retry/compare/v2...v3)

---
updated-dependencies:
- dependency-name: nick-invision/retry
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-01 12:49:45 -05:00
David Allison
75ef22e419 build(ci): use stable job names
This means that we can upgrade the os without needing
to update branch protection rules

use 'include' to expand the 'os' matrix to include the name
then use the variable as a job name

https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs#example-expanding-configurations

Fixes 15371
2024-01-31 16:11:17 +00:00
David Allison
2ca67edd30 test(ci): upgrade macOS runner to M1 & macOS 14
This is a beta, we are currently on `macos-12`

https://github.blog/changelog/2024-01-30-github-actions-introducing-the-new-m1-macos-runner-available-to-open-source/

> The macos-latest workflow label currently uses the macOS 12 runner image.
> `macos-14` [beta]

https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories

This reduces the available RAM from 14 to 7GB
2024-01-31 06:23:42 -05:00
David Allison
9ff69c80b2 typo: action name (tests)
```diff
- JUnit Tests (ubuntu-latest
+ JUnit Tests (ubuntu-latest)
```
2024-01-31 06:21:21 -05:00
Mike Hardy
f4172d6514 chore(deps): keep npm dependency updates to one PR if non-breaking
the npm package ecosystem releases all the time and it clutters up the
PR queue for mostly meaningless dependency updates

dependabot has a new "groups" feature to group dependency update PRs
together in to one PR based on either name globs, update types, or
dependency type

this should allow us to get all non-breaking changes through in single
PRs, while breaking (semver-major) changes will get individual PRs for
more detailed consideration

https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#groups
2024-01-26 19:11:47 +00:00
Mike Hardy
58fbd9892b chore(deps): switch i18n workflow to use node 20
this appears to work fine in local testing, and it is the current
active release, node 18 is maintenance only
2024-01-24 07:17:08 -05:00
Mike Hardy
c914ddeb88
i18n sync workflow on ubuntu / bump javascript deps (#15325)
* chore(i18n): switch sync translations workflow to ubuntu from macos

our i18n infrastructure used to rely on some macOS-specific behavior,
but now that it is all javascript I don't think the runner OS actually
matters

if it does not matter, then ubuntu is preferred as macos has limited
concurrency on free accounts

* build(deps, i18n): bump all javascript dependencies

they're all minors and/or patches so nothing special
closes out all the dependabot issues for javascript deps at once
2024-01-24 06:58:32 -05:00
Mike Hardy
c07a15ca80 build(deps): AGP 8.2.2 w/JDK21 compatibility, switch CI to JDK21
AGP 8.2.x adds JDK21 compatibility, and 8.2.2 works with JaCoCo

So we can finally convert to the current LTS of the JDK, 21
2024-01-23 15:49:16 -05:00
dependabot[bot]
0d4fb2c971 chore(deps): bump actions/cache from 3 to 4
Bumps [actions/cache](https://github.com/actions/cache) from 3 to 4.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-20 18:30:51 +00:00
Mike Hardy
4e81c822d1 chore(deps): alter dependabot to propose javascript PRs on dependency-updates branch 2024-01-11 22:26:46 -05:00
Mani
51b8ef86c8
ci: remove strings label if no changes to i18n files (#15156)
* remove strings label if no changes to i18n files
* add check if label exists
* update method params
2024-01-04 23:30:03 -05:00
Mani
b4e81172a1 do not add label if already exists 2024-01-04 14:49:12 +00:00
Mani
51760504ad check mergeable for unstable state of pr 2024-01-04 14:49:12 +00:00
Mani
d7543c7f2d run conflict scan on pull request 2024-01-04 14:49:12 +00:00
Mani
b6aa516d4e
github action to check conflict in pr and add label (#15101)
* github action to check conflict in pr and add label

* update schedule and use iteration count in loop

* update schedule and remove checkout
2023-12-30 19:00:48 +00:00
dependabot[bot]
83bc7221c9 build(deps): bump actions/upload-artifact from 3 to 4
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-15 04:16:41 +00:00
Mike Hardy
0f8bfbd7fd test(ci): ignore merge queue branch push events
otherwise the concurrency gate means the push events and merge_group
events enter into a race which results in merge queue failure at times
2023-12-12 11:48:46 -05:00
dependabot[bot]
d4d0a37c0d build(deps): bump actions/stale from 8 to 9
Bumps [actions/stale](https://github.com/actions/stale) from 8 to 9.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/stale/compare/v8...v9)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-08 03:09:24 +00:00
Mike Hardy
7b0daf35ab feat: add merge group event to list of things that trigger workflow
https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-a-merge-queue
2023-12-07 18:25:19 -05:00
Mike Hardy
fbcb50878a fix: remove workflow event trigger filters
these are an attempt at a "ci usage optimization", to avoid running
CI checks where they would not really matter

however, they have the side effect of not running CI checks all the time
we want them to (like, when we do i18n_sync...) so I want to simplify our
CI config and get i18n_sync running CI automatically
2023-12-07 18:25:19 -05:00
kuroahna
218dafef30 ci: record screen for emulator tests 2023-12-05 18:35:03 -05:00
dependabot[bot]
916c4ff59d build(deps): bump actions/setup-java from 3 to 4
Bumps [actions/setup-java](https://github.com/actions/setup-java) from 3 to 4.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](https://github.com/actions/setup-java/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-java
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-30 07:32:57 -05:00
dependabot[bot]
cb0d9560c0 build(deps): bump actions/setup-node from 3 to 4
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 3 to 4.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-24 22:58:30 -05:00
Mani
ad94cd6f13
upload, build, download and update translations to/from Crowdin using js client api (#11557)
* Init Project
* upload tranlation source files to crowdin
* build, download and extract i18n files
* convert update function to ts
* fix regex, string replacement
* fix for translation of markettitle
* index for running upload, download, update
* upload, download, update using workflows
* Update sync_translations.yml
fix env config
cd to project dir
* revert username and email in git
* fix anyError condition check
* fix env and update project id
* refactor, add comments, extract constant
fix: market title string upload
create temp dir
* added comments, find broken strings before commit
- added docs
- added return type for functions
- better message for uploading, download, building and downloading
- find broken strings before commit
* add prettier
* add eslint
* remove find broken strings
* wait for zip build on crowdin server
* check broken strings
* use only non positional strings in test
* test string format errors
* check errors for float
* test: remove typescript string format checker and associated jest test
it duplicates android lint at great cost in dev time and run time
* chore: consolidate credential prep workflow steps
* style: `yarn install` is equivalent to `yarn`, just call `yarn`
* perf: avoid shell glob and add whole res folder
the only stages that should be changed are translation ones, so
we can let git do the expansion internally, which will avoid
shell-globbing which can have perf issues and/or fail if it matches
too many files
* style(lint): result of `yarn format` auto-formatting run
* style(lint): buildProgress var never reassigned, use const
* build(deps): result of `yarn upgrade --latest`
* fix: use new crowdin personal access token
this was freshly generated and added to github org under same name
* fix: use official project id
* style: progress output more condensed
* dev: use `tsc --watch` for dev command
this gives us continuous incremental build
* style: use exact header as in current file to minimize diff
we may decide to update this later, but this is important during
i18n sync process change to make sure diff is minimal
* fix: ignore 12-dont-translate files
these do not need to be copied from the zip to the app res directories
* fix: marketing title is created fresh each time
appending without clearing it out means it will grow infinitely
* docs: update comment on language list to match updated python version
this was changed in python while new system was in development,
synchronizing change here
* docs: simple comments on upload process
* add readme
* docs(l10n): expand the readme, reformat, use conventional all-caps README
* fix: ingest PR review feedback, prepare for final merge
- use numerical separator
- update comment about language tags (2- vs 3-letter etc)
- typos and formatting
- mark package as non-publishable ("private")

---------

Co-authored-by: Mike Hardy <github@mikehardy.net>
2023-11-24 09:15:45 -05:00
Mike Hardy
d22694c154 build(jitpack): use specific JDK version for jitpack builds 2023-11-21 17:41:46 -05:00
Mike Hardy
80227afe82
Dependency updates 20231117 (#14763)
* build(deps): bump androidx.browser:browser from 1.6.0 to 1.7.0

Bumps androidx.browser:browser from 1.6.0 to 1.7.0.

---
updated-dependencies:
- dependency-name: androidx.browser:browser
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump com.github.triplet.play from 3.8.5 to 3.8.6

Bumps com.github.triplet.play from 3.8.5 to 3.8.6.

---
updated-dependencies:
- dependency-name: com.github.triplet.play
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump org.jetbrains.kotlinx:kotlinx-serialization-json

Bumps [org.jetbrains.kotlinx:kotlinx-serialization-json](https://github.com/Kotlin/kotlinx.serialization) from 1.6.0 to 1.6.1.
- [Release notes](https://github.com/Kotlin/kotlinx.serialization/releases)
- [Changelog](https://github.com/Kotlin/kotlinx.serialization/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Kotlin/kotlinx.serialization/compare/v1.6.0...v1.6.1)

---
updated-dependencies:
- dependency-name: org.jetbrains.kotlinx:kotlinx-serialization-json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump org.jetbrains:annotations from 24.0.1 to 24.1.0 (#14748)

* build(deps): bump org.jetbrains:annotations from 24.0.1 to 24.1.0

Bumps [org.jetbrains:annotations](https://github.com/JetBrains/java-annotations) from 24.0.1 to 24.1.0.
- [Release notes](https://github.com/JetBrains/java-annotations/releases)
- [Changelog](https://github.com/JetBrains/java-annotations/blob/master/CHANGELOG.md)
- [Commits](https://github.com/JetBrains/java-annotations/compare/24.0.1...24.1.0)

---
updated-dependencies:
- dependency-name: org.jetbrains:annotations
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update AnkiDroid/build.gradle

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mike Hardy <github@mikehardy.net>

* build(deps): bump com.google.protobuf:protobuf-kotlin-lite

Bumps com.google.protobuf:protobuf-kotlin-lite from 3.25.0 to 3.25.1.

---
updated-dependencies:
- dependency-name: com.google.protobuf:protobuf-kotlin-lite
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump androidx.activity:activity-ktx from 1.8.0 to 1.8.1

Bumps androidx.activity:activity-ktx from 1.8.0 to 1.8.1.

---
updated-dependencies:
- dependency-name: androidx.activity:activity-ktx
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): enable nio desugaring

This will allow us to bump commons-compress to 2.25.0.

Previously, it needed us to wait for API 26 due to use of nio.File

```
Failed resolution of: [Ljava/nio/file/LinkOption;
at org.apache.commons.compress.utils.IOUtils.<clinit>(IOUtils.java:47)
```

* build(deps): bump org.apache.commons:commons-compress

`com.android.tools:desugar_jdk_libs_nio:2.0.4` allows us to update

Bumps org.apache.commons:commons-compress from 1.12 to 1.25.0.

Removes Dependabot ignores and comments for commons-compress

---
updated-dependencies:
- dependency-name: org.apache.commons:commons-compress
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* bump android gradle plugin to 8.1.4

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: David Allison <62114487+david-allison@users.noreply.github.com>
2023-11-18 15:44:10 -05:00
dependabot[bot]
f3ebb8c0c7 build(deps): bump actions/github-script from 6 to 7
Bumps [actions/github-script](https://github.com/actions/github-script) from 6 to 7.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](https://github.com/actions/github-script/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-14 11:12:16 +00:00
Brayan Oliveira
5d6683f28f Update pull_request_template.md 2023-11-06 06:49:33 +02:00
Mike Hardy
43dd69b1a7 docs: update opencollective notice to remove GSoC reference
GSoC is done for now
2023-10-31 22:37:28 -03:00
Mike Hardy
c344988170
Dependency updates 20231019 (#14563)
* build(deps): ignore commons-compress below 1.25 now

We are still not minSdkVersion >= API26 so we may not advance this
dependency yet, we just notch this forward one version at a time
so we continue to be aware of their releases, but ignore them for now

* build(deps): bump androidx.annotation:annotation from 1.6.0 to 1.7.0

Bumps androidx.annotation:annotation from 1.6.0 to 1.7.0.

---
updated-dependencies:
- dependency-name: androidx.annotation:annotation
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump com.google.protobuf:protobuf-kotlin-lite

Bumps com.google.protobuf:protobuf-kotlin-lite from 3.24.2 to 3.24.3.

---
updated-dependencies:
- dependency-name: com.google.protobuf:protobuf-kotlin-lite
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump org.jlleitschuh.gradle.ktlint from 11.5.1 to 11.6.0

Bumps org.jlleitschuh.gradle.ktlint from 11.5.1 to 11.6.0.

---
updated-dependencies:
- dependency-name: org.jlleitschuh.gradle.ktlint
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump com.google.protobuf:protobuf-kotlin-lite

Bumps com.google.protobuf:protobuf-kotlin-lite from 3.24.3 to 3.24.4.

---
updated-dependencies:
- dependency-name: com.google.protobuf:protobuf-kotlin-lite
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump commons-io:commons-io from 2.13.0 to 2.14.0

Bumps commons-io:commons-io from 2.13.0 to 2.14.0.

---
updated-dependencies:
- dependency-name: commons-io:commons-io
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump io.mockk:mockk from 1.13.7 to 1.13.8

Bumps [io.mockk:mockk](https://github.com/mockk/mockk) from 1.13.7 to 1.13.8.
- [Release notes](https://github.com/mockk/mockk/releases)
- [Commits](https://github.com/mockk/mockk/compare/1.13.7...1.13.8)

---
updated-dependencies:
- dependency-name: io.mockk:mockk
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update Gradle Wrapper from 8.3 to 8.4.

Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc>

* Only split APK build by ABI in release builds

This avoids the upstream android gradle plugin issue introduced in
AGPv8.1.2 (and seemingly fixed in AGBv8.3.0-alpha07) where doing
an ABI split while including resources crashes the build:

https://issuetracker.google.com/issues/302961829

If this causes problems or is distasteful, can be reverted when
AGP v8.3+ is adopted, or if they do pick it to AGPv8.2+, at that time

* Adopt android gradle plugin v8.1.2

* ignore dynamic receiver registrations without export-type specified

these receivers *should* specify at registration whether they are for export
or not for export but if that is added (such as in PR 14158) then there is also
a need to add a new permission to the manifest or you get runtime errors, and
we haven't figured that out yet

* build(deps): bump org.jetbrains.dokka from 1.9.0 to 1.9.10

Bumps [org.jetbrains.dokka](https://github.com/Kotlin/dokka) from 1.9.0 to 1.9.10.
- [Release notes](https://github.com/Kotlin/dokka/releases)
- [Commits](https://github.com/Kotlin/dokka/compare/v1.9.0...v1.9.10)

---
updated-dependencies:
- dependency-name: org.jetbrains.dokka
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump com.squareup.okhttp3:okhttp from 4.11.0 to 4.12.0

Bumps [com.squareup.okhttp3:okhttp](https://github.com/square/okhttp) from 4.11.0 to 4.12.0.
- [Changelog](https://github.com/square/okhttp/blob/master/CHANGELOG.md)
- [Commits](https://github.com/square/okhttp/compare/parent-4.11.0...parent-4.12.0)

---
updated-dependencies:
- dependency-name: com.squareup.okhttp3:okhttp
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump org.jlleitschuh.gradle.ktlint from 11.6.0 to 11.6.1

Bumps org.jlleitschuh.gradle.ktlint from 11.6.0 to 11.6.1.

---
updated-dependencies:
- dependency-name: org.jlleitschuh.gradle.ktlint
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump compileSdk to 34, handle new deprecations (#14556)

* Bump compileSdk to 34

* Alter system API overrides to handle newly nullable items in API34

Investigating the various changes led me to conclude that simple null
checks and default returns if null was an adequate response to the
newly-possible null case in the various parameters

* API34 deprecates Class.newInstance, get ctor and newInstance that instead

* use new API34 pixel calc style if available

this apparently allows for finer more dynamic user text sizing

* Temporarily suppress deprecation on animation overrides

API34 adds new predictive back behavior, which implies that the
transition animation overrides for activity stack change animations
now need to know whether the animation override is for activity open or
close, whereas we override both as a unit without thought

This needs a solution before the deprecated methods go away, likely in
the form of plumbing through (via a new parameter) the idea of whether
the call site intended to override open, close, or both animations. For
backwards compatibility this will likely need to be a Compat interface
(or interfaces) to replace the current implementation

* build(deps): bump androidx.webkit:webkit from 1.7.0 to 1.8.0

Bumps androidx.webkit:webkit from 1.7.0 to 1.8.0.

---
updated-dependencies:
- dependency-name: androidx.webkit:webkit
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump androidx.browser:browser from 1.5.0 to 1.6.0

Bumps androidx.browser:browser from 1.5.0 to 1.6.0.

---
updated-dependencies:
- dependency-name: androidx.browser:browser
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump androidx.activity:activity-ktx from 1.7.2 to 1.8.0 (#14515)

* build(deps): bump androidx.activity:activity-ktx from 1.7.2 to 1.8.0

Bumps androidx.activity:activity-ktx from 1.7.2 to 1.8.0.

---
updated-dependencies:
- dependency-name: androidx.activity:activity-ktx
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* call super.onBackPressed in onBackPressed overrides

This is more "predictive back" feature fallout, this commit should be examined,
and the behavior in these 4 objects may need a change, in order to more correctly
deal with API34 predictive back

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mike Hardy <github@mikehardy.net>

* build(deps): bump androidx.recyclerview:recyclerview from 1.3.1 to 1.3.2

Bumps androidx.recyclerview:recyclerview from 1.3.1 to 1.3.2.

---
updated-dependencies:
- dependency-name: androidx.recyclerview:recyclerview
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump androidx.core:core-ktx from 1.10.1 to 1.12.0 (#14407)

* build(deps): bump androidx.core:core-ktx from 1.10.1 to 1.12.0

Bumps androidx.core:core-ktx from 1.10.1 to 1.12.0.

---
updated-dependencies:
- dependency-name: androidx.core:core-ktx
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* PendingIntentCompat.getBroadcast() is nullable now, wrap use of result in null checks

It will only return null if we specify intent flags which we never specify, so our behavior
does not need to change, but we must respect the type system by wrapping the use of the now-nullable
result in null checks

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mike Hardy <github@mikehardy.net>

* build(deps): bump androidx.sqlite:sqlite-framework from 2.3.1 to 2.4.0

Bumps androidx.sqlite:sqlite-framework from 2.3.1 to 2.4.0.

---
updated-dependencies:
- dependency-name: androidx.sqlite:sqlite-framework
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump androidx.appcompat:appcompat

Bumps androidx.appcompat:appcompat from 1.7.0-alpha02 to 1.7.0-alpha03.

---
updated-dependencies:
- dependency-name: androidx.appcompat:appcompat
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: gradle-update-robot <gradle-update-robot@regolo.cc>
2023-10-20 11:31:16 +00:00
lukstbit
1e12cf8db3 Handle the PR already existing when running the sync_translations workflow
Adds a try-catch block for the code that creates the sync translations
PR so the workflow doesn't error when its run again to fix issues with
the translations.
2023-10-13 20:28:36 -03:00
dependabot[bot]
df0759e623 build(deps): bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-05 10:03:02 -05:00
lukstbit
6b1ba50bb6 Assign pull requests and associated issues to milestone 2.17
Milestone 2.16 => https://github.com/ankidroid/Anki-Android/milestone/42
Milestone 2.17 => https://github.com/ankidroid/Anki-Android/milestone/51
2023-09-03 09:46:12 -03:00
Ashish Yadav
879eff0176 remove the extra header from the PR template 2023-09-03 09:45:45 -03:00
Damien Elmes
7a65160e0e
Drop legacy schema, and update to 2.1.66 backend (#14171)
* Update target API to 23

* Update to 2.1.66, and switch to new schema by default

+ Temporarily disable unused resource warnings

* Drop legacy syncing code

* Drop legacy import/export code

* Drop legacy tag handling

* Drop legacy config handling

* Drop legacy database check

* Stub out unused v1 scheduler code

Can't be fully removed, as we still need to be able to open a v1 collection
so the user can upgrade.

moveVersions test has been removed, as backend code is used for moving
outside of unit tests.

* Drop legacy deck handling

* Drop legacy search code

* Drop legacy notetype code

This breaks the card template editor, so I've temporarily disabled it
in the GUI. Getting it working again will require switching to the new
template rendering code in the new backend.

Also breaks an "empty cards" action in CardContentProvider,
as I was not sure what it was trying to accomplish.

* Drop legacy media code

This removes oakkitten's custom media checking code, as keeping it
would require keeping a bunch of the duplicated Kotlin logic. His comment
about cancellation is incorrect: the call can be cancelled with backend.
setWantsAbort() on a background thread. And since the app enforces filenames
are normalized when they're added anyway, I don't think avoiding automatic
normalization is worth the duplicated code.

* Drop legacy Collection/DB code

* Drop most references to defaultLegacySchema

* Remove legacy schema tests from CI

CI won't work yet, because backend version needs updating

* Fix import CSV call

* Remove some unused symbols from anki module

* Drop majority of old stats code

* Remove unused symbols from libanki

* Remove some broken Android tests, and fix one

checkIfStudyOptionsIsDisplayedOnTablet() is also consistently failing,
but was doing so before I started on these changes.

* Move config methods into col.config

* Simplify config API

- Use kotlinx.serialization so that arbitrary typed objects can be
(de)serialized
- There is a single generic get(), that always returns an optional
value, which will be null if the key is missing, is null, or is not the
correct type. There will always be collections that have invalid data,
so the calling code always needs to be prepared to substitute a reasonable
default in such cases.
- Expose the typed getBool() method from the backend.

* Remove unused legacy importer

* Drop jackson

* Models -> Notetypes

* Remove some more unused symbols

* Remove generic type aliases

* Rename Model -> Notetype

I had to leave ModelTest.kt's filename alone, as changing it to Notetype.kt
reorders the unit tests, and causes about 4 tests to start flaking.

* Get card template editor preview working again

* Enable undo on edits; fix test hang

* Use backend for bulk suspend/undo

By default, undoableOp() notifies all screens listening for opExecuted,
so the refreshing happens automatically, and the manual refresh code
at the end of the old routine is no longer required. It is possible to
bypass this when you want to manually update the UI, but this is probably
not worth attempting until the card browser is either switched over to
a recycler view, or reimplemented as a web component.

The LongArrays have been switched to simple lists, as Google's protobuf
code expects Iterable<Long>

* Use backend for marking/undo, and change deck/undo

* Migrate reviewer actions/undo to backend

* Migrate remainder of undo code to backend, apart from v2 undo

Couple of notes:

- The legacy v2 undo no longer returns the undone card, and instead
rebuilds the queue. In some circumstances (eg a learning card has become
due), this can result in a different card being shown after undoing.
This is not ideal, but v2 does not have long to live at this point.
- The reset/reposition tests were reusing the old card cache values,
which have to be reloaded after an operation.
- A test in AbstractSched had to be moved to ReviewerTest so it can have
access to an activity.
- UndoTest has been removed, as it mainly focused on removed code.

* GetCard() -> getNextCardAndRedraw()

* render_output -> renderOutput()

* Drop AsyncTask

Probably the hardest part of AnkiDroid's code base to follow; very
glad to see the end of it.

Closes #7108

* Make note addition undoable

* Make bulk tag update undoable

* Remove remaining explicit transaction handling

The backend automatically wraps backend actions in a transaction,
and removing the explicit calls will allow us to drop the redundant
mutex that rsdroid acquires.

* Remove remaining unused classes/methods/properties

* Remove FunctionalInterfaces

* Switch to backend answer comparison

* Remove unused locking code + legacy storage code

* Switch ContentProviderTest to new schema, and fix bug

* Remove legacy Deck Options settings

* fix: remove minSdkVersion < 23 code

* Use short time in snackbars

People complained about snackbars interrupting their reviews before

* fix: don't duplicate undo label

It were showing a message like `Undo Undo Add Note`

* Remove "Advanced statistics"

* Remove legacy_schema local property

* Leave zip validation up to the backend

The backend takes care of validating the zip file and ensuring files aren't
written outside of the media folder.

I've expanded the mime match to include the zip mime, on the assumption
that's what the mime type is being changed to on some devices. If that
proves to be insufficient, a much simpler approach would be to look
for 50 4B 03 04 at the start of the file to determine if it's a zip file
or not.

This leaves only Mani's add-on code using commons-compression, so you
could potentially switch to a simpler tgz-specific library in the future
if that is easier.

* Disable two flaky tests

They started to flaky reliably after the legacy deck options test
was removed.

* Improve logging of HTTP requests

* Remove ModelBrowser

Replaced by ManageNotetypes

* Remove legacy CardInfo

replaced by com.ichi2.anki.pages.CardInfo

* Change comments at AdvancedSettingsFragment

* test: check if prefs analytics list don't have extra elements

* ContextCompat.getColor -> getColor

that compat method is for implementations in API < 23

* Remove more unused files

* refactor: move SECONDS_PER_DAY to a separate util file

in order to be able to remove Stats.kt later

* refactor: remove Stats and OverviewStatsBuilder

* Access sched.card directly in tests

The helper was adding a 500ms sleep on every fetch, which slowed the
scheduler tests down considerably.

* Make v3 scheduler the default; drop support for v2

The v3 scheduler was originally released in 2021, and we've been waiting
for a stable AnkiDroid release to support it before we could switch users
over to it. Now that 2.16 is out, we can finally push v3 out across the
ecosystem.

While we could theoretically make v3 the default without removing v2,
here are the reasons why I think we're better off switching to v3 only:

- AnkiWeb's review interface will likely switch over to v3-only in the
coming weeks, and AnkiMobile will likely drop v2 around the same time
2.17 comes out.
- v2 and v3 differ in a few ways that makes maintaining the two separate
paths more complicated: things like the different undo paths, counts not
including the current card, and the way the v3 scheduler supports custom
scheduler js. 2.17 is a chance to clean up a lot of old cruft in the
code base, and the old scheduling code is part of that.
- v2 and v3 are compatible with each other, and don't require a full sync
to change, so it doesn't break syncing with old clients (though depending
on settings, due counts may differ, which needs explanation)

I had to disable a couple of tests for this that we'll probably want
to restore in some form:

- corruptVersion16CollectionShowsDatabaseError() needs an update, and
it may be time to rip out the old CollectionHelper colIsOpen(), getColSafe()
and so on, migrating code that uses it over to withCol() instead. The
'collection inaccessible' dialog also needs a rethink - perhaps the various
exceptions could be handled in launchCatchingTask instead.
- testUndoResetsCardCountsToCorrectValue() is failing because initLayout()
creates a gesture listener, which fails with an error about the looper
not being initialized. I am not sure what's going on there - one option
would be to move the test to androidTest.

* Drop v2 sched file; rename files

* Drop AbstractSched and legacy undo code/queue code

* Migrate BaseSched into Scheduler

* More unused symbol removal

* Remove DeckTreeNode

* Remove unused processChildren()

* Remove shouldDisplayCounts(), as counts always available

* Remove manual hashCode()/compareTo() implementations

* Drop AbstractDeckTreeNode

* Turn DeckNode into a wrapper for DeckTreeNode

* Drop TreeNode and simplify filtering

* Remove `New card position` global preference

Overridden by per-deck configuration

Closes #12319

* fix: remove chess.css from card_template_html

* Store current queue state in reviewer

Prerequisite for solving #12620

Also dropped answerButtons(), as it's always 4

* Use local HTTP server for serving flashcard content

Prerequisite for solving #12620

* Implement support for custom JS scheduling

Enables FSRS and closes #12620

* Remove more unused code

* Remove separate Deck(Config)V16 objects and more unused code

* Move some NotetypeJson methods into its file

* Finish tidying Decks.kt

* Drop redundant col property on Collection

* Remove some usages of CollectionGetter

* Rename col->getColUnsafe to encourage migration

* Remove Reviewer.sched

* Handle deck tree not initialized in empty collection

* refactor: move syncStatus() to Collection

to avoid direct calls to the backend

* fix: do not show error when updating the menu if there is no internet

Reproduction steps:
1. have the collection synced
2. disable the device internet connection
3. Restart the app

* Remove unused resources and re-enable lint

* Restore sync cancel strings

* Defer loading webpage until server has initialized

* Ignore translations without a base entry

https://github.com/ankidroid/Anki-Android/pull/14171#issuecomment-1660286342

* Remove the SortOrder deprecation

* Remove the apparently-unused Backup.kt

* Remove last remaining use of Collection's context field

* Stop passing Context to backend

The library loading is now AnkiDroid's responsibility, so the backend
does not require access to an Android context.

Also remove the unused context field from Collection.

* Use backend for rendering next time labels

* Use backend for rendering finished message

The custom study & unbury descriptions are slightly different, but
should suffice until AnkiDroid can start using the Svelte finished
screen.

* Run SchedulerTest without Robolectric

Halves the run time. To do this, I implemented a new JvmTest class
and copied some of the helpers in RobolectricTest into it.

* Remove unused Kotlin implementation of template parsing

* Move Util code dealing with resources out of libanki

* Migrate remaining libanki tests to raw JVM

+ Remove some commented-out tests

Total savings are a drop from about 3m40s to 2m40s, with the scheduler
test class dropping its runtime by about half.

* Lazy-initialize col in tests

* Restore 'experimental' string

* Add comments to update-localizations.py

* Restore AcraAnalyticsInteraction.kt

---------

Co-authored-by: Brayan Oliveira <69634269+brayandso@users.noreply.github.com>
2023-08-31 05:44:03 +08:00