diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index f2fa4ef02d..d7c3506fa0 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -7,27 +7,27 @@ assignees: '' --- -**Describe the bug** +#### Describe the bug A clear and concise description of what the bug is. -**To Reproduce** +#### To Reproduce Steps to reproduce the behavior: 1. Go to '...' 2. Click on '....' 3. Scroll down to '....' 4. See error -**Expected behavior** +#### Expected behavior A clear and concise description of what you expected to happen. -**Screenshots** +#### Screenshots If applicable, add screenshots to help explain your problem. -**Smartphone (please complete the following information):** +#### Smartphone (please complete the following information): - Device: [e.g. Samsung S6] - OS: [e.g. Android 6.0] -**Additional context** +#### Additional context - App version and store [e.g. 1.0.0 - F-Droid] - Homeserver: [e.g. matrix.org] diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 73c93186d7..da96d461c5 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -7,14 +7,14 @@ assignees: '' --- -**Is your feature request related to a problem? Please describe.** +#### Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -**Describe the solution you'd like** +#### Describe the solution you'd like. A clear and concise description of what you want to happen. -**Describe alternatives you've considered** +#### Describe alternatives you've considered. A clear and concise description of any alternative solutions or features you've considered. -**Additional context** +#### Additional context Add any other context or screenshots about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/release.md b/.github/ISSUE_TEMPLATE/release.md new file mode 100644 index 0000000000..154e93286c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/release.md @@ -0,0 +1,84 @@ +--- +name: Release +about: Checklist for each release. To be used by the core team only. +title: "[Release] Element Android v" +labels: "\U0001F680 Release" +assignees: bmarty + +--- + +For the example, we are releasing the version 1.1.10. Delete this line and replace 1.1.10 with the version in the issue content. + +### Before the release + +- [ ] Weblate sync, fix lint issue if any (in a dedicated PR) +- [ ] Check the update of the store descriptions (using Google Translate if necessary) to ensure that the changes are acceptable to be published to the stores. +- [ ] Run the script `./tools/release/pushPlayStoreMetaData.sh`. You can check in the GooglePlay console the Activity log to check the effect. + +### Do the release + +- [ ] Create release with gitflow, branch name `release/1.1.10` +- [ ] Run `./tools/import_emojis.py` and commit the change if any. +- [ ] Run `./tools/import_sas_strings.py` and commit the change if any. If there is no change since a while, ping Travis +- [ ] Check the crashes from the PlayStore +- [ ] Check the rageshake with the current dev version: https://github.com/matrix-org/element-android-rageshakes/labels/1.1.10-dev +- [ ] Run the integration test, and especially `UiAllScreensSanityTest.allScreensTest()` +- [ ] Create an account on matrix.org +- [ ] Run towncrier: `towncrier --version v1.1.10 --draft` (remove `--draft` do write the file CHANGES.md) +- [ ] Add file for fastlane under ./fastlane/metadata/android/en-US/changelogs +- [ ] Push the branch and start a draft PR (will not be merged), to check that the CI is happy with all the changes. +- [ ] Finish release with gitflow, delete the draft PR +- [ ] Push `main` and the new tag `v1.1.10` to origin +- [ ] Checkout `develop` +- [ ] Increase version in `./vector/build.gradle` +- [ ] Commit and push `develop` +- [ ] Wait for [Buildkite](https://buildkite.com/matrix-dot-org/element-android/builds?branch=main) to build the `main` branch. +- [ ] Run the script `~/scripts/releaseElement.sh`. It will download the APKs from Buildkite check them and sign them. +- [ ] Install the APK on your phone to check that the upgrade went well (no init sync, etc.) +- [ ] Create a new beta release on the GooglePlay console and upload the 4 signed Apks. +- [ ] Check that the version codes are correct +- [ ] Copy the fastlane change to the GooglePlay console in the section en-GB. +- [ ] Push to beta release to 100% of the users +- [ ] Create the release on gitHub [from the tag](https://github.com/vector-im/element-android/tags), copy paste the block from the file CHANGES.md +- [ ] Add the 4 signed APKs to the GitHub release +- [ ] Ping the Android Internal room +- [ ] Add an entry in the internal diary + +### Once Live on PlayStore + +- [ ] Ping the Android public room and update its topic + +### After at least 2 days + +- [ ] Check the [rageshakes](https://github.com/matrix-org/element-android-rageshakes/issues) +- [ ] Check the crash reports on the GooglePlay console +- [ ] Check the Android Element room for any reported issues on the new version +- [ ] If all is OK, push to production and notify Markus (Bubu) to release the F-Droid version +- [ ] Ping the Android public room and update its topic with the new available version + +### Android SDK2 + +- [ ] Checkout the `main` branch on Element Android project + +#### On the SDK2 project + +https://github.com/matrix-org/matrix-android-sdk2 + +- [ ] Create a release with GitFlow +- [ ] Update the files `./build.gradle` and `./gradle/gradle-wrapper.properties` manually, to use the latest version for the dependency. You can get inspired by the same files on Element Android project. +- [ ] Run the script `./tools/import_from_element.sh` +- [ ] Update the version in `./matrix-sdk-android/build.gradle` and let the script finish to build the library +- [ ] Update the file `CHANGES.md` +- [ ] Finish the release using GitFlow +- [ ] Create the release on GitHub from [the tag](https://github.com/matrix-org/matrix-android-sdk2/tags) +- [ ] Upload the AAR on the GitHub release + +### Android SDK2 sample + +https://github.com/matrix-org/matrix-android-sdk2-sample + +- [ ] Update the dependency to the new version of the SDK2. Jitpack will have to build the AAR, it can take a few minutes. You can check status on https://jitpack.io/#matrix-org/matrix-android-sdk2 +- [ ] Build and run the sample, you may have to fix some API break +- [ ] Commit and push directly on `main` + + diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 34d7b40a88..8fbc5602fe 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -5,6 +5,6 @@ - [ ] Changes has been tested on an Android device or Android emulator with API 21 - [ ] UI change has been tested on both light and dark themes - [ ] Pull request is based on the develop branch -- [ ] Pull request updates [CHANGES.md](https://github.com/vector-im/element-android/blob/develop/CHANGES.md) +- [ ] Pull request includes a new file under ./changelog.d. See https://github.com/vector-im/element-android/blob/develop/CONTRIBUTING.md#changelog - [ ] Pull request includes screenshots or videos if containing UI changes - [ ] Pull request includes a [sign off](https://github.com/matrix-org/synapse/blob/master/CONTRIBUTING.md#sign-off) diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000000..e552f5fd43 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,23 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + # Updates for Github Actions used in the repo + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + # Updates for Gradle dependencies used in the app + - package-ecosystem: gradle + directory: "/" + schedule: + interval: "daily" + open-pull-requests-limit: 200 + reviewers: + - "bmarty" +### ignore: +### - dependency-name: com.squareup.okhttp3:logging-interceptor +### versions: "> 3.12.10" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000000..85148a2632 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,59 @@ +name: APK Build + +on: + pull_request: { } + push: + branches: [ main, develop ] + +jobs: + debug: + name: Build debug APKs (${{ matrix.target }}) + runs-on: ubuntu-latest + if: github.ref != 'refs/heads/main' + strategy: + fail-fast: false + matrix: + target: [ Gplay, Fdroid ] + steps: + - uses: actions/checkout@v2 + - uses: actions/cache@v2 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- + - name: Assemble ${{ matrix.target }} debug apk + run: ./gradlew assemble${{ matrix.target }}Debug --stacktrace + - name: Upload ${{ matrix.target }} debug APKs + uses: actions/upload-artifact@v2 + with: + name: vector-${{ matrix.target }}-debug + path: | + vector/build/outputs/apk/*/debug/*.apk + + release: + name: Build unsigned GPlay APKs + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/main' + steps: + - uses: actions/checkout@v2 + - uses: actions/cache@v2 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- + - name: Assemble GPlay unsigned apk + run: ./gradlew clean assembleGplayRelease --stacktrace + - name: Upload Gplay unsigned APKs + uses: actions/upload-artifact@v2 + with: + name: vector-gplay-release-unsigned + path: | + vector/build/outputs/apk/*/release/*.apk + +# TODO: add exodus checks diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml new file mode 100644 index 0000000000..cb6f1b0e48 --- /dev/null +++ b/.github/workflows/integration.yml @@ -0,0 +1,49 @@ +name: Integration Test + +on: + pull_request: { } + push: + branches: [ main, develop ] + +jobs: + integration-tests: + name: Integration Tests (Synapse) + runs-on: ubuntu-latest + strategy: + matrix: + api-level: [21, 30] + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: Cache pip + uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip + restore-keys: | + ${{ runner.os }}-pip- + ${{ runner.os }}- + - uses: actions/cache@v2 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- + - name: Start synapse server + run: | + python3 -m venv .synapse + source .synapse/bin/activate + pip install synapse matrix-synapse + curl -sL https://raw.githubusercontent.com/matrix-org/synapse/develop/demo/start.sh --no-rate-limit \ + | sed s/127.0.0.1/0.0.0.0/g | bash + - name: Run integration tests on API ${{ matrix.api-level }} + uses: reactivecircus/android-emulator-runner@v2 + with: + api-level: ${{ matrix.api-level }} + # script: ./gradlew -PallWarningsAsErrors=false vector:connectedAndroidTest matrix-sdk-android:connectedAndroidTest + script: ./gradlew -PallWarningsAsErrors=false connectedCheck diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml new file mode 100644 index 0000000000..a65e6b5dee --- /dev/null +++ b/.github/workflows/quality.yml @@ -0,0 +1,74 @@ +name: Code Quality Checks + +on: + pull_request: { } + push: + branches: [ main, develop ] + +jobs: + check: + name: Project Check Suite + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Run code quality check suite + run: ./tools/check/check_code_quality.sh + + klint: + name: Kotlin Linter + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Run klint + run: | + curl -sSLO https://github.com/pinterest/ktlint/releases/download/0.36.0/ktlint && chmod a+x ktlint + ./ktlint --android --experimental -v + + android-lint: + name: Android Linter + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/cache@v2 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- + - name: Lint analysis of the SDK + run: ./gradlew clean :matrix-sdk-android:lintRelease --stacktrace + - name: Upload reports + uses: actions/upload-artifact@v2 + with: + name: linting-report-android-sdk + path: matrix-sdk-android/build/reports/*.* + + apk-lint: + name: Lint APK (${{ matrix.target }}) + runs-on: ubuntu-latest + if: github.ref != 'refs/heads/main' + strategy: + fail-fast: false + matrix: + target: [ Gplay, Fdroid ] + steps: + - uses: actions/checkout@v2 + - uses: actions/cache@v2 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- + - name: Lint ${{ matrix.target }} release + run: ./gradlew clean lint${{ matrix.target }}Release --stacktrace + - name: Upload ${{ matrix.target }} linting report + uses: actions/upload-artifact@v2 + if: always() + with: + name: release-debug-linting-report-${{ matrix.target }} + path: | + vector/build/reports/*.* diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000000..6e51368ce5 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,23 @@ +name: Test + +on: + pull_request: {} + push: + branches: [main, develop] + +jobs: + unit-tests: + name: Run Unit Tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/cache@v2 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- + - name: Run unit tests + run: ./gradlew clean test --stacktrace -PallWarningsAsErrors=false diff --git a/.gitignore b/.gitignore index 4a264a28d8..04d1b6fe06 100644 --- a/.gitignore +++ b/.gitignore @@ -12,5 +12,7 @@ .externalNativeBuild /tmp +/fastlane/private +/fastlane/report.xml ktlint diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index 89a7c466fd..523496e317 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -7,15 +7,6 @@ -