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

Add Omaha config IDs to configurator. #4401

Open
wants to merge 3 commits into
base: 25.lts.1+
Choose a base branch
from

Conversation

yjzhang111
Copy link
Contributor

b/277111513

b/277111513

Change-Id: I01875374a777f245f7a8e4e802180fa0cec9e458
@yjzhang111 yjzhang111 force-pushed the add_app_id branch 4 times, most recently from 7719a88 to 9730642 Compare November 10, 2024 09:52
…nels.

Change-Id: Ic0f6877b0233d0d21dee2e8586ba6191735842d1
}
return kOmahaCobaltTrunkAppID;
// Should not reach here.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to comment to:

// Requests with other SB versions go to the legacy config.

chrome/updater/configurator.cc Outdated Show resolved Hide resolved
}
LOG(INFO) << "Configurator::GetAppGuidHelper updater channel and starboard combination is invalid.";

// All invalid channel requests get updates from prod config.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// All undefined channel requests go to prod configs.

chrome/updater/configurator_test.cc Outdated Show resolved Hide resolved
chrome/updater/configurator.cc Show resolved Hide resolved
return kOmahaCobaltTrunkAppID;
}
std::string channel(updater_channel);
if (std::regex_match(updater_channel, std::regex("2[5-9]lts\\d+"))) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if std::regex("\d+lts\d+") is more future proof.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also add a comment explaining what are you trying to match

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a comment and changed to "\d+lts\d+", but I was wondering if it needs to be future proof.

I was going to use "25lts\d+" since we don't expect Chrobalt to be compatible with SB14-16. These configs will only be used for C25. Given we don't know when we will ship Chrobalt, I used "2[5-9]lts\d+", but these should really just be used by C25.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The static channels should work universally even when setting a device to an older static channel. For example, if a device is running 25lts20 with this code, setting its channel to 24lts10 should work. This means the regex here should match all static channels, and the new config should contain cohorts and rules of all applicable static channels for the specific SB verison.

Change-Id: I1906666e09fe26db94db52e9dc8e6e6e85a91209
{"tseries214", "{7CB65840-5FA4-4706-BC9E-86A89A56B4E0}"},
{"tseries215", "{7CCA7DB3-C27D-4CEB-B6A5-50A4D6DE40DA}"},
{"tseries216", "{012BF4F5-8463-490F-B6C8-E9B64D972152}"},
};
const char kOmahaCobaltAppID[] = "{6D4E53F3-CC64-4CB8-B6BD-AB0B8F300E1C}";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: kOmahaCobaltAppID, kOmahaCobaltTrunkAppID and kOmahaCobaltLTSNightlyAppID can be moved to utils and shared. kOmahaCobaltProdSb15AppID and kOmahaCobaltProdSb14AppID can be removed and accessed by the same method in configurator.cc.

return kOmahaCobaltTrunkAppID;
}
std::string channel(updater_channel);
if (std::regex_match(updater_channel, std::regex("2[5-9]lts\\d+"))) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The static channels should work universally even when setting a device to an older static channel. For example, if a device is running 25lts20 with this code, setting its channel to 24lts10 should work. This means the regex here should match all static channels, and the new config should contain cohorts and rules of all applicable static channels for the specific SB verison.

@@ -318,26 +273,29 @@ std::string Configurator::GetAppGuidHelper(const std::string& updater_channel,
return kOmahaCobaltTrunkAppID;
}
std::string channel(updater_channel);
if (std::regex_match(updater_channel, std::regex("2[5-9]lts\\d+"))) {
// This regex matches to all static channels in the format of XXltsX.
if (std::regex_match(updater_channel, std::regex("\\dlts\\d+"))) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A '+' is missed. It should be std::regex("\d+lts\d+")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants