package gitlab-unix

  1. Overview
  2. Docs
GitLab APIv4 OCaml library

Install

Dune Dependency

Authors

Maintainers

Sources

gitlab-0.1.8.tbz
sha256=06e430f4ab919c3417374d9628ce7ebfd49b6a901129a6e6fa1cdd53c2daae42
sha512=04c5c7131fa5a630edd0d2c605084fb37bb6a4d875b208450bf3b3fb70dc17da0f9ed8de04271e4eea62168d77dbcdda139aa7fe1a40f06f6c6cfb4407c47680

Description

This library provides an OCaml interface to the Gitlab APIv4 (JSON). This package installs the Unix (Lwt) version.

Published: 05 Oct 2023

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 (10)

  1. base-unix
  2. stringext
  3. lwt >= "2.4.4"
  4. tls >= "0.11.0"
  5. cohttp-lwt-unix >= "4.0"
  6. cohttp >= "4.0"
  7. cmdliner >= "1.1.0"
  8. gitlab = version
  9. ocaml >= "4.08.0"
  10. dune >= "3.0"

Dev Dependencies (2)

  1. odoc with-doc
  2. alcotest with-test

Used by (3)

  1. current_gitlab >= "0.6.6"
  2. gitlab_pipeline_notifier
  3. lab >= "0.1.8"

Conflicts

None