Skip to content

Commit 05e5bfc

Browse files
authored
Merge branch 'main' into tts_design
2 parents 826e985 + 5875c90 commit 05e5bfc

817 files changed

Lines changed: 51553 additions & 11499 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.editorconfig

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,39 @@
11
# Customizations for ktlint
22
[*.{kt,kts}]
3+
# Newly-added rules, roughly in order of frequency:
4+
ktlint_standard_max-line-length = disabled
5+
ktlint_standard_function-signature = disabled
36
ktlint_standard_indent = disabled
7+
ktlint_standard_string-template-indent = disabled
8+
ktlint_standard_multiline-expression-wrapping = disabled
9+
ktlint_standard_class-signature = disabled
10+
ktlint_standard_function-expression-body = disabled
11+
ktlint_standard_chain-method-continuation = disabled
12+
ktlint_standard_blank-line-between-when-conditions = disabled
13+
ktlint_standard_no-empty-first-line-in-class-body = disabled
14+
ktlint_standard_blank-line-before-declaration = disabled
15+
ktlint_standard_if-else-wrapping = disabled
16+
ktlint_standard_statement-wrapping = disabled
17+
ktlint_standard_function-naming = disabled
18+
ktlint_standard_when-entry-bracing = disabled
19+
ktlint_standard_backing-property-naming = disabled
20+
ktlint_standard_paren-spacing = disabled
21+
ktlint_standard_enum-wrapping = disabled
22+
ktlint_standard_if-else-bracing = disabled
23+
ktlint_standard_function-literal = disabled
24+
ktlint_standard_property-naming = disabled
25+
ktlint_standard_mixed-condition-operators = disabled
26+
27+
# Existing rules, before upgrading:
428
ktlint_standard_argument-list-wrapping = disabled
529
ktlint_standard_parameter-list-wrapping = disabled
630
ktlint_standard_wrapping = disabled
731
ktlint_standard_trailing-comma-on-call-site = disabled
832
ktlint_standard_trailing-comma-on-declaration-site = disabled
933
ktlint_standard_no-wildcard-imports = disabled
34+
ktlint_standard_no-unused-imports = enabled
1035
ktlint_standard_multiline-if-else = disabled
1136
ktlint_standard_spacing-between-declarations-with-annotations = disabled
1237
ktlint_standard_annotation = disabled
1338
ktlint_standard_spacing-between-declarations-with-comments = disabled
1439
ktlint_standard_no-empty-first-line-in-method-block = disabled
15-

.github/workflows/android.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ jobs:
88
build_alpha:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v4
12-
- uses: actions/setup-java@v4
11+
- uses: actions/checkout@v6
12+
- uses: actions/setup-java@v5
1313
with:
1414
distribution: 'temurin'
1515
java-version: '17'
@@ -20,7 +20,7 @@ jobs:
2020
- name: Checkout submodules
2121
run: git submodule update --init --recursive
2222
- name: Build, test, and lint
23-
run: ./gradlew clean ktlint assembleAlphaRelease lintAlphaRelease testAlphaRelease --no-daemon
23+
run: ./gradlew clean ktlint assembleAlphaRelease lintAlphaRelease testAlphaDebugUnitTest --no-daemon
2424
- name: List
2525
run: ls -alR ./app/build/outputs/apk/
2626
- uses: kevin-david/zipalign-sign-android-release@v2
@@ -48,7 +48,7 @@ jobs:
4848
- name: Sleep for 30 seconds, to allow the tag to be deleted
4949
run: sleep 30s
5050
shell: bash
51-
- uses: ncipollo/release-action@v1.18.0
51+
- uses: ncipollo/release-action@v1.21.0
5252
name: Create new tag and release and upload artifacts
5353
with:
5454
name: latest

.github/workflows/android_branch.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ jobs:
99
build_branch:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v4
13-
- uses: actions/setup-java@v4
12+
- uses: actions/checkout@v6
13+
- uses: actions/setup-java@v5
1414
with:
1515
distribution: 'temurin'
1616
java-version: '17'
@@ -34,7 +34,7 @@ jobs:
3434
env:
3535
# override default build-tools version (optional)
3636
BUILD_TOOLS_VERSION: "35.0.0"
37-
- uses: actions/upload-artifact@v4
37+
- uses: actions/upload-artifact@v7
3838
name: Upload APK artifact
3939
with:
4040
name: app_alpha_release

.github/workflows/android_offline_test.yml

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,47 @@ env:
77

88
jobs:
99
instrumentation-tests:
10-
runs-on: macos-latest
10+
runs-on: ubuntu-latest
1111
timeout-minutes: 30
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
include:
16+
- api-level: 23
17+
target: google_apis
18+
arch: x86_64
19+
20+
- api-level: 36
21+
target: google_apis
22+
arch: x86_64
1223

