orhun / git-cliff

A highly customizable Changelog Generator that follows Conventional Commit specifications ⛰️
https://git-cliff.org
Apache License 2.0
8.23k stars 165 forks source link

Refactor remotes module #688

Open Theta-Dev opened 3 weeks ago

Theta-Dev commented 3 weeks ago

Description

Refactoring of the remotes module to make the integration of new code forges easier.

Motivation and Context

When I added Gitea integration (#680), I noticed a lot of redundant code blocks in the application which have to be copied for every code forge integration added. So I tried to rework the system to allow adding new remotes with minimal changes to the application.

Adding a new application now only consists of the following steps:

This obviously comes with breaking changes to the API of the remote module.

How Has This Been Tested?

Screenshots / Logs (if applicable)

Types of Changes

Checklist:

codecov-commenter commented 3 weeks ago

Codecov Report

Attention: Patch coverage is 23.82353% with 259 lines in your changes missing coverage. Please review.

Project coverage is 35.90%. Comparing base (832edbc) to head (c907098).

Files Patch % Lines
git-cliff-core/src/remote/gitea.rs 0.00% 41 Missing :warning:
git-cliff-core/src/remote/mod.rs 18.00% 41 Missing :warning:
git-cliff-core/src/remote/gitlab.rs 0.00% 38 Missing :warning:
git-cliff-core/src/remote/bitbucket.rs 0.00% 29 Missing :warning:
git-cliff-core/src/remote/github.rs 0.00% 29 Missing :warning:
git-cliff/src/lib.rs 0.00% 23 Missing :warning:
git-cliff-core/src/changelog.rs 45.72% 19 Missing :warning:
git-cliff/src/args.rs 42.86% 16 Missing :warning:
git-cliff-core/src/config.rs 52.18% 11 Missing :warning:
git-cliff-core/src/release.rs 83.34% 6 Missing :warning:
... and 2 more

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #688 +/- ## ========================================== - Coverage 36.89% 35.90% -0.99% ========================================== Files 18 19 +1 Lines 1350 1382 +32 ========================================== - Hits 498 496 -2 - Misses 852 886 +34 ``` | [Flag](https://app.codecov.io/gh/orhun/git-cliff/pull/688/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Orhun+Parmaks%C4%B1z) | Coverage Δ | | |---|---|---| | [unit-tests](https://app.codecov.io/gh/orhun/git-cliff/pull/688/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Orhun+Parmaks%C4%B1z) | `35.90% <23.83%> (-0.99%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Orhun+Parmaks%C4%B1z#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

orhun commented 3 weeks ago

Hey, thanks for your work on this! Should we mark as draft until #680 is merged (since this PR is based on those changes?)

Theta-Dev commented 3 weeks ago

Okay. It still needs some documentation work done, since there is now a new URL config option to better support self-hosted instances.

orhun commented 2 weeks ago

Thanks a lot for #680, it is merged now which means we can resume the work on this PR!