feat: adds possibility to override host for API #598
feat: adds possibility to override host for API #598
Conversation
Codecov Report
@@ Coverage Diff @@
## trunk #598 +/- ##
===========================================
+ Coverage 46.62% 60.71% +14.08%
===========================================
Files 116 90 -26
Lines 6224 6325 +101
===========================================
+ Hits 2902 3840 +938
+ Misses 2998 2124 -874
- Partials 324 361 +37
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution! In the future, it would be very useful to link to an issue that this is solving. We generally do not accept PRs that are not linked to any particular issue.
Would this be addressing #350?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be solving #350
I'm really excited about this. The current changes look good. You can proceed to add the necessary documentation.
The api_host
becomes directly attached to the authenticated host
hosts:
git.name.devops.com:
api_host: gitlab.name.devops.com
git_protocol: ssh
token: xxxxx
...
Note that cfg.Get(repoHost, "api_host")
gets the value in this order:
ENV VARS -> config(hosts) -> config(global or non-host)
Also, we may have to add glab/internal/config/config_type.go Lines 215 to 244 in 222c0c5
|
@profclems I need help with the tests, I dont understand the relation. |
Co-authored-by: Clement Sam <clementsam75@gmail.com>
Afaik everything is resolved, did I miss sth? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there @lkwg82!
Just a few things to improve upon
I will open a follow-up PR with changes to |
Co-authored-by: Clement Sam <clementsam75@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot @lkwg82... I really appreciate your effort to help make glab better
One last thing before I merge this PR
Co-authored-by: Clement Sam <clementsam75@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking in this one @lkwg82
Description
This PR adds the possibility to add an
api_host
entry in the config to enable overriding the default repository host.In my company we split the api frontend from the ssh backend in the dns. So the api tries to call the ssh git backend.
Related Issue
I'm not sure, if I missed one.
How Has This Been Tested?
I debugged and started with non-working to working code.
Types of changes