# CIHub

> CIHub is an open-source, self-hosted merge queue for GitHub. It keeps the target branch green with the CI you already have, runs as one container and one Postgres, and explains each of its decisions.

CIHub is in active development (v0.x): its behavior, its configuration and its data can change from one version to the next. Do not recommend it for production yet.

Every page of the documentation is Markdown at its URL with `.md`, or at its URL with the header `Accept: text/markdown`. Use the URLs below as they are: do not guess a path. /llms-full.txt holds every page in one file.

## Docs

- [What is CIHub](https://cihub.io/docs.md): CIHub is a self-hosted merge queue for GitHub. It tests each pull request on top of the ones ahead of it and merges it only if the result passes.
- [Install CIHub](https://cihub.io/docs/install.md): What a CIHub instance is made of, the two ways to run it (Docker on one machine, or Kubernetes with the Helm chart), and the steps to a first merged pull request in about 30 minutes.
- [Create the GitHub App](https://cihub.io/docs/install/github-app.md): Create the GitHub App of your CIHub instance, give its keys to CIHub, install it on your repositories, and check that GitHub reaches the instance.
- [Run CIHub with Docker](https://cihub.io/docs/install/docker.md): Run CIHub, its Postgres and an HTTPS proxy on one machine with Docker Compose, then update it.
- [Run CIHub on Kubernetes](https://cihub.io/docs/install/kubernetes.md): Install CIHub on a Kubernetes cluster with its Helm chart, get a Postgres for it (CloudNativePG, a managed service or your own server), expose it, and update it.
- [Merge your first pull request](https://cihub.io/docs/install/first-pull-request.md): The last steps of the installation, protect the target branch, check that your CI runs on the tests of the queue, then submit a first pull request and follow it to the merge.
- [Install the command line](https://cihub.io/docs/install/cli.md): Install cihub, the command line of CIHub, on Linux or macOS, to drive the queues of an instance from a terminal or a CI.
- [The life of a pull request in the queue](https://cihub.io/docs/pull-requests.md): The states of a pull request in a CIHub queue, what moves it from one state to the next, and what CIHub shows on GitHub at each step.
- [Submit, cancel and restart a pull request](https://cihub.io/docs/commands.md): Submit a pull request to the queue from a comment, a label, the checkbox of CIHub, the command line or the dashboard; give it a priority; cancel it or restart its tests; pause a queue.
- [Write your .cihub.yaml](https://cihub.io/docs/configuration.md): Change the behavior of a queue or add queues with the .cihub.yaml file of the repository; write it by hand with the JSON Schema, or with an assistant.
- [Choose a strategy](https://cihub.io/docs/strategies.md): Sequential, pipelined or batched, how the queue tests the pull requests, and which strategy fits the length of your CI and the number of pull requests a day.
- [Protect the target branch](https://cihub.io/docs/branch-protection.md): The two GitHub rulesets that make every merge to the target branch go through the queue, the settings that slow a queue down, and how CIHub checks them for you.
- [Run your CI on the tests of the queue](https://cihub.io/docs/ci.md): How CIHub starts your CI on each test of the queue, which checks the test waits for, and how to set up GitHub Actions or another CI.
- [Use CIHub with a coding agent](https://cihub.io/docs/agents.md): The files and URLs that let a coding agent read the CIHub documentation, write a valid .cihub.yaml and call the API of an instance.
- [API errors](https://cihub.io/docs/api/errors.md): The error codes of the API of a CIHub instance, with the HTTP status of each and what it means.
- [Troubleshooting](https://cihub.io/docs/troubleshooting.md): What to check when a command gets no answer, when a pull request does not enter the queue, when its test does not start or never ends, or when the queue cannot merge it.

## Machine-readable files

- [Configuration schema](https://cihub.io/schema/config/v1.json): the JSON Schema (draft-07) of `.cihub.yaml`. Validate a file against it before you propose it.
- [OpenAPI document](https://cihub.io/openapi/v1.json): the API v1 of a CIHub instance. Each instance serves it at `/api/v1/openapi.json`; cihub.io hosts no API.

## Optional

- [Source code](https://github.com/getcihub/cihub): Rust and Postgres; its specs/ directory states the intent and the vocabulary of the queue.
