Skip to content

Commit

Permalink
Merge branch 'develop' into chore/enable_reactions
Browse files Browse the repository at this point in the history
  • Loading branch information
vitorhugods authored Jul 18, 2023
2 parents 7bba6ea + 43d26d8 commit b7cf6d7
Show file tree
Hide file tree
Showing 140 changed files with 6,245 additions and 3,559 deletions.
22 changes: 22 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# 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://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "gradle"
open-pull-requests-limit: 1
directory: "/"
schedule:
interval: "daily"
reviewers:
- "wireapp/android"

- package-ecosystem: "github-actions"
open-pull-requests-limit: 1
directory: "/"
schedule:
interval: "weekly"
reviewers:
- "wireapp/android"
63 changes: 63 additions & 0 deletions .github/workflows/cherry-pick-rc-to-develop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: "Cherry-pick from rc to develop"

on:
pull_request:
branches:
- release/candidate
types:
- closed

jobs:
cherry-pick:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Append -cherry-pick to branch name
id: extract
run: |
PR_BRANCH="${{ github.event.pull_request.head.ref }}"
NEW_BRANCH_NAME="${PR_BRANCH}-cherry-pick"
echo "New branch name: $NEW_BRANCH_NAME"
echo "::set-output name=newBranchName::$NEW_BRANCH_NAME"
- name: Check if changes only in kalium submodule
id: check_changes
run: |
NUM_CHANGES=$(git diff origin/develop --name-only | grep -v '^kalium/' | wc -l)
if [ "$NUM_CHANGES" -gt 0 ]; then
echo "::set-output name=shouldCherryPick::true"
else
echo "No changes outside of kalium submodule, skipping cherry-pick"
echo "::set-output name=shouldCherryPick::false"
fi
- uses: fregante/setup-git-user@v2

- name: Cherry-pick commits
if: steps.check_changes.outputs.shouldCherryPick == 'true'
run: |
git fetch origin develop:develop
git checkout -b ${{ steps.extract.outputs.newBranchName }} develop
# Cherry-picking the last commit on the base branch
git cherry-pick -x ${{ github.event.pull_request.merge_commit_sha }} --strategy-option theirs || true
git add .
git cherry-pick --continue || true
git push origin ${{ steps.extract.outputs.newBranchName }}
- name: Create PR
if: steps.check_changes.outputs.shouldCherryPick == 'true'
env:
PR_TITLE: ${{ github.event.pull_request.title }}
PR_BRANCH: ${{ steps.extract.outputs.newBranchName }}
PR_ASSIGNEE: ${{ github.event.pull_request.user.login }}
PR_BODY: "${{ format('Cherry pick from the original PR: \n- #{0}\n\n ---- \n{1}', github.event.pull_request.number, github.event.pull_request.body) }}"
run: gh pr create --title "$PR_TITLE" --body "$PR_BODY" --base develop --head $PR_BRANCH --label "cherry-pick" --assignee "$PR_ASSIGNEE"
2 changes: 1 addition & 1 deletion .github/workflows/codestyle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
distribution: 'temurin'
cache: gradle
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
uses: gradle/wrapper-validation-action@8d49e559aae34d3e0eb16cde532684bc9702762b
- name: Run Detekt
run: |
./gradlew detektAll
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gradle-run-ui-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
cache: gradle

- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
uses: gradle/wrapper-validation-action@8d49e559aae34d3e0eb16cde532684bc9702762b

- name: Gradle cache
uses: gradle/gradle-build-action@v2
Expand Down
53 changes: 33 additions & 20 deletions .github/workflows/gradle-run-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ jobs:
cache: gradle

- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
uses: gradle/wrapper-validation-action@8d49e559aae34d3e0eb16cde532684bc9702762b

- name: Gradle cache
uses: gradle/gradle-build-action@v2

Expand All @@ -51,32 +51,35 @@ jobs:
- name: Install Pip for test result publishing
run: sudo apt-get install -y python3-pip

- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action/[email protected]
# Uploads test results as GitHub artifacts, so publish-test-results can find them later.
- name: Upload Test Results
uses: actions/upload-artifact@v3
if: always()
with:
files: |
# This name is referenced in the publish-test-results workflow.
name: test-results
path: |
**/build/test-results/testDevDebugUnitTest/**/*.xml
**/build/test-results/**/*.xml
**/build/outputs/androidTest-results/**/*.xml
- name: Generate report
uses: actions/upload-artifact@v3
with:
name: report
path: app/build/reports/jacoco
- name: Generate report
uses: actions/upload-artifact@v3
with:
name: report
path: app/build/reports/jacoco

