Fix make gitlab-shell-asdf-install
What does this merge request do and why?
Problem
make gitlab-shell-asdf-install
tries to use ASDF_DEFAULT_TOOL_VERSIONS_FILENAME
to install gitlab-shell
's dependencies, but it doesn't work properly (at least, the following is what I experienced).
For example, if:
-
gitlab-shell/.tool-versions
containsgolang 1.21.6
- and you have
golang 1.21.5
installed - but you do not have
golang 1.21.6
- and you see these warnings during
gdk update
:Notice: Behaving like ASDF_GOLANG_MOD_VERSION_ENABLED=true In the future this will have to be set to continue reading from the go.mod and go.work files
- then
make gitlab-shell-asdf-install
will not installgolang 1.21.6
. Instead it will saygolang 1.21.5 is already installed
.
Possible fixes
It turns out ASDF_DEFAULT_TOOL_VERSIONS_FILENAME
must be a filename, not a file path.
The simplest code would be to remove the usage of ASDF_DEFAULT_TOOL_VERSIONS_FILENAME
completely, since that would cause make gitlab-shell-asdf-install
to install the versions specified in gitlab-shell/.tool-versions
. But it would also install other dependencies specified in gdk-directory/.tool-versions
, such as minio, nodejs, postgres, etc.
If we want make gitlab-shell-asdf-install
to install only the gitlab-shell/.tool-versions
tools, then that is what this MR does. I prefer the simple code, but I submit this MR because it fixes the apparent intended behavior. So please LMK if excluding ancestor .tool-versions
is unnecessary.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
-
Check out to this merge request's branch.
-
Uninstall a tool version which is specified in
<your-gdk-dir>/gitlab-shell/.tool-versions
, e.g.asdf uninstall golang 1.21.6
-
Install a prior tool version if you don't already have one, e.g.
asdf install golang 1.21.5
-
make gitlab-shell-asdf-install
-
It should install
golang 1.21.6
Platform 'darwin' supported! % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 62.1M 100 62.1M 0 0 25.3M 0 0:00:02 0:00:02 --:--:-- 25.3M % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 64 100 64 0 0 308 0 --:--:-- --:--:-- --:--:-- 309 verifying checksum /Users/mkozonogitlab/.asdf/downloads/golang/1.21.6/archive.tar.gz: OK checksum verified
As opposed to main
branch, which for me the above steps result in golang 1.21.5 is already installed
.
Impacted categories
The following categories relate to this merge request:
-
gdk-reliability - e.g. When a GDK action fails to complete. -
gdk-usability - e.g. Improvements or suggestions around how the GDK functions. -
gdk-performance - e.g. When a GDK action is slow or times out.
Merge request checklist
-
This change is backward compatible. If not, please include steps to communicate to our users. -
Tests added for new functionality. If not, please raise an issue to follow-up. -
Documentation added/updated, if needed. -
Announcement added, if change is notable. -
gdk doctor
test added, if needed. -
Add the ~highlight
label if this MR should be included in theCHANGELOG.md
.