Skip to content
This repository has been archived by the owner on Nov 22, 2022. It is now read-only.

Allow protocol override when overriding the default host #696

Merged
merged 1 commit into from
May 3, 2021

Conversation

profclems
Copy link
Owner

This allows overriding the default protocol of the hostname if a fully qualified url is provided when using the GITLAB_HOST environment variable.
For example, if the GITLAB_HOST=http://my.glinstance.org, then the host will be set to my.glinstance.org and the protocol become http, unlike before when the protocol was ignored and only the hostname was considered.

This is a follow-up for #678 and #667

This allows overriding the default protocol of the hostname if a fully qualified url is provided when using the `GITLAB_HOST` environment variable.
For example, if the GITLAB_HOST=http://my.glinstance.org, then the host will be set to my.glinstance.org and the protocol become http, unlike before when the protocol was ignored and only the hostname was considered.

This is a follow-up for #678
and #667
@profclems profclems added the Fix This fixes a bug or incorrect documentation label Apr 30, 2021
@codecov
Copy link

codecov bot commented Apr 30, 2021

Codecov Report

Merging #696 (70ea685) into trunk (87c2a99) will decrease coverage by 0.03%.
The diff coverage is 33.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##            trunk     #696      +/-   ##
==========================================
- Coverage   59.73%   59.70%   -0.04%     
==========================================
  Files          90       90              
  Lines        6487     6494       +7     
==========================================
+ Hits         3875     3877       +2     
- Misses       2247     2251       +4     
- Partials      365      366       +1     
Impacted Files Coverage Δ
cmd/glab/main.go 39.32% <0.00%> (-0.91%) ⬇️
internal/glinstance/host.go 92.68% <50.00%> (-7.32%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 87c2a99...70ea685. Read the comment docs.

Copy link
Collaborator

@zemzale zemzale left a comment

Choose a reason for hiding this comment

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

Nice work @profclems .

I had the idea of protocol override in the back of my head when I worked on this, but in the end, I forgot about it.

@zemzale zemzale merged commit 0e1ca38 into trunk May 3, 2021
@zemzale zemzale deleted the allow-protocol-override branch May 3, 2021 07:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Fix This fixes a bug or incorrect documentation size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants