Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Feat/support default casdownloader and config path#1790

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
frankfeng579 wants to merge13 commits intogoogle:main
base:main
Choose a base branch
Loading
fromfrankfeng579:feat/support-default-casdownloader-and-config-path

Conversation

@frankfeng579
Copy link
Collaborator

Add support for default path for casdownloader and its config file
Change CasDownloader::DownloadFile() to accept DeviceBuild as argument, which contains more info
Support casdownloader flag invocation-id, allows troubleshooting of CAS downloading traffic issues
Log the cause for disabling CAS when CasDownloader::Create fails

@frankfeng579frankfeng579force-pushed thefeat/support-default-casdownloader-and-config-path branch 3 times, most recently from74fec40 to4ae2955CompareNovember 13, 2025 23:29
@frankfeng579frankfeng579force-pushed thefeat/support-default-casdownloader-and-config-path branch from4ae2955 to44b9708CompareNovember 16, 2025 23:48
@frankfeng579frankfeng579force-pushed thefeat/support-default-casdownloader-and-config-path branch from2d47138 toe5d59f7CompareNovember 18, 2025 01:48
@frankfeng579frankfeng579force-pushed thefeat/support-default-casdownloader-and-config-path branch frome5d59f7 todf06c11CompareNovember 18, 2025 17:33
template<typename T>
classFlagValue {
public:
FlagValue() : default_value_{} {}
Copy link
Member

Choose a reason for hiding this comment

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

Don't provide a default constructor if it's not needed. Without it, if you add a new flag toCasDownloaderFlags but forget to initialize it in the constructor with a default value you'll get a compiler error; otherwise it will just use the default constructor.

FlagValue() : default_value_{} {}
explicitFlagValue(const T& default_value) : default_value_(default_value) {}

// Return by value to avoid dangling references.
Copy link
Member

Choose a reason for hiding this comment

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

It should be ok to returnconst T&. Using that returned reference in a way that causes issues would also cause issues when returning by value. In most cases the returned reference will be use to copy-construct a new variable, but in cases like this the copy-constructor is avoided:

void dosomething(const std::string& str) {...}...dosomething(my_string_flag.value());

// disabled and why, using the same environment-aware formatting that
// test helpers use.
LOG(INFO) <<"CAS downloading disabled:" << result.error().FormatForEnv();
returnandroid::base::unexpected(std::move(result).error());
Copy link
Member

Choose a reason for hiding this comment

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

Can this just bereturn result;?

// invocation-id flag. Do this only if the invocation-id flag is already
// present and contains `caller` only.
for (auto& flag : cas_flags) {
if (flag.find("-invocation-id=caller=") ==0 &&
Copy link
Member

Choose a reason for hiding this comment

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

nit: Useabsl::StartsWith

Comment on lines +31 to +33
boolDefaultConfigPathExists() {
returnFileExists(std::string(kDefaultCasConfigFilePath));
}
Copy link
Member

Choose a reason for hiding this comment

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

Delete unused function

flags1.cache_dir.set_value("/cache/dir");

// Verify flags2 is not affected
if (DefaultDownloaderPathExists()) {
Copy link
Member

Choose a reason for hiding this comment

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

This test is not hermetic. Consider asserting thatflgas2.downloader_path.value() != flags1.downloader_path.value() instead and deleteDefaultDownloaderPathExists.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@jemoreirajemoreirajemoreira requested changes

Requested changes must be addressed to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@frankfeng579@jemoreira

[8]ページ先頭

©2009-2025 Movatter.jp