Skip to content

Commit

Permalink
Merge pull request #431 from fork-maintainers/upstream-sync
Browse files Browse the repository at this point in the history
Upstream sync with Mozilla Firefox v96.3.0
  • Loading branch information
interfect authored Jan 31, 2022
2 parents 2fa4406 + c8b6a38 commit 28893ce
Show file tree
Hide file tree
Showing 653 changed files with 25,410 additions and 24,441 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/---performance-issue.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: "⌛ Performance issue"
about: Create a performance issue if the app is slow or it uses too much memory, disk space, battery, or network data
title: ""
labels: "eng:performance"
labels: "performance"
assignees: ''

---
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-contributor-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ jobs:

run-ui:
runs-on: macos-11
if: ${{ false }} # disable for now'
if: ${{ false }}

timeout-minutes: 60
strategy:
Expand All @@ -118,12 +118,12 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Run subset of UI Tests
uses: reactivecircus/android-emulator-runner@v2
uses: reactivecircus/android-emulator-runner@v2.21.0
with:
api-level: ${{ matrix.api-level }}
target: ${{ matrix.target }}
arch: x86_64
profile: pixel_3a
profile: pixel_2
script:
"JAVA_HOME=$JAVA_HOME_11_X64 && ./gradlew connectedDebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.class=\
org.mozilla.fenix.ui.NavigationToolbarTest#visitURLTest"
Expand Down
34 changes: 22 additions & 12 deletions .mergify.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
queue_rules:
- name: default
conditions:
- status-success=pr-complete
pull_request_rules:
- name: Resolve conflict
conditions:
Expand All @@ -14,9 +18,10 @@ pull_request_rules:
review:
type: APPROVE
message: MickeyMoz 💪
merge:
queue:
method: rebase
strict: smart
name: default
rebase_fallback: none
- name: L10N - Auto Merge
conditions:
- author=mozilla-l10n-automation-bot
Expand All @@ -26,9 +31,10 @@ pull_request_rules:
review:
type: APPROVE
message: LGTM 😎
merge:
queue:
method: rebase
strict: smart
name: default
rebase_fallback: none
- name: Release automation (Old)
conditions:
- base~=releases[_/].*
Expand All @@ -52,9 +58,10 @@ pull_request_rules:
review:
type: APPROVE
message: 🚢
merge:
queue:
method: rebase
strict: smart
name: default
rebase_fallback: none
delete_head_branch:
force: false
- name: Release automation (New)
Expand All @@ -81,9 +88,10 @@ pull_request_rules:
review:
type: APPROVE
message: 🚢
merge:
queue:
method: rebase
strict: smart
name: default
rebase_fallback: none
delete_head_branch:
force: false
- name: Needs landing - Rebase
Expand All @@ -95,9 +103,10 @@ pull_request_rules:
- label!=pr:work-in-progress
- label!=pr:do-not-land
actions:
merge:
queue:
method: rebase
strict: smart
name: default
rebase_fallback: none
- name: Needs landing - Squash
conditions:
- check-success=pr-complete
Expand All @@ -107,6 +116,7 @@ pull_request_rules:
- label!=pr:work-in-progress
- label!=pr:do-not-land
actions:
merge:
queue:
method: squash
strict: smart
name: default
rebase_fallback: none
9 changes: 4 additions & 5 deletions .taskcluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ tasks:
- $let:
taskgraph:
branch: taskgraph
revision: 9daff451cfbe82c5c70237a7b3dbcf4fd3238299
revision: d85f4e4213706ec7737c7257f681977fdf20eb60
trustDomain: mobile
in:
$let:
Expand Down Expand Up @@ -104,7 +104,6 @@ tasks:
tasks_for in ["action", "cron"]
|| (tasks_for == "github-pull-request" && pullRequestAction in ["opened", "reopened", "synchronize"])
|| (tasks_for == "github-push" && head_branch[:10] != "refs/tags/") && (head_branch != "staging.tmp") && (head_branch != "trying.tmp") && (head_branch[:8] != "mergify/")
|| (tasks_for == "github-release" && releaseAction == "published" && (ownerEmail != "mozilla-release-automation-bot@users.noreply.github.com") && (ownerEmail != "mozilla-release-automation-bot-staging@users.noreply.github.com"))
then:
$let:
level:
Expand Down Expand Up @@ -249,9 +248,9 @@ tasks:

command:
- /usr/local/bin/run-task
- '--mobile-checkout=/builds/worker/checkouts/src'
- '--mobile-checkout=/builds/worker/checkouts/vcs'
- '--taskgraph-checkout=/builds/worker/checkouts/taskgraph'
- '--task-cwd=/builds/worker/checkouts/src'
- '--task-cwd=/builds/worker/checkouts/vcs'
- '--'
- bash
- -cx
Expand Down Expand Up @@ -293,7 +292,7 @@ tasks:
expires: {$fromNow: '1 year'}
'public/docker-contexts':
type: 'directory'
path: '/builds/worker/checkouts/src/docker-contexts'
path: '/builds/worker/checkouts/vcs/docker-contexts'
# This needs to be at least the deadline of the
# decision task + the docker-image task deadlines.
# It is set to a week to allow for some time for
Expand Down
33 changes: 24 additions & 9 deletions app/benchmark.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,29 @@ ext.maybeConfigForJetpackBenchmark = { android ->
// WARNING: the benchmark framework warns you if you're running the test in a configuration
// that will compromise the accuracy of the results. Unfortunately, I couldn't get everything
// working so I had to suppress some things.
//
// - ACTIVITY-MISSING: we're supposed to use the test instrumentation runner,
// "androidx.benchmark.junit4.AndroidBenchmarkRunner". However, when I do so, I get an error
// that we're unable to launch the activity. My understanding is that this runner will use an
// "IsolationActivity" to reduce the impact of other work on the device from affecting the benchmark
// and to opt into a lower-max CPU frequency on unrooted devices that support it
// - UNLOCKED: ./gradlew lockClocks, which locks the CPU frequency, fails on my device. See
// https://issuetracker.google.com/issues/176836267 for potential workarounds.
testInstrumentationRunnerArgument 'androidx.benchmark.suppressErrors', 'ACTIVITY-MISSING,UNLOCKED'
testInstrumentationRunnerArguments = [

// - ACTIVITY-MISSING: we're supposed to use the test instrumentation runner,
// "androidx.benchmark.junit4.AndroidBenchmarkRunner". However, when I do so, I get an error
// that we're unable to launch the activity. My understanding is that this runner will use an
// "IsolationActivity" to reduce the impact of other work on the device from affecting the benchmark
// and to opt into a lower-max CPU frequency on unrooted devices that support it
// - UNLOCKED: ./gradlew lockClocks, which locks the CPU frequency, fails on my device. See
// https://issuetracker.google.com/issues/176836267 for potential workarounds.
'androidx.benchmark.suppressErrors' : 'ACTIVITY-MISSING,UNLOCKED',

// The tests don't always output a JSON file with the data. To make sure it does, we have to
// set androidx.benchmark.output.enable to true.
'androidx.benchmark.output.enable' : 'true',

// We set the the output directory simply for simplicity since the benchmark_runner.py script
// can't know the name of the phone in the /build/outputs/ directory. The system defaults to
// {phone_name} which can be troublesome finding in some case.
//
// NOTE: Jetpack Benchmark outputs to Logcat too. However, the output in the logcat is
// the min of the several repeats, for more statistics. Therefore, to get more stats,
// we refer to the JSON file.
additionalTestOutputDir : '/storage/emulated/0/benchmark'
]
}
}
30 changes: 29 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import org.mozilla.fenix.gradle.tasks.ApkSizeTask

plugins {
id "com.jetbrains.python.envs" version "0.0.26"
id "com.google.protobuf" version "0.8.17"
Expand Down Expand Up @@ -42,6 +44,7 @@ android {
testInstrumentationRunnerArguments clearPackageData: 'true'
resValue "bool", "IS_DEBUG", "false"
buildConfigField "boolean", "USE_RELEASE_VERSIONING", "false"
buildConfigField "String", "GIT_HASH", "\"\"" // see override in release builds for why it's blank.
// This should be the "public" base URL of AMO.
buildConfigField "String", "AMO_BASE_URL", "\"https://addons.mozilla.org\""
buildConfigField "String", "AMO_COLLECTION_NAME", "\"7dfae8669acc4312a65e8ba5553036\""
Expand Down Expand Up @@ -83,6 +86,10 @@ android {
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
matchingFallbacks = ['release'] // Use on the "release" build type in dependencies (AARs)

// Changing the build config can cause files that depend on BuildConfig.java to recompile
// so we only set the git hash in release builds to avoid possible recompilation in debug builds.
buildConfigField "String", "GIT_HASH", "\"${Config.getGitHash()}\""

if (gradle.hasProperty("localProperties.autosignReleaseWithDebugKey")) {
signingConfig signingConfigs.debug
}
Expand Down Expand Up @@ -271,6 +278,7 @@ android {
composeOptions {
kotlinCompilerExtensionVersion = Versions.androidx_compose
}

}

// -------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -447,6 +455,12 @@ configurations {
jnaForTest
}

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
kotlinOptions {
freeCompilerArgs += "-Xopt-in=kotlinx.coroutines.ExperimentalCoroutinesApi"
}
}

dependencies {
jnaForTest Deps.jna
testImplementation files(configurations.jnaForTest.copyRecursive().files)
Expand Down Expand Up @@ -631,8 +645,14 @@ dependencies {
}

protobuf {
// Mac M1 workaround until we can bump the version. Dependent on A-S.
// See https://github.com/mozilla-mobile/fenix/issues/22321
protoc {
artifact = Deps.protobuf_compiler
if (osdetector.os == "osx") {
artifact = "${Deps.protobuf_compiler}:osx-x86_64"
} else {
artifact = Deps.protobuf_compiler
}
}

// Generates the java Protobuf-lite code for the Protobufs in this project. See
Expand Down Expand Up @@ -824,3 +844,11 @@ ext.updateExtensionVersion = { task, extDir ->
expand(values)
}
}

android.applicationVariants.all { variant ->
tasks.register("apkSize${variant.name.capitalize()}", ApkSizeTask) {
variantName = variant.name
apks = variant.outputs.collect { output -> output.outputFile.name }
dependsOn "package${variant.name.capitalize()}"
}
}
Loading

0 comments on commit 28893ce

Please sign in to comment.