Skip to content

Git provider abstraction to support GitLab later#821

Open
nicolaric wants to merge 3 commits intodlvhdr:mainfrom
nicolaric:pr/provider-abstraction
Open

Git provider abstraction to support GitLab later#821
nicolaric wants to merge 3 commits intodlvhdr:mainfrom
nicolaric:pr/provider-abstraction

Conversation

@nicolaric
Copy link
Copy Markdown

@nicolaric nicolaric commented Mar 30, 2026

Summary

This PR establishes a provider abstraction layer that enables gh-dash to support both GitHub and GitLab as Git hosting providers. The abstraction decouples the application logic from provider-specific implementations, allowing future providers to be added with minimal changes.

This change is split off from #819 in order to create small parts.

first sub-pr of #819
those changes take care of adding an abstraction layer

Configuration

  • gitlab-config.yml: Example configuration file for GitLab mode
  • cmd/root.go: Adds --gitlab <hostname> flag to enable GitLab modelity.

Later PR's will be:

  • PR 2: GitLab data fetching layer using this interface
  • PR 3: GitLab CLI task commands (merge, close, comment, etc.)
  • PR 4: GitLab UI components (CI checks, diff viewer, issue view)

This establishes the Provider interface and concrete implementations
for GitHub (using gh CLI) and GitLab (using glab CLI).

The interface defines methods for:
- FetchPullRequests/FetchIssues
- FetchPullRequest (single PR/MR)
- FetchIssueComments
- GetCurrentUser
- GetCLICommand

Also adds --gitlab flag to specify GitLab hostname.
- Add label color caching per project
- Improve auth state detection
- Fix glab command parsing for various outputs
@nicolaric nicolaric changed the title Pr/provider abstraction Git provider abstraction to support GitLab later Mar 30, 2026
@dlvhdr
Copy link
Copy Markdown
Owner

dlvhdr commented Apr 1, 2026

Let's add the gitlab specific code in a separate PR

@nicolaric
Copy link
Copy Markdown
Author

@dlvhdr i removed the gitlab specific stuff and will add a new pull request once this one is merged

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