From cfd6e58ebe11059e6057c5031cb74b3260ffdbf9 Mon Sep 17 00:00:00 2001 From: Petros Paraskevopoulos Date: Fri, 28 Jun 2024 12:32:34 +0300 Subject: [PATCH 1/3] Build: Add dependency analysis plugin FYI: This commit adds a previous version of the plugin (1.28.0) and not the latest version (1.32.0). This is because the latest version gets stuck during the 'computeActualUsage' phase and increases the build time of the 'buildHealth' task by as much as five times (5x). For more info see: Stuck in computeActualUsageDebug for many minutes #1186 (https://github.com/autonomousapps/ dependency-analysis-gradle-plugin/issues/1186) --- build.gradle | 1 + settings.gradle | 2 ++ 2 files changed, 3 insertions(+) diff --git a/build.gradle b/build.gradle index 35cbeef403dd..4e6632668e9c 100644 --- a/build.gradle +++ b/build.gradle @@ -5,6 +5,7 @@ plugins { id "io.gitlab.arturbosch.detekt" id 'com.automattic.android.measure-builds' id "org.jetbrains.kotlinx.kover" + id "com.autonomousapps.dependency-analysis" id "androidx.navigation.safeargs.kotlin" apply false id "com.android.library" apply false id 'com.google.gms.google-services' apply false diff --git a/settings.gradle b/settings.gradle index 0d1018fd702f..ce16fc371913 100644 --- a/settings.gradle +++ b/settings.gradle @@ -10,6 +10,7 @@ pluginManagement { gradle.ext.violationCommentsVersion = '1.70.0' gradle.ext.measureBuildsVersion = '2.1.2' gradle.ext.koverVersion = '0.7.5' + gradle.ext.dependencyAnalysisVersion = '1.28.0' plugins { id "org.jetbrains.kotlin.android" version gradle.ext.kotlinVersion @@ -28,6 +29,7 @@ pluginManagement { id "org.jetbrains.kotlinx.kover" version gradle.ext.koverVersion id "com.google.dagger.hilt.android" version gradle.ext.daggerVersion id "com.google.devtools.ksp" version gradle.ext.kspVersion + id "com.autonomousapps.dependency-analysis" version gradle.ext.dependencyAnalysisVersion } repositories { maven { From 639790545ecf085afd91fb3355e93a4ced4ff985 Mon Sep 17 00:00:00 2001 From: Petros Paraskevopoulos Date: Fri, 28 Jun 2024 13:08:28 +0300 Subject: [PATCH 2/3] Build: Ignored variants configuration for dependency analysis plugin This commit updates the encrypted 'gradle.properties.enc' file to point to that pinned hash which has the 'dependency.analysis.android.ignored.variants' property added into the 'gradle.properties' file for the WPAndroid project. FYI: With this configuration only the 'debug' variant (build type) for the lib modules and 'wordpressJalapenoDebug' + 'jetpackJalapenoDebug' variants (product flavor + build type) for the app module is going to be included, with the rest of the variants ignored. --- .configure | 2 +- .configure-files/gradle.properties.enc | Bin 3424 -> 3744 bytes gradle.properties-example | 3 +++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.configure b/.configure index d6e9f159bcec..9abd2a6ba5c6 100644 --- a/.configure +++ b/.configure @@ -1,7 +1,7 @@ { "project_name": "WordPress-Android", "branch": "trunk", - "pinned_hash": "715a5a119a334ec1ef16b5a6bd77c52094144813", + "pinned_hash": "4b536af182cc61c263b07262e41c141f06fd5de6", "files_to_copy": [ { "file": "android/WPAndroid/gradle.properties", diff --git a/.configure-files/gradle.properties.enc b/.configure-files/gradle.properties.enc index c2c83c9d107128cd59d3a559451e8fec1ba7678d..cfe19b47de6be594229fb660683145deae33d893 100644 GIT binary patch delta 2265 zcmV;~2qyR78lWAp;01q6?Gi3nkbh^SA^B`PR+7;%v30<8Xh`oQsS3Jv2C6pbwHXWM z9+n4KQAVfqM7n(&fGW++cP9xJ^Iy+bsIaocyiFThSP0aV2TT z!0fx)M%Iq_WsQ`l<#__u&Ja*Pp8V^v%n5DIJl3%&Zj@K3ssMip##Vb1c;il_mX<=) zP2|4n2>CK5r^&Sps>r@(?JNNWRmb`Zh*_U8M)$^5vt!Y!H8gQG^ZTT}6%WFPHGx#i z#VX!lZL`stwa8#uL2!N4^3$I{!RWl`V9-7km{&xeiX;7VrD0aBHi;^@_!!5PW85$m zJ0tz^ZJBdfIqu@PPF~F30T1q zlF3^!EJ9>Fj_X3=R{U<_j9(d{rTiNMt3yq|Kf{pZS#@Mq*v;z43}uYF%lc;mqc_5K zXT07O>%sN@feum_(Kk_F60)ku<#Eba&}J-%$1Twi7xRB}vw@hVic6GQ17)+&JN#`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&>>ZCDjf^II*M~9)VfTI}G^lsh$-$Q-(6Av^*_IV>7e@ATKLD2y| zRV3pPLoYo?MUbRf4)y@P?dR`*AufNh^xLntX8|f&`J=c92y5{?H+yViHYLU5LO#<7 zn5|8Ct6(&2>?3j;PpEqmnLsc*@W3b$s|8gaSEZEgN3rr`Dcr(SEmW4cu4L9AS_o3Y z#Z@_0IDEI*h~)um(iR_U`Vd%`btCDy`E+>D|J4YGE z(+i@0Vz!MH)PR=k2ya^RcHdw-{1(GYtzKYRYBEx25o$YpiwdKZy7)E2Aiol*`A*Re zgr-iA$KIUf1(lw3Tn(#d<8u&POzF*i+RKNJupd7Xq`)j?PQSH(=s! zJ}CiLJ8wg94*e)Y_vCCl;-?d)bpp~s!=}9~C3fd&u=~We zh3ceT^X?seh{9jrr*f-B0O$*yiLwRd$*LM%xsY`)pp4HRy?uC18&ggUmoaH?(oa#71dm ze~(|2RCvK*sg};ayt9FtJr6*kXZb&Eom2rwApTaBZY>5)`+9$tg0+FS%qQFCcnI#- z!UIo7KG9_W4`c!aUNd)H*WN*_LA)e=%+`kRXcDWbeAq_y8^go^^^m7j%!!!>;`E~f zJ+WNme`wusybz?r>Hk-g6^gyuiyUfb4pUbG_ZqVp4uQ9)iAbB_k=KJ<`_~`s+?6La ddCYtQrZ|UM2`~>$dkYF4W+OdnNS@z!Ls8st!NULm diff --git a/gradle.properties-example b/gradle.properties-example index 8e52efd546b9..4fef2c46ec7b 100644 --- a/gradle.properties-example +++ b/gradle.properties-example @@ -48,3 +48,6 @@ wp.e2e.signup_email=e2eflowsignuptestingmobile@example.com wp.e2e.signup_username=e2eflowsignuptestingmobile wp.e2e.signup_display_name=e2eflowsignuptestingmobile wp.e2e.signup_password=mocked_password + +# Dependency Analysis Plugin +dependency.analysis.android.ignored.variants=release,wordpressVanillaDebug,wordpressVanillaRelease,wordpressWasabiDebug,wordpressWasabiRelease,wordpressJalapenoRelease,jetpackVanillaDebug,jetpackVanillaRelease,jetpackWasabiDebug,jetpackWasabiRelease,jetpackJalapenoRelease From 65e421a9e7dcf0c9625850a01eae45a5debea80e Mon Sep 17 00:00:00 2001 From: Petros Paraskevopoulos Date: Fri, 28 Jun 2024 13:18:39 +0300 Subject: [PATCH 3/3] CI: Add a scheduled dependency analysis job FYI: 1. This job will be then used by 'buildkite-ci' and configured as a 'buildkite_pipeline_schedule' with a weekly frequently. 2. This job will also notify on the android-core-notifs slack channel on a build failure. 3. This job has added custom meta-data for dependency analysis purposes. This is done in order for it to be queried and easily identifiable amongst other builds when working with the Buildkite's REST API. --- .buildkite/schedules/dependency-analysis.yml | 23 ++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .buildkite/schedules/dependency-analysis.yml diff --git a/.buildkite/schedules/dependency-analysis.yml b/.buildkite/schedules/dependency-analysis.yml new file mode 100644 index 000000000000..fb6cd3b469f7 --- /dev/null +++ b/.buildkite/schedules/dependency-analysis.yml @@ -0,0 +1,23 @@ +# Nodes with values to reuse in the pipeline. +common_params: + # Common plugin settings to use with the `plugins` key. + - &ci_toolkit + automattic/a8c-ci-toolkit#3.4.2 + +agents: + queue: "android" + +steps: + - label: "dependency analysis" + # The meta-data added is used by Apps Metrics Prometheus collector to find the build. + command: | + buildkite-agent meta-data set "scheduled-build" "dependency-analysis" + echo "--- 📊 Analyzing" + cp gradle.properties-example gradle.properties + ./gradlew buildHealth + plugins: [*ci_toolkit] + artifact_paths: + - "build/reports/dependency-analysis/build-health-report.*" + notify: + - slack: "#android-core-notifs" + if: build.state == "failed"