feat(config): Allow overriding of remote API URL#896
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 43.14% 43.35% +0.21%
==========================================
Files 21 21
Lines 1718 1712 -6
==========================================
+ Hits 741 742 +1
+ Misses 977 970 -7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
|
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. |
|
Congrats on merging your first pull request! ⛰️ |
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_ENVfixes #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
RemoteClienthas now a default implementation which leverages on the constantsAPI_URLandAPI_URL_ENVwhich 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
Nonefor now.