Skip to content
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

Refactor remotes module #688

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from
Draft

Conversation

Theta-Dev
Copy link
Contributor

@Theta-Dev Theta-Dev commented Jun 10, 2024

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:

  • Add new feature to Cargo.toml
  • Implement the fetching and parsing in remote/<name>.rs
  • Add a new variant to the RemoteKind enum in config.rs and add it to the REMOTE_KINDS array

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

  • Bug fix (non-breaking change which fixes an issue)
  • 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:

  • My code follows the code style of this project.
  • I have updated the documentation accordingly.
  • I have formatted the code with rustfmt.
  • I checked the lints with clippy.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@Theta-Dev Theta-Dev requested a review from orhun as a code owner June 10, 2024 14:08
@codecov-commenter
Copy link

codecov-commenter commented Jun 10, 2024

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 ⚠️
git-cliff-core/src/remote/mod.rs 18.00% 41 Missing ⚠️
git-cliff-core/src/remote/gitlab.rs 0.00% 38 Missing ⚠️
git-cliff-core/src/remote/bitbucket.rs 0.00% 29 Missing ⚠️
git-cliff-core/src/remote/github.rs 0.00% 29 Missing ⚠️
git-cliff/src/lib.rs 0.00% 23 Missing ⚠️
git-cliff-core/src/changelog.rs 45.72% 19 Missing ⚠️
git-cliff/src/args.rs 42.86% 16 Missing ⚠️
git-cliff-core/src/config.rs 52.18% 11 Missing ⚠️
git-cliff-core/src/release.rs 83.34% 6 Missing ⚠️
... and 2 more

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

Additional details and impacted files
@@            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 Coverage Δ
unit-tests 35.90% <23.83%> (-0.99%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@orhun
Copy link
Owner

orhun commented Jun 10, 2024

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
Copy link
Contributor Author

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

@Theta-Dev Theta-Dev marked this pull request as draft June 10, 2024 21:07
@orhun
Copy link
Owner

orhun commented Jun 15, 2024

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

@orhun
Copy link
Owner

orhun commented Aug 20, 2024

ping @Theta-Dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants