Skip to content

feat: set the CI_SERVER_SHELL_SSH_HOST predefined variable - #1975

Merged
firecow merged 1 commit into
firecow:masterfrom
cristianchiriac:add-ci-server-shell-ssh-host
Oct 24, 2026
Merged

firecow merged 1 commit into
firecow:masterfrom
cristianchiriac:add-ci-server-shell-ssh-host

Conversation

@cristianchiriac

@cristianchiriac cristianchiriac commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1972.

GitLab defines CI_SERVER_SHELL_SSH_HOST, the SSH host of the instance for Git access, next to CI_SERVER_SHELL_SSH_PORT. gitlab-ci-local only defined the port, so scripts that clone with git@$CI_SERVER_SHELL_SSH_HOST:... got an empty host.

CI_SERVER_SHELL_SSH_HOST now defaults to CI_SERVER_HOST, which is also GitLab's value unless a separate SSH host is configured. Like the other CI_SERVER_* variables, it can be overridden with --variable or a variables file.

Tests:

  • Added CI_SERVER_SHELL_SSH_HOST: "gitlab.com" to the expected variables in tests/test-cases/predefined-variables/integration.test.ts. I couldn't run that suite locally: the shell executor needs rsync, which isn't available on my Windows machine, so I'm relying on CI for it.
  • Called init() from predefined-variables.ts directly, with an SSH remote on gitlab.example.com:2222:
    • no overrides: CI_SERVER_SHELL_SSH_HOST=gitlab.example.com
    • CI_SERVER_HOST=gitlab.internal: CI_SERVER_SHELL_SSH_HOST=gitlab.internal
    • CI_SERVER_SHELL_SSH_HOST=ssh.gitlab.example.com: that value, with CI_SERVER_HOST unchanged
  • eslint and tsc --noEmit are clean.

Summary by cubic

Defines the CI_SERVER_SHELL_SSH_HOST predefined variable so scripts that clone with git@$CI_SERVER_SHELL_SSH_HOST no longer get an empty host.

  • The variable defaults to CI_SERVER_HOST, matching GitLab's behavior unless a separate SSH host is configured, and can be overridden with --variable or a variables file.
  • Updates the predefined-variables integration test to expect the new variable.

Closes #1972.

Written for commit d761277. Summary will update on new commits.

View guided diff

GitLab provides CI_SERVER_SHELL_SSH_HOST (the SSH host for Git access)
next to CI_SERVER_SHELL_SSH_PORT, but gitlab-ci-local didn't define it,
so scripts cloning with git@$CI_SERVER_SHELL_SSH_HOST failed. Default
it to CI_SERVER_HOST; it can be overridden like the other CI_SERVER_*
variables.

Closes #1972

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

View guided diff | Re-trigger cubic

@firecow firecow left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@firecow
firecow merged commit 5738148 into firecow:master Oct 24, 2026
14 checks passed
rarean pushed a commit to rarean/gitlab-ci-local that referenced this pull request Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

the Variable CI_SERVER_SHELL_SSH_HOST should be set too

3 participants