Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Glean to v63.0.0 #6521

Merged
merged 3 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@

[Full Changelog](In progress)

## 🦊 What's Changed 🦊

### Glean
- Updated to v63.0.0 ([bug 1933939](https://bugzilla.mozilla.org/show_bug.cgi?id=1933939))

# v134.0 (_2023-11-25_)

## ✨ What's New ✨
Expand Down
2 changes: 1 addition & 1 deletion components/external/glean
Submodule glean updated 118 files
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package mozilla.appservices.syncmanager

import androidx.test.core.app.ApplicationProvider
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.work.testing.WorkManagerTestInitHelper
import mozilla.appservices.sync15.EngineInfo
import mozilla.appservices.sync15.FailureName
import mozilla.appservices.sync15.FailureReason
Expand All @@ -15,15 +16,16 @@ import mozilla.appservices.sync15.ProblemInfo
import mozilla.appservices.sync15.SyncInfo
import mozilla.appservices.sync15.SyncTelemetryPing
import mozilla.appservices.sync15.ValidationInfo
import mozilla.telemetry.glean.testing.GleanTestRule
import mozilla.telemetry.glean.Glean
import mozilla.telemetry.glean.config.Configuration
import org.junit.After
import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.Assert.assertNotNull
import org.junit.Assert.assertNull
import org.junit.Assert.assertTrue
import org.junit.Assert.fail
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
import org.mozilla.appservices.syncmanager.GleanMetrics.Pings
Expand All @@ -40,16 +42,39 @@ private fun Date.asSeconds() = time / BaseGleanSyncPing.MILLIS_PER_SEC
@RunWith(AndroidJUnit4::class)
@Suppress("LargeClass")
class SyncTelemetryTest {
@get:Rule
val gleanRule = GleanTestRule(ApplicationProvider.getApplicationContext())

private var now: Long = 0
private var pingCount = 0

@Before
fun setup() {
now = Date().asSeconds()
pingCount = 0

// Due to recent changes in how upload enabled works, we need to register the custom
// Sync pings before resetting Glean manually so they can be submitted properly. This
// replaces the use of the GleanTestRule until it can be updated to better support testing
// custom pings in libraries.
Glean.registerPings(Pings.sync)
Glean.registerPings(Pings.historySync)
Glean.registerPings(Pings.bookmarksSync)
Glean.registerPings(Pings.loginsSync)
Glean.registerPings(Pings.creditcardsSync)
Glean.registerPings(Pings.addressesSync)
Glean.registerPings(Pings.tabsSync)

// Glean will crash in tests without this line when not using the GleanTestRule.
WorkManagerTestInitHelper.initializeTestWorkManager(ApplicationProvider.getApplicationContext())
Glean.resetGlean(
context = ApplicationProvider.getApplicationContext(),
config = Configuration(),
clearStores = true,
)
}

@After
fun tearDown() {
// This closes the WorkManager database to help prevent leaking it during tests.
WorkManagerTestInitHelper.closeWorkDatabase()
}

@Test
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ kotlinx-coroutines = "1.8.0"

# Mozilla
android-components = "133.0"
glean = "62.0.0"
glean = "63.0.0"
rust-android-gradle = "0.9.4"

# AndroidX
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -980,7 +980,7 @@
repositoryURL = "https://github.com/mozilla/glean-swift";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 62.0.0;
minimumVersion = 63.0.0;
};
};
/* End XCRemoteSwiftPackageReference section */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{
"originHash" : "94dc6b186acfc4720adc0bbb95f712b86bc82988e2b0c0a85e65eb1ae9a4af4c",
"pins" : [
{
"identity" : "glean-swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/mozilla/glean-swift",
"state" : {
"revision" : "5c614b4af5a1f1ffe23b46bd03696086d8ce9d0d",
"version" : "62.0.0"
"revision" : "be4fbca81f9e1da5f9b91e8bd245a8dee53cc57f",
"version" : "63.0.0"
}
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,18 @@ import XCTest

class NimbusTests: XCTestCase {
override func setUp() {
// Due to recent changes in how upload enabled works, we need to register the custom
// Sync pings before they can collect data in tests, even here in Nimbus unfortunately.
// See https://bugzilla.mozilla.org/show_bug.cgi?id=1935001 for more info.
Glean.shared.registerPings(GleanMetrics.Pings.shared.sync)
Glean.shared.registerPings(GleanMetrics.Pings.shared.historySync)
Glean.shared.registerPings(GleanMetrics.Pings.shared.bookmarksSync)
Glean.shared.registerPings(GleanMetrics.Pings.shared.loginsSync)
Glean.shared.registerPings(GleanMetrics.Pings.shared.creditcardsSync)
Glean.shared.registerPings(GleanMetrics.Pings.shared.addressesSync)
Glean.shared.registerPings(GleanMetrics.Pings.shared.tabsSync)

Glean.shared.resetGlean(clearStores: true)
Glean.shared.enableTestingMode()
}

func emptyExperimentJSON() -> String {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,20 @@ class SyncManagerTelemetryTests: XCTestCase {

override func setUp() {
super.setUp()

// Due to recent changes in how upload enabled works, we need to register the custom
// Sync pings before they can collect data in tests.
// See https://bugzilla.mozilla.org/show_bug.cgi?id=1935001 for more info.
Glean.shared.registerPings(GleanMetrics.Pings.shared.sync)
Glean.shared.registerPings(GleanMetrics.Pings.shared.historySync)
Glean.shared.registerPings(GleanMetrics.Pings.shared.bookmarksSync)
Glean.shared.registerPings(GleanMetrics.Pings.shared.loginsSync)
Glean.shared.registerPings(GleanMetrics.Pings.shared.creditcardsSync)
Glean.shared.registerPings(GleanMetrics.Pings.shared.addressesSync)
Glean.shared.registerPings(GleanMetrics.Pings.shared.tabsSync)

Glean.shared.resetGlean(clearStores: true)
Glean.shared.enableTestingMode()

now = Int64(Date().timeIntervalSince1970) / BaseGleanSyncPing.MILLIS_PER_SEC
}

Expand Down