Skip to content

Commit

Permalink
Merge remote-tracking branch 'mozilla/main' into wt/FXIOS-10617-Add-G…
Browse files Browse the repository at this point in the history
…lean-usage-profile-id
  • Loading branch information
thatswinnie committed Nov 26, 2024
2 parents 33f1fde + f1892ff commit 424f0e8
Show file tree
Hide file tree
Showing 516 changed files with 12,152 additions and 2,873 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/firefox-ios-ui-tests-previous-os.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
name: "Firefox UI Tests for iOS 15 & 16"
name: "Firefox UI Tests for iOS 15, 16 & 17"

on:
workflow_dispatch: {}
env:
browser: firefox-ios
xcode_version: 15.4
ios_version: 17.5
ios_simulator_default: iPhone 15
xcode_version: 16.1
ios_version: 18.1
ios_simulator_default: iPhone 16
xcodebuild_scheme: Fennec
xcodebuild_target: Client
test_results_directory: /Users/runner/tmp

jobs:
compile:
name: Compile
runs-on: macos-14
runs-on: macos-15
steps:
- name: Check out source code
uses: actions/[email protected]
Expand Down Expand Up @@ -54,13 +54,15 @@ jobs:

run-smoketests:
name: Run smoke tests
runs-on: macos-14
runs-on: macos-15
needs: compile
strategy:
fail-fast: false
max-parallel: 1
matrix:
include:
- ios_version: 17.5
ios_simulator: iPhone 15
- ios_version: 16.4
ios_simulator: iPhone 14
- ios_version: 15.5
Expand All @@ -78,8 +80,6 @@ jobs:
id: xcode
run: |
sudo rm -rf /Applications/Xcode.app
sudo rm -fr /Applications/Xcode_16*
sudo rm -fr /Applications/Xcode_14*
sudo xcode-select -s /Applications/Xcode_${{ env.xcode_version }}.app/Contents/Developer
xcodebuild -version
./checkout.sh
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/firefox-ios-ui-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ on:

env:
browser: firefox-ios
xcode_version: 15.4
ios_version: 17.5
ios_simulator_default: iPhone 15
xcode_version: 16.1
ios_version: 18.1
ios_simulator_default: iPhone 16
xcodebuild_scheme: Fennec
xcodebuild_target: Client
test_results_directory: /Users/runner/tmp

jobs:
compile:
name: Compile
runs-on: macos-14
runs-on: macos-15
steps:
- name: Check out source code
uses: actions/[email protected]
Expand Down Expand Up @@ -63,7 +63,7 @@ jobs:
fail-fast: false
max-parallel: 1
matrix:
ios_simulator: ['iPhone 15 Plus', 'iPad Pro 13-inch (M4)']
ios_simulator: ['iPhone 16', 'iPad mini (A17 Pro)']
steps:
- name: Check out source code
uses: actions/[email protected]
Expand Down
18 changes: 13 additions & 5 deletions .github/workflows/firefox-ios-update-nimbus-experiments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,29 @@ jobs:
experimenter-url: https://experimenter.services.mozilla.com/api/v6/experiments-first-run/
app-name: firefox_ios
branch: automation/update-nimbus-experiments
- name: "Debug - workaround issue: 23215"
run: |-
cd firefox-ios
sudo chown runner:docker -R .git
- name: Create Pull Request
id: create-pull-request
uses: peter-evans/create-pull-request@v6
if: steps.update-experiments-json.outputs.changed == 1 && steps.update-experiments-json.outputs.changed-branch >= 1
with:
token: ${{ secrets.GITHUB_TOKEN }}
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
committer: GitHub <[email protected]>
path: firefox-ios
add-paths: firefox-ios/Client/Experiments/initial_experiments.json
branch: automation/update-nimbus-experiments
commit-message: "update initial_experiments.json based on the current first-run experiments in experimenter"
title: "Refactor [vXXX] Update initial experiments JSON for Nimbus"
body: "This (automated) PR updates the initial_experiments.json on the `main` branch"
delete-branch: true
labels: Needs Code Review
- name: Enable Pull Request Automerge
if: steps.create-pull-request.outputs.pull-request-operation == 'created'
run: gh pr merge --squash "${{ steps.create-pull-request.outputs.pull-request-number }}"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Disabling Automerge
#- name: Enable Pull Request Automerge
# if: steps.create-pull-request.outputs.pull-request-operation == 'created'
# run: gh pr merge --squash "${{ steps.create-pull-request.outputs.pull-request-number }}"
# env:
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
- name: Add changes
run: |
git diff
git diff --quiet || git add firefox-ios/Client/Assets/RemoteSettingsData/RemotePasswordRules.json
git diff --quiet || git add firefox-ios/Client/Assets/RemoteSettingsData/
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/focus-ios-ui-tests-previous-os.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
name: Focus iOS 15 & 16 tests
name: Focus iOS 15, 16 & 17 tests
on:
workflow_dispatch:
schedule:
- cron: "0 7 * * 1,3,5"