1324
steps:
14-
- uses: actions/checkout@v4
15-
- uses: actions/setup-java@v4
25+
- uses: actions/checkout@v6
26+
- uses: actions/setup-java@v5
1627
with:
1728
distribution: 'temurin'
1829
java-version: '17'
1930
cache: 'gradle'
2031
- uses: gradle/gradle-build-action@v3
2132

22-
- name: Instrumentation Tests
33+
- name: Enable KVM
34+
run: |
35+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
36+
sudo udevadm control --reload-rules
37+
sudo udevadm trigger --name-match=kvm
38+
39+
- name: run instrumentation tests
2340
uses: reactivecircus/android-emulator-runner@v2
2441
with:
25-
api-level: 29
42+
api-level: ${{ matrix.api-level }}
43+
target: ${{ matrix.target }}
44+
arch: ${{ matrix.arch }}
45+
disable-animations: true
2646
script: ./gradlew connectedDevDebugAndroidTest --stacktrace --no-daemon --info -P android.testInstrumentationRunnerArguments.class=org.wikipedia.tests.offline.SavedArticleOnlineOfflineTest
2747

2848
- name: Upload results
2949
if: ${{ always() }}
30-
uses: actions/upload-artifact@v4
50+
uses: actions/upload-artifact@v7
3151
with:
32-
name: instrumentation-test-results ${{ matrix.api-level }}
52+
name: instrumentation-test-results${{ matrix.api-level }}
3353
path: ./**/build/reports/androidTests/connected/**

.github/workflows/android_pr.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ jobs:
99
test_pr:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v4
13-
- uses: gradle/actions/wrapper-validation@v4
14-
- uses: actions/setup-java@v4
12+
- uses: actions/checkout@v6
13+
- uses: gradle/actions/wrapper-validation@v6
14+
- uses: actions/setup-java@v5
1515
with:
1616
distribution: 'temurin'
1717
java-version: '17'
@@ -20,4 +20,4 @@ jobs:
2020
- name: Check for missing qq strings
2121
run: ./scripts/missing-qq.py
2222
- name: Build, test, and lint
23-
run: ./gradlew clean ktlint assembleAlphaRelease lintAlphaRelease testAlphaRelease --no-daemon
23+
run: ./gradlew clean ktlint assembleAlphaRelease lintAlphaRelease testAlphaDebugUnitTest --no-daemon

.github/workflows/android_smoke_test.yml

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,46 @@ env:
77

88
jobs:
99
instrumentation-tests:
10-
runs-on: macos-latest
11-
timeout-minutes: 30
10+
runs-on: ubuntu-latest
11+
timeout-minutes: 60
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
include:
16+
- api-level: 36
17+
target: google_apis
18+
arch: x86_64
1219

1320
steps:
14-
- uses: actions/checkout@v4
15-
- uses: actions/setup-java@v4
21+
- uses: actions/checkout@v6
22+
- uses: actions/setup-java@v5
1623
with:
1724
distribution: 'temurin'
1825
java-version: '17'
1926
cache: 'gradle'
2027
- uses: gradle/gradle-build-action@v3
2128

29+
- name: Enable KVM
30+
run: |
31+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
32+
sudo udevadm control --reload-rules
33+
sudo udevadm trigger --name-match=kvm
34+
2235
- name: Instrumentation Tests
2336
uses: reactivecircus/android-emulator-runner@v2
37+
env:
38+
TEST_LOGIN_USERNAME: ${{ secrets.TEST_LOGIN_USERNAME }}
39+
TEST_LOGIN_PASSWORD: ${{ secrets.TEST_LOGIN_PASSWORD }}
2440
with:
25-
api-level: 29
26-
script: ./gradlew connectedDevDebugAndroidTest --stacktrace --no-daemon
41+
api-level: ${{ matrix.api-level }}
42+
target: ${{ matrix.target }}
43+
arch: ${{ matrix.arch }}
44+
disable-animations: true
45+
script: ./gradlew connectedDevDebugAndroidTest --stacktrace --no-daemon --info -P android.testInstrumentationRunnerArguments.class=org.wikipedia.testsuites.TestSuite
2746

2847
- name: Upload results
2948
if: ${{ always() }}
30-
uses: actions/upload-artifact@v4
49+
uses: actions/upload-artifact@v7
3150
with:
32-
name: instrumentation-test-results ${{ matrix.api-level }}
51+
name: instrumentation-test-results${{ matrix.api-level }}
3352
path: ./**/build/reports/androidTests/connected/**

AGENTS.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# AGENTS.md
2+
3+
This repository is the official Wikipedia app for Android, with features for reading Wikipedia articles, exploring the Wikipedia ecosystem by searching and browsing related content, as well as editing and administering Wikipedia content.
4+
5+
## General architecture
6+
7+
- The `app` directory contains all the code for the app itself.
8+
- The `analytics/testkitchen` directory is a work-in-progress analytics engine that will eventually integrate with the app, but not yet.
9+
10+
### Build flavors
11+
12+
- The `dev` flavor is used for day-to-day development and running on local devices by developers.
13+
- The `alpha` flavor is used for continuous integration and QA testing, both manually and using GitHub Actions.
14+
- The `beta` flavor is for building and deploying to the [Wikipedia Beta](https://play.google.com/store/apps/details?id=org.wikipedia.beta) app on the Play Store.
15+
- The `prod` flavor is for building and deploying to the production [Wikipedia](https://play.google.com/store/apps/details?id=org.wikipedia) app on the Play Store and other third-party app stores.
16+
- The `fdroid` flavor is for building and deploying to the [F-Droid store](https://f-droid.org/en/packages/org.wikipedia) specifically. This flavor is configured to exclude any closed-source packages or libraries. All such code is contained in the `src/extra` directory, which is included in all other flavors, but is stubbed out in the `fdroid` flavor.
17+
18+
### Project organization
19+
20+
Classes and packages are organized roughly by "feature":
21+
```
22+
/app/src/main/java/org/wikipedia/
23+
├── dataclient/ # Model classes and service layer for MediaWiki and Wikipedia APIs
24+
├── analytics/ # Model classes and service logic for our current analytics engine (Event Platform)
25+
├── feed/ # Fragments and Views related to the Exlore Feed
26+
├── talk/ # Activities and Views related to Wikipedia Talk pages
27+
├── page/ # Activities and Views for browsing Wikipedia articles in a WebView
28+
├── edit/ # Activities and Views for editing Wikipedia articles
29+
```
30+
...and so on.
31+
32+
### Libraries and dependencies
33+
34+
- Jetpack Compose for any new features. View Bindings for legacy features.
35+
- Since the app offers four different color themes, always wrap Compose screens in the `BaseTheme` component which handles our custom themes.
36+
- Whenever possible, translate a legacy feature to Jetpack Compose before adding new functionality.
37+
- Retrofit for network calls, with occasional direct usages of OkHttp.
38+
- Kotlinx.serialization for serializing and deserializing JSON objects from remote APIs and local storage.
39+
- Coil for loading images.
40+
- Room for database management.
41+
- JUnit and Robolectric for unit tests.
42+
- Espresso for instrumented tests.
43+
44+
### Miscellaneous
45+
46+
- SharedPreferences are encapsulated in `Prefs.kt`. If adding a new preference, follow the pattern in that file.
47+
- When setting up an A/B test for any feature, subclass from `ABTest.kt`, which automatically assigns the current user into a test bucket.
48+
49+
## Code conventions
50+
51+
- To check if the app builds without errors: `./gradlew assembleDevDebug`
52+
- Do NOT run other static analysis tools (ktlint, checkstyle, lint) during development. This should only be done as a final step, when ready to submit a pull request.
53+
- ALWAYS prefer Jetpack Compose for new UI features, with a corresponding backing ViewModel class that handles state.
54+
- Whenever possible, use the components and extensions found in the `compose/` directory.
55+
- Important: for Text composables that might display HTML text from spannable CharSequence strings (bold, italic, etc), use our `compose/components/HtmlText` composable instead of the standard Text() composable.
56+
- For new Composable, create at least one `Preview` function that showcases the corresponding composable.
57+
- ALWAYS prefer self-documenting names of variables, functions, and fields. Don't write redundant comments that explain what the next line does.
58+
- Avoid using deprecated APIs and classes in new code whenever possible.
59+
- Avoid using reflection, unless all other options are exhausted.
60+
61+
## Release notes
62+
63+
- Every previous release is denoted by a git tag of the form `r/...`. Release notes must be composed based on git commits that happened after the last release tag.
64+
- To get the hash of the last release tag: git show-ref -s <last-release-tag>
65+
- To get a list of commits since last release: git log <last-release-hash>..HEAD --oneline --no-merges
66+
- Do NOT include dependency updates, localization updates, or static data updates.
67+
- Release notes should be terse, but understandable by a general audience.
68+
- Release notes must be a single paragraph of natural, friendly text. It should NOT be a list of bullet points.

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@AGENTS.md

Gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ GEM
4141
dotenv (2.8.1)
4242
emoji_regex (3.2.3)
4343
excon (0.112.0)
44-
faraday (1.10.4)
44+
faraday (1.10.5)
4545
faraday-em_http (~> 1.0)
4646
faraday-em_synchrony (~> 1.0)
4747
faraday-excon (~> 1.1)
@@ -60,7 +60,7 @@ GEM
6060
faraday-em_synchrony (1.0.1)
6161
faraday-excon (1.1.0)
6262
faraday-httpclient (1.0.1)
63-
faraday-multipart (1.1.1)
63+
faraday-multipart (1.2.0)
6464
multipart-post (~> 2.0)
6565
faraday-net_http (1.0.2)
6666
faraday-net_http_persistent (1.2.0)

SECURITY

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
We take security very seriously. If you believe you have found a
2+
security issue, see <https://www.mediawiki.org/wiki/Reporting_security_bugs>
3+
for information on how to responsibly report it.

0 commit comments

Comments
 (0)