Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/trunk' into merge/24.9-rc-2-to-t…
Browse files Browse the repository at this point in the history
…runk
  • Loading branch information
oguzkocer committed May 22, 2024
2 parents 059cc26 + 0f7f65b commit 9402057
Show file tree
Hide file tree
Showing 45 changed files with 1,103 additions and 119 deletions.
39 changes: 39 additions & 0 deletions .aiexclude
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# OS X generated file
.DS_Store

# Build-related files
fastlane/

# Key-related files
.jks
.keystore

# Backup files
.bak

# Generated files
bin/
gen/
build/
build.log

# Built application files
.apk
.ap_
.aab

# Dex VM files
.dex

# Configuration files
.configure
.configure-files/
google-services.json
google-upload-credentials.json
firebase.secrets.json
sentry.properties

# Gradle files
gradle.properties
local.properties
local-builds.gradle
10 changes: 10 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ steps:
#################
- group: "🕵️‍♂️ Linters"
steps:
- label: "☢️ Danger - PR Check"
command: danger
key: danger
if: "build.pull_request.id != null"
retry:
manual:
permit_on_passed: true
agents:
queue: "linter"

- label: "🕵️ checkstyle"
command: |
cp gradle.properties-example gradle.properties
Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/run-danger.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
name: ☢️ Danger
name: ☢️ Trigger Danger On Buildkite

on:
pull_request:
types: [opened, reopened, ready_for_review, synchronize, edited, labeled, unlabeled, milestoned, demilestoned]
types: [labeled, unlabeled, milestoned, demilestoned]

jobs:
dangermattic:
# runs on draft PRs only for opened / synchronize events
if: ${{ (github.event.pull_request.draft == false) || (github.event.pull_request.draft == true && contains(fromJSON('["opened", "synchronize"]'), github.event.action)) }}
uses: Automattic/dangermattic/.github/workflows/reusable-run-danger.yml@v1.0.0
if: ${{ (github.event.pull_request.draft == false) }}
uses: Automattic/dangermattic/.github/workflows/reusable-retry-buildkite-step-on-events.yml@v1.1.0
with:
org-slug: "automattic"
pipeline-slug: "wordpress-android"
retry-step-key: "danger"
build-commit-sha: "${{ github.event.pull_request.head.sha }}"
secrets:
github-token: ${{ secrets.DANGERMATTIC_GITHUB_TOKEN }}
buildkite-api-token: ${{ secrets.TRIGGER_BK_BUILD_TOKEN }}
3 changes: 2 additions & 1 deletion Dangerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
github.dismiss_out_of_range_messages

# `files: []` forces rubocop to scan all files, not just the ones modified in the PR
rubocop.lint(files: [], force_exclusion: true, inline_comment: true, fail_on_inline_comment: true, include_cop_names: true)
# Added a custom `rubocop_cmd` to prevent RuboCop from running using `bundle exec`, which we don't want on the linter agent
rubocop.lint(files: [], force_exclusion: true, inline_comment: true, fail_on_inline_comment: true, include_cop_names: true, rubocop_cmd: ': | rubocop')

manifest_pr_checker.check_gemfile_lock_updated