env:
browser: focus-ios
xcode_version: 15.4
xcode_version: 16.1
test_results_directory: /Users/runner/tmp

jobs:
Focus-iOS-Tests:
name: Focus iOS
runs-on: macos-14
runs-on: macos-15
strategy:
fail-fast: false
max-parallel: 1
matrix:
include:
- ios_version: 17.5
ios_simulator: iPhone 15
- ios_version: 16.4
ios_simulator: iPhone 14
- ios_version: 15.5
Expand All @@ -38,7 +40,7 @@ jobs:
id: xcode
run: |
sudo rm -rf /Applications/Xcode.app
sudo rm -fr /Applications/Xcode_16*
sudo rm -fr /Applications/Xcode_15*
sudo rm -fr /Applications/Xcode_14*
sudo xcode-select -s /Applications/Xcode_${{ env.xcode_version }}.app/Contents/Developer
xcodebuild -version
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/focus-ios-ui-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ on:

env:
browser: focus-ios
xcode_version: 15.4
ios_version: 17.5
ios_simulator_default: iPhone 15
xcode_version: 16.1
ios_version: 18.1
ios_simulator_default: iPhone 16
xcodebuild_scheme: Focus
xcodebuild_target: XCUITest
test_results_directory: /Users/runner/tmp

jobs:
compile:
name: Compile
runs-on: macos-14
runs-on: macos-15
steps:
- name: Check out source code
uses: actions/[email protected]
Expand Down Expand Up @@ -49,14 +49,14 @@ jobs:
retention-days: 2
run-tests:
name: Run tests
runs-on: macos-14
runs-on: macos-15
needs: compile
strategy:
fail-fast: false
max-parallel: 1
matrix:
xcodebuild_test_plan: ['SmokeTest'] # , 'FullFunctionalTests']
ios_simulator: [ 'iPhone 15', 'iPad Pro (12.9-inch) (6th generation)']
ios_simulator: [ 'iPhone 16', 'iPad (10th generation)']
steps:
- name: Check out source code
uses: actions/[email protected]
Expand Down
5 changes: 3 additions & 2 deletions BrowserKit/Sources/Common/Logger/CrashManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,10 @@ public class DefaultCrashManager: CrashManager {
// Turn Sentry breadcrumbs off since we have our own log swizzling
options.enableAutoBreadcrumbTracking = false
options.beforeSend = { event in
if event.error.self is CustomCrashReport {
self.alterEventForCustomCrash(event: event, crash: event.error as! CustomCrashReport)
guard let crashReport = event.error.self as? CustomCrashReport else {
return event
}
self.alterEventForCustomCrash(event: event, crash: crashReport)
return event
}
})
Expand Down
3 changes: 3 additions & 0 deletions BrowserKit/Sources/Common/Logger/LoggerCategory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,7 @@ public enum LoggerCategory: String {

/// Remote settings
case remoteSettings

/// Password Generator
case passwordGenerator
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ public class PrimaryRoundedButton: ResizableButton, ThemeApplicable {

configuration = UIButton.Configuration.filled()
titleLabel?.adjustsFontForContentSizeCategory = true

// Fix for https://openradar.appspot.com/FB12472792
titleLabel?.textAlignment = .center
}

required init?(coder aDecoder: NSCoder) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@ class DefaultContentBlockerParser: ContentBlockerParser {
return
}

entitiesRaw.forEach {
let properties = ($0.value as! [String: [String]])["properties"]!
let resources = ($0.value as! [String: [String]])["resources"]!
entitiesRaw.forEach { entitiesRawItem in
guard let entitiesDict = entitiesRawItem.value as? [String: [String]],
let properties = entitiesDict["properties"],
let resources = entitiesDict["resources"] else {
return
}
let entity = Entity(properties: properties, resources: resources)
resources.forEach {
entities[$0] = entity
Expand Down
10 changes: 8 additions & 2 deletions BrowserKit/Sources/ContentBlockingGenerator/JsonHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ struct JsonHelper {

do {
let data = try Data(contentsOf: file)
return try JSONSerialization.jsonObject(with: data, options: []) as! [String: Any]
guard let jsonObject = try JSONSerialization.jsonObject(with: data, options: []) as? [String: Any] else {
fatalError("Invalid JSON format: expected [String: Any] in \(filename)")
}
return jsonObject
} catch {
fatalError("Could not find entity file \(filename) at file \(file)")
}
Expand All @@ -21,7 +24,10 @@ struct JsonHelper {

do {
let data = try Data(contentsOf: file)
return try JSONSerialization.jsonObject(with: data, options: []) as! [String]
guard let jsonObject = try JSONSerialization.jsonObject(with: data, options: []) as? [String] else {
fatalError("Invalid JSON format: expected [String] in \(filename)")
}
return jsonObject
} catch {
fatalError("Could not find list file \(filename) at file \(file)")
}
Expand Down
4 changes: 2 additions & 2 deletions BrowserKit/Sources/MenuKit/MenuMainView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ public final class MenuMainView: UIView,

tableView.topAnchor.constraint(equalTo: accountHeaderView.bottomAnchor),
tableView.bottomAnchor.constraint(equalTo: self.bottomAnchor),
tableView.leadingAnchor.constraint(equalTo: self.leadingAnchor, constant: -UX.horizontalTableViewMargin),
tableView.trailingAnchor.constraint(equalTo: self.trailingAnchor, constant: UX.horizontalTableViewMargin)
tableView.leadingAnchor.constraint(equalTo: self.leadingAnchor),
tableView.trailingAnchor.constraint(equalTo: self.trailingAnchor)
])
}

Expand Down
12 changes: 9 additions & 3 deletions BrowserKit/Sources/MenuKit/MenuTableView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ class MenuTableView: UIView,
ThemeApplicable {
private struct UX {
static let topPadding: CGFloat = 12
static let tableViewMargin: CGFloat = 16
static let distanceBetweenSections: CGFloat = 32
}

private var tableView: UITableView
Expand All @@ -26,6 +28,8 @@ class MenuTableView: UIView,

override init(frame: CGRect) {
tableView = UITableView(frame: .zero, style: .insetGrouped)
tableView.layoutMargins = UIEdgeInsets(top: 0, left: UX.tableViewMargin, bottom: 0, right: UX.tableViewMargin)
tableView.sectionFooterHeight = 0
menuData = []
super.init(frame: .zero)
setupView()
Expand Down Expand Up @@ -70,7 +74,7 @@ class MenuTableView: UIView,
_ tableView: UITableView,
heightForHeaderInSection section: Int
) -> CGFloat {
return section == 0 ? UX.topPadding : UITableView.automaticDimension
return section == 0 ? UX.topPadding : UX.distanceBetweenSections
}

func tableView(
Expand All @@ -84,10 +88,12 @@ class MenuTableView: UIView,
_ tableView: UITableView,
cellForRowAt indexPath: IndexPath
) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(
guard let cell = tableView.dequeueReusableCell(
withIdentifier: MenuCell.cellIdentifier,
for: indexPath
) as! MenuCell
) as? MenuCell else {
return UITableViewCell()
}

cell.configureCellWith(model: menuData[indexPath.section].options[indexPath.row])
if let theme { cell.applyTheme(theme: theme) }
Expand Down
Loading

0 comments on commit 424f0e8

Please sign in to comment.