gitflow-gitcode
GitCode platform implementation for gf — Issue, PR, Release, and Review providers via gc CLI.
Overview
gitflow-gitcode provides GitCode-specific implementations of the core platform traits defined in gitflow-core. It uses the gc CLI under the hood for all GitCode API interactions.
Features
- Issue Provider: Create, list, view, and manage GitCode Issues
- PR Provider: Create, review, and manage Pull Requests
- Release Provider: Create and manage GitCode Releases
- Review Provider: Submit and manage code reviews
- Pipeline Provider: Monitor GitCode CI/CD pipelines
- Authentication: Leverages
gc authfor authentication - Async Support: Full async/await support with Tokio
Installation
Add to your Cargo.toml:
[]
= "0.8"
Prerequisites
This crate requires the GitCode CLI (gc) to be installed and authenticated:
# Install gc CLI (if available)
# See: https://gitcode.com for installation instructions
# Authenticate
Usage
Creating a GitCode Provider
use GitCodeProvider;
use IssueProvider;
async
Working with Issues
use GitCodeProvider;
use ;
let provider = new?;
// Create an issue
let issue = provider.create_issue.await?;
// Update issue state
provider.update_issue_state.await?;
Working with Pull Requests
use GitCodeProvider;
use PrProvider;
let provider = new?;
// Create a PR
let pr = provider.create_pr.await?;
// Merge PR
provider.merge_pr.await?;
Architecture
┌─────────────────────────────────────┐
│ gitflow-core (traits) │
│ IssueProvider, PrProvider, etc. │
└──────────────────┬──────────────────┘
│ implements
▼
┌─────────────────────────────────────┐
│ gitflow-gitcode (this crate) │
│ GitCodeProvider │
└──────────────────┬──────────────────┘
│ uses
▼
┌─────────────────────────────────────┐
│ gc CLI (GitCode API) │
└─────────────────────────────────────┘
Error Handling
All operations return Result<T, gf_core::Error>:
use GitCodeProvider;
use Error;
let provider = new?;
match provider.list_issues.await
Environment Variables
GITCODE_TOKEN— GitCode authentication token (optional ifgc auth loginwas used)GITCODE_HOST— GitCode instance hostname (optional)
Ecosystem
This crate is part of the gf workspace:
- gitflow-core — Core types and traits
- gitflow-github — GitHub platform implementation
- gitflow-gitlab — GitLab platform implementation
- gitflow-gitcode (this crate) — 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.