package gitlab

  1. Overview
  2. Docs
GitLab APIv4 OCaml library

Install

Dune Dependency

Authors

Maintainers

Sources

gitlab-0.1.4.tbz
sha256=1e92f13c458e3d934e5c78f1276dc3d85f03e82de10e783a7f73c6e9e93ce478
sha512=40dc0b0667a458cc6d019226d16e1b05bedc83eb30fd44093201033a964200a59e0a40a903d1e6f09db630c4dcbd75ef5f40a93748c3108f8bce9a32226794ae

Description

This library provides an OCaml interface to the GitLab APIv4 (JSON).

It is compatible with MirageOS and also compiles to pure JavaScript via js_of_ocaml.

Published: 02 Jun 2022

README

Gitlab bindings for OCaml

Native OCaml bindings to Gitlab REST API v4.

The API coverage is incomplete (currently we support many of the Commit, Project, User and Event APIs) but if you find something missing please create an Issue or PR.

Pre-requisites

  • Plain opam / ocaml for building.

Configuration

Gitlab can be hosted in multiple places and configurations. By default the library uses the public gitlab.com site with it's API endpoint of https://gitlab.com/api/v4. This can be changed with:

GITLAB_URL # to configure the GitLab instance to connect to.

or programatically by overriding the Env module.

Debugging

Two environment variables will cause more debugging to be output:

GITLAB_DEBUG=1   # API calls output to stderr
COHTTP_DEBUG=1   # even more HTTP-level debugging

If using the bindings from the toplevel, you can also set Gitlab.log_active to true to get the same effect as setting the GITLAB_DEBUG environment variable.

Lab Cli

A command line client is provided called lab in the style of a similarly named tool hub for GitHub. From source you can run as:

dune exec -- lab <arguments>

If you opam install lab then the executable is available as lab.

Run lab -h for more information about cli options.

Tests

Running mdx tests for lab cli:

# Run integration tests against real gitlab instance
dune runtest --profile non-deterministic

# Promote any changes
dune runtest --profile non-deterministic --auto-promote

NOTE that ocaml-ci doesn't run these tests, any changes to the cli need to be validated manually.

Resources

MDX Setup in RWO

Dependencies (9)

  1. stringext
  2. ISO8601 >= "0.2.6"
  3. ezjsonm
  4. yojson >= "1.7.0"
  5. atdgen >= "2.0.0"
  6. cohttp-lwt >= "4.0"
  7. uri >= "1.9.0"
  8. ocaml >= "4.08.0"
  9. dune >= "2.9"

Dev Dependencies (1)

  1. odoc with-doc

Used by (2)

  1. gitlab-jsoo = "0.1.4"
  2. gitlab-unix = "0.1.4"

Conflicts

None