Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: gitUrl global option #11221

Merged

Conversation

mbrandau
Copy link
Contributor

@mbrandau mbrandau commented Aug 11, 2021

Changes:

Added gitUrl as a global admin option. (as proposed in #5406 (comment)) Possible values:

  • default (or undefined) behaviour, which is to use http_url_to_repo
  • ssh, uses ssh_url_to_repo as URL for Git
  • endpoint, which means ignore those URLs and use the configured endpoint directly

Context:

Cloning over SSH does not work (closes #5406)
Allow bot admins to override the default resolution for git remote, e.g. to switch GitLab from HTTPS to SSH-based. (closes #9708)
Renovate stalling with self-hosted GitLab with git over HTTP #8488

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please tick one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

@HonkingGoose HonkingGoose requested review from viceice and rarkins and removed request for viceice August 11, 2021 19:39
Copy link
Member

@viceice viceice left a comment

Choose a reason for hiding this comment

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

Do not misuse hostrules. A better solution would to try to use ssh url if no http use is provided by gitlab. And if it's also not provided use old fallback.

Add a global admin option to force ssh if both are available.

@mbrandau mbrandau requested a review from viceice August 12, 2021 07:48
@mbrandau mbrandau changed the title feat: add useSsh hostRule option to use SSH urls for GitLab feat: add gitUrl as global admin option to configure which URL is used for Git Aug 12, 2021
lib/config/admin.ts Outdated Show resolved Hide resolved
lib/platform/gitlab/index.ts Show resolved Hide resolved
lib/platform/gitlab/index.ts Outdated Show resolved Hide resolved
@mbrandau mbrandau requested a review from viceice August 13, 2021 12:44
@mbrandau mbrandau requested a review from viceice August 17, 2021 08:50
docs/usage/self-hosted-experimental.md Outdated Show resolved Hide resolved
lib/config/options/index.ts Outdated Show resolved Hide resolved
@mbrandau mbrandau marked this pull request as ready for review August 18, 2021 13:41
@mbrandau mbrandau requested a review from viceice August 20, 2021 08:37
Copy link
Member

@viceice viceice left a comment

Choose a reason for hiding this comment

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

a small issue

lib/platform/gitlab/index.spec.ts Show resolved Hide resolved
@rarkins rarkins changed the title feat: add gitUrl as global admin option to configure which URL is used for Git feat: gitUrl global option Aug 20, 2021
@rarkins rarkins enabled auto-merge (squash) August 20, 2021 11:25
@rarkins rarkins merged commit 7e425e6 into renovatebot:main Aug 20, 2021
@renovate-release
Copy link
Collaborator

🎉 This PR is included in version 26.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@mbrandau mbrandau deleted the add-gitlab-hostrule-option-to-use-ssh branch August 20, 2021 11:56
@HonkingGoose HonkingGoose mentioned this pull request Aug 20, 2021
6 tasks
rarkins pushed a commit that referenced this pull request Aug 20, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow custom git url configuration for platforms Cloning over SSH does not work
4 participants