-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: create script to download and then execute local binary tools #1
Conversation
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.
I couldn't find it in the notion or readme What is the version update strategy like for tools (swift lint etc)? e.g. where does the binny-tools.yml
live?
EDIT: Found in another PR for readme.
const downloadedZipFilePath = `/tmp/${tool.name}_${tool.version}.zip`; // We save the tool into the /tmp directory as we do not need it after we unzip the file. | ||
|
||
// download zip file into the /tmp directory | ||
const response = await fetch(downloadZipUrl); |
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.
Whats the strategy if this network call fails/times out and it doesn't return in success? should we have exception handling?
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.
Because this tool is only used as an internal tool at the moment and I believe that network request errors would be rare, I decided to put in less error handling into the tool, such as this scenario.
Therefore, at this time, if a network connection fails the tool will throw an exception and display the stacktrace in the terminal.
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.
As long as this doesn't hurt us while working with CI, I honestly hate CI failing us because of some issues and then coming back to it and fixing it. But yeah not a blocker at all.
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.
That is a good point. I also want the CI to be stable while using this tool.
I see it being a rare occurrence for the CI to encounter failures for this line of code. Especially because the CI running on GitHub servers is downloading .zip files from GitHub, even more rare.
If you have any scenarios that you can think of on the CI that would make this script fail often, please share it as I would consider that a bug.
const downloadedZipFilePath = `/tmp/${tool.name}_${tool.version}.zip`; // We save the tool into the /tmp directory as we do not need it after we unzip the file. | ||
|
||
// download zip file into the /tmp directory | ||
const response = await fetch(downloadZipUrl); |
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.
As long as this doesn't hurt us while working with CI, I honestly hate CI failing us because of some issues and then coming back to it and fixing it. But yeah not a blocker at all.
TL;DR - this is a tool as part of fall cleaning. It fixes a problem our iOS SDK has where all mobile engineers and CI server uses different versions of tools such as
swiftlint
,swiftformat
, andsourcery
. When computers are on different versions of these tools, PRs are harder to review and weird linting errors can occur. This tool is a way to make sure that everyone is on the same hard-coded version of each tool. Bonus: The tool actually installs and updates all of these tools for you meaning that setup of our SDK development environment is simplified!This PR contains the code for a new tool to use in the iOS SDK as described in the fall cleaning project description.
The script contains some comments at the top of the file and this readme PR also explains the tool in more detail.
Why is this project inside of it's own github repo instead of the iOS SDK repo?