Skip to content

Conversation

@yjbanov
Copy link
Contributor

@yjbanov yjbanov commented Nov 24, 2021

Allow customizing the base CIPD URL via FLUTTER_STORAGE_BASE_URL as follows:

This way maintainers of Flutter SDK artifact mirrors can include some of the CIPD packages that are needed to build for some platforms. For example, this can be used to mirror the build of CanvasKit.

Fixes #92357

@flutter-dashboard flutter-dashboard bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Nov 24, 2021
@google-cla google-cla bot added the cla: yes label Nov 24, 2021
@AlexV525
Copy link
Member

cc @chenglu

Copy link
Member

@chenglu chenglu left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for doing this! 👍👍

String get cipdBaseUrl {
final String? overrideUrl = _platform.environment['FLUTTER_STORAGE_BASE_URL'];
if (overrideUrl == null) {
return 'https://chrome-infra-packages.appspot.com/dl';
Copy link
Member

Choose a reason for hiding this comment

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

We already defined a hidden CIPD base URL here:

const String _cipdBaseUrl = 'https://chrome-infra-packages.appspot.com/dl';

Should we hard-code this again?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am removing this constant in this PR so that people do not accidentally use it in the future. Of course, the bar to make this mistake is still not very high (anyone can just create a new constant), but at least making it a local constant doesn't make it easily accessible. Actually, now that I think of it, I should probably leave a comment warning people about this.

Copy link
Member

Choose a reason for hiding this comment

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

So it seems we should have a policy about this in the future? URLs can be easily introduced, but the mistake can be avoided most time with guidance.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure how to make a policy such that it's effective. A policy is just a document somewhere that someone has to read, preferably before they start making changes to the code. Maybe such document exists already, and I didn't read it. I would be more likely to read a comment in the code, although that's still not bullet proof.

I'll delegate to @christopherfujino, who is the tech lead for the tool, to decide if a policy can help here.

Copy link
Member

@AlexV525 AlexV525 Nov 24, 2021

Choose a reason for hiding this comment

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

Agreed with a lower priority.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'll update a doc about it, but agreed, the "policy" can only be enforced in code review. We did not have a policy banning this before, because we had not considered the effect on users in China. AFAIK, the only previous usage of this CIPD hack was for Fuchsia-related assets, which I'm guessing did not have many/any Chinese users.

@fluttergithubbot fluttergithubbot merged commit a2a888e into flutter:master Nov 24, 2021
godofredoc added a commit that referenced this pull request Dec 1, 2021
…94490)

* make CIPD url customizable using FLUTTER_STORAGE_BASE_URL (#94137)

* 'Update Engine revision to 06a7363 for beta release 2.8.0-3.3.pre'

* Update plugin lint test for federated url_launcher plugin (#94374)

Co-authored-by: Yegor <yjbanov@google.com>
Co-authored-by: Jenn Magder <magder@google.com>
ryanawhelan pushed a commit to ryanawhelan/flutter that referenced this pull request Jan 13, 2022
…lutter#94490)

* make CIPD url customizable using FLUTTER_STORAGE_BASE_URL (flutter#94137)

* 'Update Engine revision to 06a7363 for beta release 2.8.0-3.3.pre'

* Update plugin lint test for federated url_launcher plugin (flutter#94374)

Co-authored-by: Yegor <yjbanov@google.com>
Co-authored-by: Jenn Magder <magder@google.com>
xkeyC added a commit to xkeyC/proxy2pub that referenced this pull request Mar 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chrome-infra-packages.appspot.com is not accessible in China

5 participants