gitflow-gitlab
GitLab platform implementation for gf — Issue, MR, Release, and Review providers via glab CLI.
Overview
gitflow-gitlab provides GitLab-specific implementations of the core platform traits defined in gitflow-core. It uses the official glab CLI under the hood for all GitLab API interactions.
Features
- Issue Provider: Create, list, view, and manage GitLab Issues
- MR Provider: Create, review, and manage Merge Requests (GitLab's PRs)
- Release Provider: Create and manage GitLab Releases
- Review Provider: Submit and manage code reviews
- Pipeline Provider: Monitor GitLab CI/CD pipelines
- Authentication: Leverages
glab authfor authentication - Async Support: Full async/await support with Tokio
Installation
Add to your Cargo.toml:
[]
= "0.8"
Prerequisites
This crate requires the GitLab CLI (glab) to be installed and authenticated:
# Install glab CLI
# See: https://gitlab.com/gitlab-org/cli for other platforms
# Authenticate
Usage
Creating a GitLab Provider
use GitLabProvider;
use IssueProvider;
async
Working with Issues
use GitLabProvider;
use ;
let provider = new?;
// Create an issue
let issue = provider.create_issue.await?;
// Update issue state
provider.update_issue_state.await?;
Working with Merge Requests
use GitLabProvider;
use PrProvider;
let provider = new?;
// Create a merge request
let mr = provider.create_pr.await?;
// Merge MR
provider.merge_pr.await?;
Working with Pipelines
use GitLabProvider;
use ;
let provider = new?;
// Get pipeline status
let pipeline = provider.get_pipeline.await?;
println!;
Architecture
┌─────────────────────────────────────┐
│ gitflow-core (traits) │
│ IssueProvider, PrProvider, etc. │
└──────────────────┬──────────────────┘
│ implements
▼
┌─────────────────────────────────────┐
│ gitflow-gitlab (this crate) │
│ GitLabProvider │
└──────────────────┬──────────────────┘
│ uses
▼
┌─────────────────────────────────────┐
│ glab CLI (GitLab API) │
└─────────────────────────────────────┘
Error Handling
All operations return Result<T, gf_core::Error>:
use GitLabProvider;
use Error;
let provider = new?;
match provider.list_issues.await
Environment Variables
GITLAB_TOKEN— GitLab authentication token (optional ifglab auth loginwas used)GITLAB_HOST— GitLab self-hosted instance hostname (optional, defaults to gitlab.com)
Ecosystem
This crate is part of the gf workspace:
- gitflow-core — Core types and traits
- gitflow-github — GitHub platform implementation
- gitflow-gitlab (this crate) — GitLab platform implementation
- gitflow-gitcode — GitCode platform implementation
- gf — CLI application
Documentation
Contributing
Contributions are welcome! Please see the main repository for contribution guidelines.
License
Licensed under the MIT License. See LICENSE for details.