Brand Omaha 4 for production (#31849)

This commit is contained in:
Michael Herrmann
2025-10-17 08:25:51 +01:00
committed by GitHub
parent c8a5da454f
commit 93059f6d18
7 changed files with 21 additions and 29 deletions
+1 -1
View File
@@ -98,7 +98,7 @@ hooks = [
'pattern': '.',
'condition': 'checkout_mac',
'action': ['vpython3', 'build/download_dep.py',
'omaha4/BraveUpdater-141.1.84.102.zip',
'omaha4/BraveUpdater-141.1.85.63.zip',
'//brave/third_party/updater/mac',
'BraveUpdater.app/'],
},
+7 -7
View File
@@ -669,13 +669,13 @@ constexpr flags_ui::FeatureEntry::Choice kVerticalTabCollapseDelayChoices[] = {
#endif
#if BUILDFLAG(ENABLE_OMAHA4)
#define BRAVE_UPDATER_FEATURE_ENTRIES \
EXPAND_FEATURE_ENTRIES({ \
"brave-use-omaha4-alpha", \
"Use Omaha 4 Alpha", \
"Use the new automatic update system", \
kOsMac, \
FEATURE_VALUE_TYPE(brave_updater::kBraveUseOmaha4Alpha), \
#define BRAVE_UPDATER_FEATURE_ENTRIES \
EXPAND_FEATURE_ENTRIES({ \
"brave-use-omaha4", \
"Use Omaha 4", \
"Use the new automatic update system", \
kOsMac, \
FEATURE_VALUE_TYPE(brave_updater::kBraveUseOmaha4), \
})
#else
#define BRAVE_UPDATER_FEATURE_ENTRIES
@@ -24,14 +24,13 @@ class BraveVersionUpdaterMacTest : public testing::Test {
};
TEST_F(BraveVersionUpdaterMacTest, UsesSparkleWhenFeatureDisabled) {
scoped_feature_list_.InitAndDisableFeature(
brave_updater::kBraveUseOmaha4Alpha);
scoped_feature_list_.InitAndDisableFeature(brave_updater::kBraveUseOmaha4);
EXPECT_TRUE(UsesSparkle());
}
TEST_F(BraveVersionUpdaterMacTest, UsesOmaha4WhenFeatureEnabled) {
scoped_feature_list_.InitAndEnableFeatureWithParameters(
brave_updater::kBraveUseOmaha4Alpha,
brave_updater::kBraveUseOmaha4,
{{brave_updater::kLegacyFallbackIntervalDays.name,
base::NumberToString(INT_MAX)}});
EXPECT_FALSE(UsesSparkle());
+3 -10
View File
@@ -12,18 +12,11 @@
namespace brave_updater {
// DO NOT TURN THIS FEATURE ON IN PRODUCTION. As of this writing, it only
// implements the happy path of switching from Sparkle to Omaha 4 on macOS. It
// does not handle switching from Omaha 4 back to Sparkle. When you do enable
// the feature in the future, make sure that it is not enabled for any clients
// that suffer from the above limitations.
BASE_FEATURE(kBraveUseOmaha4Alpha,
"BraveUseOmaha4Alpha",
base::FEATURE_DISABLED_BY_DEFAULT);
BASE_FEATURE(kBraveUseOmaha4, base::FEATURE_DISABLED_BY_DEFAULT);
BASE_FEATURE_PARAM(int,
kLegacyFallbackIntervalDays,
&kBraveUseOmaha4Alpha,
&kBraveUseOmaha4,
"legacy-fallback-interval-days",
5);
@@ -45,7 +38,7 @@ bool ShouldUseOmaha4Impl(base::Time now, std::optional<bool>& state) {
if (days_since_null % legacy_fallback_interval_days == 0) {
state = false;
} else {
state = base::FeatureList::IsEnabled(kBraveUseOmaha4Alpha);
state = base::FeatureList::IsEnabled(kBraveUseOmaha4);
}
VLOG(1) << "Using Omaha 4: " << state.value();
}
+1 -1
View File
@@ -14,7 +14,7 @@
namespace brave_updater {
BASE_DECLARE_FEATURE(kBraveUseOmaha4Alpha);
BASE_DECLARE_FEATURE(kBraveUseOmaha4);
BASE_DECLARE_FEATURE_PARAM(int, kLegacyFallbackIntervalDays);
bool ShouldUseOmaha4();
+6 -6
View File
@@ -25,36 +25,36 @@ class ShouldUseOmaha4Test : public testing::Test {
};
TEST_F(ShouldUseOmaha4Test, ReturnsFalseWhenFeatureDisabled) {
scoped_feature_list_.InitAndDisableFeature(kBraveUseOmaha4Alpha);
scoped_feature_list_.InitAndDisableFeature(kBraveUseOmaha4);
EXPECT_FALSE(ShouldUseOmaha4(1));
}
TEST_F(ShouldUseOmaha4Test, ReturnsTrueWhenFeatureEnabled) {
scoped_feature_list_.InitAndEnableFeature(kBraveUseOmaha4Alpha);
scoped_feature_list_.InitAndEnableFeature(kBraveUseOmaha4);
EXPECT_TRUE(ShouldUseOmaha4(1));
}
TEST_F(ShouldUseOmaha4Test, LetsLegacyImplRunEvenWhenFeatureEnabled) {
scoped_feature_list_.InitAndEnableFeature(kBraveUseOmaha4Alpha);
scoped_feature_list_.InitAndEnableFeature(kBraveUseOmaha4);
EXPECT_FALSE(ShouldUseOmaha4(5));
}
TEST_F(ShouldUseOmaha4Test, StaysConstantWhenFeatureDisabled) {
scoped_feature_list_.InitAndDisableFeature(kBraveUseOmaha4Alpha);
scoped_feature_list_.InitAndDisableFeature(kBraveUseOmaha4);
for (int day = 1; day < 10; day++) {
EXPECT_FALSE(ShouldUseOmaha4(day));
}
}
TEST_F(ShouldUseOmaha4Test, StaysConstantWhenFeatureEnabled) {
scoped_feature_list_.InitAndEnableFeature(kBraveUseOmaha4Alpha);
scoped_feature_list_.InitAndEnableFeature(kBraveUseOmaha4);
for (int day = 1; day < 10; day++) {
EXPECT_TRUE(ShouldUseOmaha4(day));
}
}
TEST_F(ShouldUseOmaha4Test, StaysConstantWhenLegacyImplRuns) {
scoped_feature_list_.InitAndEnableFeature(kBraveUseOmaha4Alpha);
scoped_feature_list_.InitAndEnableFeature(kBraveUseOmaha4);
// Trigger the `% 5 == 0` case on day 0.
for (int day = 0; day < 10; day++) {
EXPECT_FALSE(ShouldUseOmaha4(day));
+1 -1
View File
@@ -93,6 +93,6 @@ brave_updater_branding = {
declare_args() {
# Omaha 4 update server:
update_check_url =
"https://updates.bravesoftware.com/non-stable/service/update2/json"
"https://updates.bravesoftware.com/prod/service/update2/json"
}
}