IF Commons GitHub

gitlab

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0001-githost FR-001

GitLab behind the one interface (commons 0001-githost FR-001 to FR-006): REST API v4 over the runtime's Transport, gitlab.com or a self-managed host, public and private projects, groups to any depth (a project is addressed by its whole path, URL-encoded), issues, merge requests, protected branches and whether a commit's signature is verified.

The token is given once to gitlabClient and lives only in the closure that builds the request headers (PRIVATE-TOKEN for a personal or project access token, JOB-TOKEN for a CI job's token): it is in no result, no failure and no property of the client, and it is sent only to the one host the client serves. A private project asked for with no token is answered not-found, as GitLab says; with a token that may not read it, unauthorized. On GitLab, requiresReview of a protected branch means that changes enter only by a merge request (no one may push) or that a code owner must approve, which is what the branch rule alone tells; the approval rules of a merge request are another endpoint of a paid plan.

Source: commons/githost/src/gitlab.ts

1 of 2 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

gitlabClientfunction
function gitlabClient(options: GitlabOptions): GitHostClient

A GitLab client over a transport: the common four capabilities, protected branches, issues and merge requests, and groups to any depth.

Imported by 12 tests of the run (12 passed, 0 failed): the library's results

GitlabOptionstypeno test imports it
type GitlabOptions = { /** How requests are sent: the live transport, or a recorded one. */ readonly transport: Tran… (631 characters)
type GitlabOptions = {
  /** How requests are sent: the live transport, or a recorded one. */
  readonly transport: Transport;
  /** The host's address without the API path (`https://gitlab.com` by default); its host name is the one host this client serves. */
  readonly baseUrl?: string;
  /** A token, from the environment by the caller; never stored in a file and never in a result. Absent: only what is public. */
  readonly token?: string | undefined;
  /** What the token is: a personal or project access token (`PRIVATE-TOKEN`, the default), or a CI job's token (`JOB-TOKEN`). */
  readonly tokenKind?: "access" | "job";
};

How a GitLab client is made.

Titles, headings, exports, tables, columns and requirements. Esc closes.