Expand Down
40 changes: 12 additions & 28 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -69,29 +69,16 @@ GEM
no_proxy_fix
octokit (>= 4.0)
terminal-table (>= 1, < 4)
danger-dangermattic (1.0.0)
danger-dangermattic (1.0.2)
danger (~> 9.4)
danger-junit (~> 1.0)
danger-plugin-api (~> 1.0)
danger-rubocop (~> 0.12)
danger-swiftlint (~> 0.35)
danger-xcode_summary (~> 1.0)
rubocop (~> 1.60)
danger-junit (1.0.2)
danger (> 2.0)
ox (~> 2.0)
rubocop (~> 1.61)
danger-plugin-api (1.0.0)
danger (> 2.0)
danger-rubocop (0.12.0)
danger
rubocop (~> 1.0)
danger-swiftlint (0.35.0)
danger
rake (> 10)
thor (~> 1.0.0)
danger-xcode_summary (1.3.0)
danger-plugin-api (~> 1.0)
xcresult (~> 0.2)
declarative (0.0.20)
diffy (3.4.2)
digest-crc (0.6.5)
Expand Down Expand Up @@ -241,7 +228,7 @@ GEM
concurrent-ruby (~> 1.0)
java-properties (0.3.0)
jmespath (1.6.2)
json (2.7.1)
json (2.7.2)
jwt (2.8.0)
base64
kramdown (2.4.0)
Expand All @@ -254,7 +241,7 @@ GEM
mini_portile2 (2.8.5)
minitest (5.22.2)
multi_json (1.15.0)
multipart-post (2.4.0)
multipart-post (2.4.1)
mutex_m (0.2.0)
nanaimo (0.3.0)
nap (1.1.0)
Expand All @@ -271,23 +258,22 @@ GEM
options (2.3.2)
optparse (0.4.0)
os (1.1.4)
ox (2.14.17)
parallel (1.24.0)
parser (3.3.0.5)
parser (3.3.1.0)
ast (~> 2.4.1)
racc
plist (3.7.1)
progress_bar (1.3.3)
highline (>= 1.6, < 3)
options (~> 2.3.0)
public_suffix (5.0.4)
public_suffix (5.0.5)
racc (1.7.3)
rainbow (3.1.1)
rake (13.1.0)
rake (13.2.1)
rake-compiler (1.2.7)
rake
rchardet (1.8.0)
regexp_parser (2.9.0)
regexp_parser (2.9.1)
representable (3.2.0)
declarative (< 0.1.0)
trailblazer-option (>= 0.1.1, < 0.2.0)
Expand All @@ -296,19 +282,19 @@ GEM
rexml (3.2.6)
rmagick (4.3.0)
rouge (2.0.7)
rubocop (1.60.2)
rubocop (1.63.5)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.30.0, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.30.0)
parser (>= 3.2.1.0)
rubocop-ast (1.31.3)
parser (>= 3.3.1.0)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
rubyzip (2.3.2)
Expand All @@ -327,7 +313,6 @@ GEM
terminal-notifier (2.0.0)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
thor (1.0.1)
trailblazer-option (0.1.2)
tty-cursor (0.7.1)
tty-screen (0.8.2)
Expand All @@ -349,7 +334,6 @@ GEM
rouge (~> 2.0.7)
xcpretty-travis-formatter (1.0.1)
xcpretty (~> 0.2, >= 0.0.7)
xcresult (0.2.1)

PLATFORMS
ruby
Expand Down
9 changes: 8 additions & 1 deletion RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@

25.0
-----

