ironflow-ops-gitlab
GitLab integration for Ironflow workflows, powered by the gitlab crate.
Provides typed, builder-based access to every GitLab API v4 endpoint with automatic credential resolution from the workflow's secret store.
Usage
[]
= "0.1"
Build a client
use GitLab;
// From a workflow step (reads gitlab_token from the secret store)
let gitlab = from_context.await?;
// Self-hosted instance
let gitlab = from_context_with_host.await?;
// Explicit token
let gitlab = new.await?;
use GitLab;
use GitlabBuilder;
// From an already configured AsyncGitlab (e.g. wiremock in tests, custom TLS)
let client = new
.insecure
.build_async
.await?;
let gitlab: GitLab = client.into;
Typed queries
Use the re-exported gitlab::api builders for type-safe endpoint calls:
use GitLab;
use ;
use Deserialize;
let gitlab = from_context.await?;
let endpoint = builder.project.build?;
let project: Project = endpoint.query_async.await?;
Tracked operations
Wrap any endpoint in a tracked workflow step:
use GitLab;
use CreateIssue;
let gitlab = from_context.await?;
let endpoint = builder
.project
.title
.description
.build?;
// Tracked as a workflow step with kind "gitlab"
let output = ctx.operation.await?;
Endpoints not in the gitlab crate
Some GitLab REST routes are missing from the gitlab crate. This crate provides them
under endpoints, wired the same way as any other endpoint:
use GitLab;
use ;
use NameOrId;
let gitlab = from_context.await?;
let note = CreateMergeRequestDiscussionNote ;
let output = ctx.operation.await?;
let resolve = ResolveMergeRequestDiscussion ;
let output = ctx.operation.await?;
Paginated operations
GitLab::op issues a single request, so it only ever returns the first page of a "list ..."
endpoint. Use GitLab::paged_op to drive pagination and get back a JSON array concatenating
every page:
use GitLab;
use MergeRequests;
use Pagination;
let gitlab = from_context.await?;
let endpoint = builder.project.build?;
let output = ctx
.operation
.await?;
Authentication
Register gitlab_token in your workflow's secret store:
secrets:
- name: gitlab_token
env: GITLAB_TOKEN
API coverage
This crate re-exports the full gitlab API. All endpoints available in that crate are available here, including:
- Projects, groups, users
- Issues, merge requests, notes, discussions
- Pipelines, jobs, artifacts
- Repository files, branches, tags, commits
- Releases, deployments, environments
- CI/CD variables, runners, registry
- Labels, milestones, wikis, snippets, packages
- And more -- see the gitlab crate docs