Repository navigation
feat(install-script): add optional version flag - #550
Conversation
dsilbergleithcu-godaddy
left a comment
There was a problem hiding this comment.
This meets the needs of our project. Nice work @jkelley-godaddy
|
Fixed the shellcheck errors and reverted a change that attempted to name the binary in I believe this should now pass all automated checks. |
dannyvassallo
left a comment
There was a problem hiding this comment.
Looks great - thanks for the contribution!
|
This looks awesome, thanks for the contribution! |
|
@jkelley-godaddy Hey, just checking in if you want me to merge it for you? |
|
Yes please. I am not authorized to merge and it appears everything is in order. Thank you for your assistance! |
* feat(install-script): add optional version flag * Shellcheck fixes * revert release tar and dir suffix to -latest
Description of changes:
Adds optional version flag to install script.
We are looking to pin a specific version to ensure that we do not encounter unexpected breaking changes during a major version upgrade. The existing install script works well for our team (we use OSX and Ubuntu via WSL) except we cannot specify a version during installation.
This change would allow users to optionally specify a version while running the installation while being backwards compatible. If a version is not specified the script defaults to the latest version which is the current behavior.
It appears specifying the version during installation may have been possible in the past as indicated by this portion of the installation instructions in the README:
(change version=X for other versions)- howeverversion=Xis no longer present in the current command.Alternative solutions:
The ideal solution for us would be an asdf plugin. We use mise as our tool manager which is asdf compatible. This has the following benefits over the bash script:
However the development/maintenance of a full asdf plugin does not currently make sense when we can achieve the majority of the benefit with a small modification to the existing installation script.
If someone else would like create an asdf plugin and close this pull request I would welcome that contribution :)
We did try building using rust/cargo however this requires 70 seconds to complete every CICD run versus 2 seconds to use the script that gets the release binary, making it too time expensive to be viable.
Additionally we are aware of the pre-commit hooks for Guard unfortunately these are not part of our current local/CICD workflow but may be an excellent option for other teams.
Testing done:
It appears there is already a test for the default case in the pr.yml GitHub actions workflow. If desired the following test could be prepended ahead of the current one to test installation of a known good version in CICD:
Tested the following scenarios manually:
No version flag specified - defaults to latest (backwards compatible):
Version specified as a valid semver:
Version specified as an invalid version:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license