- name: Download Test Reports Folder
uses: actions/download-artifact@v3
with:
name: report
path: app/build/reports/jacoco
- name: Download Test Reports Folder
uses: actions/download-artifact@v3
with:
name: report
path: app/build/reports/jacoco

- name: Upload Test Report
uses: codecov/codecov-action@v3
with:
files: "app/build/reports/jacoco/jacocoReport/jacocoReport.xml"

- name: Upload Test Report
uses: codecov/codecov-action@v2
with:
files: "app/build/reports/jacoco/jacocoReport/jacocoReport.xml"

- name: Cleanup Gradle Cache
# Remove some files from the Gradle cache, so they aren't cached by GitHub Actions.
# Restoring these files from a GitHub Actions cache might cause problems for future builds.
Expand All @@ -98,3 +101,13 @@ jobs:
with:
flavour: "dev-debug"

event_file:
# This name is referenced in the publish-test-results workflow.
name: "Upload Event File"
runs-on: ubuntu-latest
steps:
- name: Upload
uses: actions/upload-artifact@v3
with:
name: Event File
path: ${{ github.event_path }}
4 changes: 3 additions & 1 deletion .github/workflows/jira-lint-and-link.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ on:
jobs:
add-jira-description:
runs-on: ubuntu-latest
# Run only if the PR is not from a Fork / external contributor
if: (!startsWith(GITHUB_REF, 'refs/heads/dependabot/') && github.repository_owner == 'wireapp')
steps:
- uses: cakeinpanic/jira-description-action@v0.3.2
- uses: cakeinpanic/jira-description-action@v0.4.0
name: jira-description-action
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pr-author-assigner.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Auto assign author to PR
on:
pull_request:
types: [ opened ]
pull_request_target:
types: [ opened ]

jobs:
assign-author:
runs-on: ubuntu-latest
steps:
- uses: samspills/[email protected].1
- uses: samspills/[email protected].2
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
47 changes: 47 additions & 0 deletions .github/workflows/publish-test-results.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Publish Test Results

# Takes the artifacts uploaded by run-unit-tests and publishes them in PRs as a comment.
# This is needed in order to support PRs created from forks, as PRs from Forks or Dependabot
# run in read-only mode and can't comment on PRs, for example.
# More context here: https://github.blog/changelog/2021-02-19-github-actions-workflows-triggered-by-dependabot-prs-will-run-with-read-only-permissions/
# This work-around makes it so that:
# - this workflow is triggered by the end of the test workflow, instead
# of being triggered directly by the PR
# - we can control the permissions to only have what's needed to write comments, etc.

on:
workflow_run:
workflows: [Run Unit Tests]
types:
- completed
permissions: {}

jobs:
test-results:
name: Publish Test Results
runs-on: ubuntu-latest
if: github.event.workflow_run.conclusion != 'skipped'

# Limit permissions to only what's needed
permissions:
checks: write

# needed to write the PR comment with the results
pull-requests: write
# required in order to download step to access artifacts API
actions: read

steps:
- name: Download and Extract Artifacts
uses: dawidd6/action-download-artifact@v2
with:
run_id: ${{ github.event.workflow_run.id }}
path: artifacts

- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
with:
commit: ${{ github.event.workflow_run.head_sha }}
event_file: artifacts/Event File/event.json
event_name: ${{ github.event.workflow_run.event }}
files: "artifacts/test-results/**/*.xml"
16 changes: 9 additions & 7 deletions .github/workflows/semantic-commit-lint.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: "Semantic Commit Linting of PR titles"

on:
pull_request:
pull_request_target:
types: [ opened, edited, synchronize ]

jobs:
Expand All @@ -12,15 +12,10 @@ jobs:
CUSTOM_PR_LABEL: "Fix PR Title or Commit message️"
HEAD: ${{github.head_ref}}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive # Needed in order to fetch Kalium sources for building
# Please look up the latest version from
# https://github.com/amannn/action-semantic-pull-request/releases
- name: Run Semantic Commint Linter
uses: amannn/action-semantic-pull-request@v3.4.6
uses: amannn/action-semantic-pull-request@v5.2.0
with:
# Configure which types are allowed.
# Default: https://github.com/commitizen/conventional-commit-types
Expand Down Expand Up @@ -50,6 +45,13 @@ jobs:
# merge commit, and it's easy to commit this by mistake. Enable this option
# to also validate the commit message for one commit PRs.
validateSingleCommit: true

# Required in order to add/remove labels from the PR
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Add Failure Label
if: failure()
run: |
Expand Down
16 changes: 14 additions & 2 deletions AR-builder.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -375,10 +375,22 @@ pipeline {
echo 'Checking folder before S3 Bucket upload'
sh "ls -la app/build/outputs/apk/${params.FLAVOR.toLowerCase()}/${params.BUILD_TYPE.toLowerCase()}/"
echo 'Uploading file to S3 Bucket'
s3Upload(acl: 'Private', workingDir: "app/build/outputs/apk/${params.FLAVOR.toLowerCase()}/${params.BUILD_TYPE.toLowerCase()}/", includePathPattern: 'com.wire.android-*.apk', bucket: 'z-lohika', path: "megazord/android/reloaded/${params.FLAVOR.toLowerCase()}/${params.BUILD_TYPE.toLowerCase()}/")
s3Upload(
acl: 'Private',
workingDir: "app/build/outputs/apk/${params.FLAVOR.toLowerCase()}/${params.BUILD_TYPE.toLowerCase()}/",
includePathPattern: 'com.wire.android-*.apk',
bucket: 'z-lohika',
path: "megazord/android/reloaded/${params.FLAVOR.toLowerCase()}/${params.BUILD_TYPE.toLowerCase()}/"
)
script {
if (params.SOURCE_BRANCH.startsWith("PR-") || params.SOURCE_BRANCH == "develop" || params.SOURCE_BRANCH == "release/candidate") {
s3Upload(acl: 'Private', workingDir: "app/build/outputs/apk/${params.FLAVOR.toLowerCase()}/${params.BUILD_TYPE.toLowerCase()}/", includePathPattern: 'com.wire.android-*.apk', bucket: 'z-lohika', path: "megazord/android/reloaded/by-branch/${params.SOURCE_BRANCH}/")
s3Upload(
acl: 'Private',
workingDir: "app/build/outputs/apk/${params.FLAVOR.toLowerCase()}/${params.BUILD_TYPE.toLowerCase()}/",
includePathPattern: 'com.wire.android-*.apk',
bucket: 'z-lohika',
path: "megazord/android/reloaded/by-branch/${params.SOURCE_BRANCH}/${params.FLAVOR.toLowerCase()}/${params.BUILD_TYPE.toLowerCase()}/"
)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ List<String> defineFlavor() {
if (branchName == "main") {
return ['Beta']
} else if (branchName == "develop") {
return ['Staging', 'Dev']
return ['Staging']
} else if (branchName == "prod") {
return ['Prod']
} else if (branchName == "internal") {
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ These differences are:
- the open source project does not include the API keys of 3rd party services.
- the open source project links against the open source Wire audio-video-signaling (AVS) library. The binary Play Store client links against an AVS version that contains proprietary improvements for the call quality.

## Prerequisites
## Required software

In order to build Wire for Android locally, it is necessary to install the following tools on the local machine:
In order to build Wire for Android locally, it is necessary to have the following tools installed:

- JDK 11
- JDK 17
- Android SDK
- Android NDK

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import com.wire.kalium.logic.data.id.ConversationId
import com.wire.kalium.logic.feature.user.webSocketStatus.ObservePersistentWebSocketConnectionStatusUseCase
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.SupervisorJob
import kotlinx.coroutines.flow.collectLatest
import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.flowOf
Expand All @@ -35,6 +36,13 @@ class GlobalObserversManager @Inject constructor(

fun observe() {
scope.launch { setUpNotifications() }
scope.launch {
coreLogic.getGlobalScope().observeValidAccounts().distinctUntilChanged().collectLatest {
if (it.isNotEmpty()) {
coreLogic.getSessionScope(it.first().first.id).calls.endCallOnConversationChange()
}
}
}
}

private suspend fun setUpNotifications() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,6 @@ class AuthServerConfigProvider @Inject constructor() {
fun updateAuthServer(serverConfig: ServerConfig) {
_authServer.value = serverConfig.links
}

fun defaultServerLinks() = defaultBackendConfigs
}
Loading

0 comments on commit b7cf6d7

Please sign in to comment.