git-cliff
git-cliff copied to clipboard
feat(core): add `remote` field to commit
Description
Close #803
Add the remote field so that libraries using git-cliff-core can fill it. git-cliff can later use it after a refactoring.
Motivation and Context
https://github.com/orhun/git-cliff/issues/803#issuecomment-2310832669
How Has This Been Tested?
It's a trivial change, so I haven't tested it.
Screenshots / Logs (if applicable)
Types of Changes
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] Documentation (no code change)
- [ ] Refactor (refactoring production code)
- [ ] Other
Checklist:
:warning: Please install the to ensure uploads and comments are reliably processed by Codecov.
Codecov Report
Attention: Patch coverage is 69.23077% with 4 lines in your changes missing coverage. Please review.
Project coverage is 40.48%. Comparing base (
08e761c) to head (1f90786). Report is 6 commits behind head on main.
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@ Coverage Diff @@
## main #822 +/- ##
==========================================
+ Coverage 40.13% 40.48% +0.36%
==========================================
Files 20 21 +1
Lines 1645 1648 +3
==========================================
+ Hits 660 667 +7
+ Misses 985 981 -4
| Flag | Coverage Δ | |
|---|---|---|
| unit-tests | 40.48% <69.24%> (+0.36%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Oh, I didn't get you wanted to move from commit.github to commit.remote in git-cliff as well. Cool 😁
Then, I'll work on this 👍
Update the feature gates for remote so that the types can be exposed without requiring the integration to be enabled.
I extracted the RemoteContributor into git-cliff-core/src/remote_contributor.rs already. Do you think something else is necessary?
Also, please have another look at the PR and let me know there's something else I should do 👍
Thanks for the update on the PR! A couple of points:
- We should either tune down the log level or check the config once and print warnings to avoid flooding the logs:
-
We need to check for the presence of
commit.remotevariable alongside of e.g.github::TEMPLATE_VARIABLESconstants. -
I don't like the place where
remote_contributor.rsis sitting right now. Maybe we can rename it tocontributor.rsor move it somewhere else. (I'm open to other ideas). -
Would be nice to update the existing examples/configs 🙂
I addressed all points except 2. Could you handle it since it might be a bit involved? 👀
We are still missing point 2 you mentioned before:
We need to check for the presence of commit.remote variable alongside of e.g. github::TEMPLATE_VARIABLES constants.
The tests are failing because we are not serializing the remote field.
How do you suggest to do this? (feel free to push to the branch if you prefer)
Hmm, that's not good. Why are we not serializing it? I didn't get why the fixtures are failing because using commit.remote.* locally works for me.
Imo the issue is that the git-cliff cli never sets the remote field of the Commit struct here:
https://github.com/MarcoIeni/git-cliff/blob/aee8952fbdc191aca5663205bf3cd3e76f5f066d/git-cliff-core/src/release.rs#L64
but maybe that is only for the releases, not for the commits.
CI is green now. Yeah 😎
Thanks for reviewing and merging. Looking forward for the release!
I created the issue as you asked https://github.com/orhun/git-cliff/issues/856 👍