You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 28, 2023. It is now read-only.
This is a suggestion / feature request to simplify get-tce-release.sh script
I'm looking at -
Reducing
Complexity - Currently the script is 68 lines long. We do a lot of processing in it and use a lot of tools
Maintenance - I know this is most probably a one time script that we most probably don't have to modify, unless GitHub removes the API that we use. In any case, this is something we might to maintain if we use it, for example I notice it being mentioned in the docs - https://quirky-franklin-8969be.netlify.app/docs/latest/cli-installation/
Currently the complexity and maintenance mostly is due to the fact that TCE is a private repo and hence we have to use GitHub APIs and can't use direct download URLs available on releases page like public repos, for example https://github.com/vmware-tanzu/community-edition/releases/download/v0.7.0/tce-linux-amd64-v0.7.0.tar.gz then it's easy to just use curl along with that link. But looks like we want to support ability to install any asset with just the substring looking at this code, so that looks like we want to support this even after public launch. Also, all the error messages that we show for tag not present
Maybe one thing that might change after public launch is - removal of the need for a token, and we can validate most things with just https://github.com URLs instead of the API with API token. Or we could just use the API without the API token, as it will be a public repo after launch and GitHub APIs can work to a good extent (with acceptable rate limits) without API tokens for public resources
If we think this script is going to be used for quite sometime (till public launch or even beyond) and will be used many times and if we are looking for improvements, some things I can think of are -
Improving
Fault tolerance - Currently the script relies on many tools which will mostly be present, except maybe jq, which we don't install as part of the script
Simplicity - Lots of lines of code to download a tar ball from a private repo. Lots of lines looks like a complex thing, to read and understand and also modify in the future
We have to install an extra tool. We have to install fetch probably locally in some ~/.bin like directory and invoke it from that path like ~/.bin/fetch ...
We may not get the error messages / the custom error messages / exact error messages from fetch like we get from get-tce-release.sh script regarding token not valid, wrong release tag input, wrong asset name input. I need to check more on this though
I just wanted to bring it up to mention that we can delegate the feature to something like fetch instead of writing and maintaining our own code
Feature Request
This is a suggestion / feature request to simplify get-tce-release.sh script
I'm looking at -
Reducing
Currently the complexity and maintenance mostly is due to the fact that TCE is a private repo and hence we have to use GitHub APIs and can't use direct download URLs available on releases page like public repos, for example https://github.com/vmware-tanzu/community-edition/releases/download/v0.7.0/tce-linux-amd64-v0.7.0.tar.gz then it's easy to just use
curl
along with that link. But looks like we want to support ability to install any asset with just the substring looking at this code, so that looks like we want to support this even after public launch. Also, all the error messages that we show for tag not presentMaybe one thing that might change after public launch is - removal of the need for a token, and we can validate most things with just https://github.com URLs instead of the API with API token. Or we could just use the API without the API token, as it will be a public repo after launch and GitHub APIs can work to a good extent (with acceptable rate limits) without API tokens for public resources
If we think this script is going to be used for quite sometime (till public launch or even beyond) and will be used many times and if we are looking for improvements, some things I can think of are -
Improving
jq
, which we don't install as part of the scriptThe alternative I thought was - using something like fetch tool, which can download from private repos. I tried it out and it worked pretty well. Just a few lines of code - https://github.com/karuppiah7890/tce/blob/tce-release-bin-install/test/fetch-and-install-tce-release.sh#L52-L56
But yeah, it comes with tradeoffs
fetch
probably locally in some~/.bin
like directory and invoke it from that path like~/.bin/fetch ...
fetch
like we get from get-tce-release.sh script regarding token not valid, wrong release tag input, wrong asset name input. I need to check more on this thoughI just wanted to bring it up to mention that we can delegate the feature to something like
fetch
instead of writing and maintaining our own codeDescribe alternatives you've considered
Keep using get-tce-release.sh script
The text was updated successfully, but these errors were encountered: