-
-
Notifications
You must be signed in to change notification settings - Fork 199
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(config): Allow overriding of remote API URL #896
base: main
Are you sure you want to change the base?
Conversation
Thanks for opening this pull request! Please check out our contributing guidelines! ⛰️ |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #896 +/- ##
==========================================
+ Coverage 40.04% 40.23% +0.20%
==========================================
Files 21 21
Lines 1671 1663 -8
==========================================
Hits 669 669
+ Misses 1002 994 -8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Hello, thanks for the PR! I pushed some nitpicks & refactored the remote handling a bit not to keep you waiting any longer :) Now, when it comes to your questions:
Yup, we should add a fixture test to make sure this is working. I would suggest copying Also, I couldn't see the part where we override the remote URL with the value taken from config yet. We should probably do that as well.
Yup, I think it's good :)
Not really, this should be left like this for now. Sorry for the delayed review, would you be able to address these sometime? 😊 |
Hello, thanks for the feedback. |
Description
This PR aims to simplify the configuration of remote API URL for a particular remote by adding the option in the remote section.
Motivation and Context
Up until now, an environment variable needed to be set such as
GITLAB_API_URL_ENV
fixes #704
How Has This Been Tested?
I only ran the existing tests, as I was unsure of where tests for this feature would have to be added. If there's a particular place I should consider adding them in, let me know.
Screenshots / Logs (if applicable)
Types of Changes
Checklist:
Questions
The change introduces a refactor which I wouldn't consider a breaking change. The functionality is preserved but essentially the api_url() method in the
RemoteClient
has now a default implementation which leverages on the constantsAPI_URL
andAPI_URL_ENV
which allows us to just implements the various traits by setting the appropriate constants without duplicating the code.I have two questions related to this:
https://github.com/pauliyobo/git-cliff/blob/c2398dc452b0f8c3aef1a3f7db8c6748a6de7f24/git-cliff-core/src/repo.rs#L397-L444
I wasn't sure of whether the returned upstream remote should also have its proper api_url set. Is that the case? I have left it on
None
for now.