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(#9): move gitlab logic to specific repository package #46

Merged
merged 1 commit into from
Jan 7, 2025

Conversation

sacha-c
Copy link
Collaborator

@sacha-c sacha-c commented Jan 7, 2025

A first step to adding github is to isolate gitlab. This PR replaces all uses of https://pkg.go.dev/github.com/xanzy/go-gitlab#section-readme with generic types in our repo package, so they can be used regardless of the type of repository host.

  • Renames gitlab package to repo
  • Moves common "repo" types to a repo.go file in which we have the common service interface & structs (Project, Issue)
  • Refactors gitlab.go to implement the common interface
  • Refactors the rest of the CLI to use the common interface rather than the specific gitlab structs

With this change to add github I expect we will need to:

  1. Create a new repo/github.go service which implements the common interface
  2. Add logic in patrol to provide a different repository service based on the path type (gitlab vs github)

@sacha-c sacha-c requested a review from scastlara as a code owner January 7, 2025 13:39
…tory package

A first step to adding github is to isolate gitlab
@sacha-c sacha-c merged commit eec15e4 into elementsinteractive:main Jan 7, 2025
2 checks passed
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.

2 participants