-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Protect sdk upload script from missing ndk, add documentation for checking write access, improve comments to add context #47989
Conversation
…cking write access, improve comments to add context
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie or stuartmorgan on the #hackers channel in Chat (don't just cc them here, they won't see it! Use Discord!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
This pull request is not mergeable in its current state, likely because of a merge conflict. Pre-submit CI jobs were not triggered. Pushing a new commit to this branch that resolves the issue will result in pre-submit jobs being scheduled. |
echo "Failure to bundle ndk for platform" | ||
exit 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't these lines be indented?
btw I wonder if running shellcheck would make sense in Flutter's repos.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, if you wanted to add shellcheck I am not opposed. I will say that we (the broader fluter team) have agreed to move from shell scripts like this to dart scripts. Thanks for the catch, this is fixed.
test-exempt: The current structure of the script (a bash script that does both upload and download) makes it very difficult to test without a complete rewrite, and the team consensus is that the value of such a rewrite is currently too low for the benefits given that this is for an infrequent manual process that already has failsafes later in the process. |
@@ -26,13 +27,13 @@ print_usage () { | |||
echo "and should only be run on linux or macos hosts." | |||
} | |||
|
|||
# Validate version is provided | |||
# Validate version or argument is provided. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The following code would read better if you copied $1 into a named variable:
VERSION_TAG=$1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Named first argument since sometimes that is a version and sometimes it is an argument (which is confusing) but at least the variable hints at the truth.
@@ -54,6 +55,8 @@ if [[ ! -d "$sdk_path" ]]; then | |||
print_usage | |||
exit 1 | |||
fi | |||
|
|||
# Validate caller has cipd. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about changing the comment to:
Validate environment has cipd installed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. I like that more.
@@ -15,6 +15,7 @@ print_usage () { | |||
echo "" | |||
echo "This script downloads the packages specified in packages.txt and uploads" | |||
echo "them to CIPD for linux, mac, and windows." | |||
echo "To confirm you have write permissions run 'cipd acl-check flutter/android/sdk/all/ -writer'." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be done as part of this script?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can but honestly given we dont have a dry run. One of the only(and easy) ways to verify what is about to be uploaded is to comment out the rm -rf $upload_dir
and the upload command and see what is about to be uploaded. Adding that check would add another piece of code to comment out. I added this documentation so that when I come back to do flutter/flutter#138021 I know what is required to warn on missing permissions. But in a dry run we would continue anyway since the user is not trying to upload.
…on for checking write access, improve comments to add context (flutter/engine#47989)
…138751) flutter/engine@2158531...337ab58 2023-11-20 reidbaker@google.com Protect sdk upload script from missing ndk, add documentation for checking write access, improve comments to add context (flutter/engine#47989) 2023-11-20 skia-flutter-autoroll@skia.org Roll Dart SDK from 09bd5d71062d to ee7aaca9adcc (1 revision) (flutter/engine#48237) 2023-11-20 skia-flutter-autoroll@skia.org Roll Skia from 151d297efcf5 to 69213ba6f68a (2 revisions) (flutter/engine#48236) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC jonahwilliams@google.com,rmistry@google.com,zra@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Script used to upload 34v7 with ndk 26.1.10909125
Added documentation for how to check for write access before running script.
Added documentation for why the ndk is in a non standard location.
Protected against silent ndk failure caused by a failure to download ndk on m1 macs #47609 (comment)
Clean up os override so that script does not dirty the environment variables in a shell where it is run.
See flutter/flutter#117973 for more detail on why a newer ndk is required.
Pre-launch Checklist
///
).