shiplog-ingest-gitlab
GitLab MR/review ingestor with adaptive date slicing and optional SQLite cache.
Overview
This crate provides an ingestor for collecting merge request and review events from GitLab (both gitlab.com and self-hosted instances). It integrates with the shiplog pipeline to provide:
- Merge request collection with state filtering (opened, merged, closed)
- Review event collection
- Self-hosted GitLab instance support
- Adaptive date slicing for efficient API usage
- Optional SQLite cache for API responses
- Coverage tracking with partial completeness detection
Usage
use GitlabIngestor;
use NaiveDate;
let ingestor = new
.with_token?
.with_instance?
.with_include_reviews?;
let output = ingestor.ingest?;
Configuration
user: GitLab username to collect MRs/reviews forsince: Start date for collectionuntil: End date for collectiontoken: GitLab personal access token (required)instance: GitLab instance URL (default: "gitlab.com")include_reviews: Whether to collect review eventsstate: Filter MRs by state (opened, merged, closed, all)throttle_ms: Delay between API requests for rate limitingcache: Optional API cache
API Endpoints
The ingestor uses the GitLab REST API v4:
/projects/:id/merge_requests- List merge requests/projects/:id/merge_requests/:iid/notes- List MR notes (for reviews)
Error Handling
The ingestor returns detailed errors for:
- Invalid GitLab instance URLs
- Authentication failures
- Rate limit exceeded
- Private/inaccessible projects
- Network issues
License
MIT OR Apache-2.0