* [*] Fixed a rare crash on Posts List screen [https://github.com/wordpress-mobile/WordPress-Android/pull/20813]
* [*] Fixed a rare crash on the Login screen [https://github.com/wordpress-mobile/WordPress-Android/pull/20821]
* [*] Fix a crash that occurs when remove a user [https://github.com/wordpress-mobile/WordPress-Android/pull/20837]
* [*] Fixed a rare crash on the featured image confirmation dialog [https://github.com/wordpress-mobile/WordPress-Android/pull/20836]
* [*] Fixed an ANR issue on the Post List screen [https://github.com/wordpress-mobile/WordPress-Android/pull/20833]
* [*] Fixed a crash that occurs with Blogging Reminders [https://github.com/wordpress-mobile/WordPress-Android/pull/20845]
* [*] [internal] Block Editor: Upgrade target sdk version to Android API 34 [https://github.com/wordpress-mobile/WordPress-Android/pull/20841]
* [*] [internal] In-app updates feature [https://github.com/wordpress-mobile/WordPress-Android/pull/20822]

24.9
-----
Expand Down
5 changes: 5 additions & 0 deletions WordPress/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ android {
buildConfigField "boolean", "READER_DISCOVER_NEW_ENDPOINT", "false"
buildConfigField "boolean", "READER_READING_PREFERENCES", "false"
buildConfigField "boolean", "READER_READING_PREFERENCES_FEEDBACK", "false"
buildConfigField "boolean", "VOICE_TO_CONTENT", "false"

// Override these constants in jetpack product flavor to enable/ disable features
buildConfigField "boolean", "ENABLE_SITE_CREATION", "true"
Expand All @@ -166,6 +167,7 @@ android {
buildConfigField "boolean", "DASHBOARD_PERSONALIZATION", "false"
buildConfigField "boolean", "ENABLE_SITE_MONITORING", "false"
buildConfigField "boolean", "SYNC_PUBLISHING", "false"
buildConfigField "boolean", "ENABLE_IN_APP_UPDATES", "false"

manifestPlaceholders = [magicLinkScheme:"wordpress"]
}
Expand Down Expand Up @@ -391,6 +393,9 @@ dependencies {
implementation "org.wordpress:persistentedittext:$wordPressPersistentEditTextVersion"
implementation "$gradle.ext.gravatarBinaryPath:$gravatarVersion"

implementation "com.google.android.play:app-update:$googlePlayInAppUpdateVersion"
implementation "com.google.android.play:app-update-ktx:$googlePlayInAppUpdateVersion"

implementation "androidx.arch.core:core-common:$androidxArchCoreVersion"
implementation "androidx.arch.core:core-runtime:$androidxArchCoreVersion"
implementation "com.google.code.gson:gson:$googleGsonVersion"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package org.wordpress.android.util.config

const val IN_APP_UPDATE_BLOCKING_VERSION_REMOTE_FIELD = "jp_in_app_update_blocking_version_android"


Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,6 @@ class AppInitializer @Inject constructor(
crashLogging.initialize()
dispatcher.register(this)
appConfig.init(appScope)

// Upload any encrypted logs that were queued but not yet uploaded
encryptedLogging.start()

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package org.wordpress.android.inappupdate

import android.app.Activity

interface IInAppUpdateManager {
fun checkForAppUpdate(activity: Activity, listener: InAppUpdateListener)
fun completeAppUpdate()
fun cancelAppUpdate(updateType: Int)
fun onUserAcceptedAppUpdate(updateType: Int)

companion object {
const val APP_UPDATE_IMMEDIATE_REQUEST_CODE = 1001
const val APP_UPDATE_FLEXIBLE_REQUEST_CODE = 1002
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package org.wordpress.android.inappupdate

import com.google.android.play.core.install.model.AppUpdateType
import org.wordpress.android.analytics.AnalyticsTracker
import org.wordpress.android.util.analytics.AnalyticsTrackerWrapper
import javax.inject.Inject

class InAppUpdateAnalyticsTracker @Inject constructor(
private val tracker: AnalyticsTrackerWrapper
) {
fun trackUpdateShown(updateType: Int) {
tracker.track(AnalyticsTracker.Stat.IN_APP_UPDATE_SHOWN, createPropertyMap(updateType))
}

fun trackUpdateAccepted(updateType: Int) {
tracker.track(AnalyticsTracker.Stat.IN_APP_UPDATE_ACCEPTED, createPropertyMap(updateType))
}

fun trackUpdateDismissed(updateType: Int) {
tracker.track(AnalyticsTracker.Stat.IN_APP_UPDATE_DISMISSED, createPropertyMap(updateType))
}

fun trackAppRestartToCompleteUpdate() {
tracker.track(AnalyticsTracker.Stat.IN_APP_UPDATE_COMPLETED_WITH_APP_RESTART)
}

private fun createPropertyMap(updateType: Int): Map<String, String> {
return when (updateType) {
AppUpdateType.FLEXIBLE -> mapOf(PROPERTY_UPDATE_TYPE to UPDATE_TYPE_FLEXIBLE)
AppUpdateType.IMMEDIATE -> mapOf(PROPERTY_UPDATE_TYPE to UPDATE_TYPE_BLOCKING)
else -> emptyMap()
}
}

companion object {
const val PROPERTY_UPDATE_TYPE = "type"
const val UPDATE_TYPE_FLEXIBLE = "flexible"
const val UPDATE_TYPE_BLOCKING = "blocking"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package org.wordpress.android.inappupdate

/**
* Abstract class for handling callbacks related to in-app update events.
*
* Each method provides a default implementation that does nothing, allowing
* implementers to only override the necessary methods without implementing
* all callback methods.
*/
abstract class InAppUpdateListener {
open fun onAppUpdateStarted(type: Int) {
// Default empty implementation
}

open fun onAppUpdateDownloaded() {
// Default empty implementation
}

open fun onAppUpdateInstalled() {
// Default empty implementation
}

open fun onAppUpdateFailed() {
// Default empty implementation
}

open fun onAppUpdateCancelled() {
// Default empty implementation
}

open fun onAppUpdatePending() {
// Default empty implementation
}
}
Loading

0 comments on commit 9402057

Please sign in to comment.