Add a GitLab branch option to the one-line install script
What does this merge request do and why?
gdk install accepts gitlab_branch since !5730 (merged), but the one-line installer support/install had no way to pass it. Users who want a specific GitLab branch from the start had to run gdk switch afterwards, which re-runs migrations and setup steps.
support/install now reads the branch from a fourth argument or the GITLAB_BRANCH environment variable and forwards it to gdk install as gitlab_branch. When neither is set, the gdk install arguments are exactly what they were before. An explicit argument wins over the environment variable, and an empty argument falls back to it.
curl "https://gitlab.com/gitlab-org/gitlab-development-kit/-/raw/main/support/install" | GITLAB_BRANCH=<branch-name> bashThe install command is now built as a bash array, so a branch name is passed as one argument.
Closes #3238 (closed)
How to set up and validate locally
- Run
bash -n support/install. - Run the installer with
GITLAB_BRANCH=<branch-name>set, and check that thegdk installcall includesgitlab_branch=<branch-name>. - Run it without the variable or fourth argument, and check that the call is unchanged.
Verification
bash -n support/install passes. I ran the argument handling in isolation, with the same expansion and array code as the script:
| Case | gdk install arguments |
|---|---|
| no argument, no variable | gitlab_repo, telemetry_enabled |
fourth argument feat/x |
adds gitlab_branch=feat/x |
GITLAB_BRANCH=env-branch only |
adds gitlab_branch=env-branch |
| argument and variable | argument wins |
| empty fourth argument and variable | variable is used |
branch a b |
one argument, gitlab_branch=a b |
unset variable under set -u |
no error |
I did not run a full install, and could not run shellcheck locally.
Impacted categories
- 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 MR references an issue describing the change.
- This change is backward compatible. If not, include steps to communicate to users.
- Tests added for new functionality. If not, raise an issue to follow-up. (
support/installhas no spec harness. Covered by the isolated check above.) - Observability added/updated (logging, metrics, tracing).
- Documentation added/updated.
- Announcement added for notable changes.
-
gdk doctortest added. - This contribution was prepared with the help of an AI assistant. I reviewed the changes and take responsibility for them.