Skip to content

Latest commit

 

History

History
89 lines (69 loc) · 3.73 KB

README.md

File metadata and controls

89 lines (69 loc) · 3.73 KB

@deckyard/codehost

test Documentation release

One API over GitHub™, GitLab™ and Forgejo™ (and Gitea™) for Jennifer programs, so a release script or a triage bot runs against any of them: repositories, issues, labels and comments, change requests (pull and merge requests), releases and their assets, branches, tags, files and commit statuses. It is a facade over @deckyard/github, @deckyard/gitlab and @deckyard/forgejo: states, drafts, commit-status states, release assets and labels are normalised, and the backend client stays at hand for whatever only one forge has.

Documentation

Install

jvc add @deckyard/codehost

This vendors the deck to vendor/deckyard/codehost/, and its three backend decks beside it. Without jvc, unpack the src/ subtree of each release archive (deckyard-<deck>-<version>.tar.gz) to vendor/deckyard/<deck>/.

Usage

import "@deckyard/codehost/" as codehost;

def forges as list of codehost.Forge init [
    codehost.connect("github", "github.com", ""),
    codehost.connect("gitlab", "gitlab.com", ""),
    codehost.connect("forgejo", "codeberg.org", "")
];
def repos as list of string init ["BurntSushi/ripgrep", "gitlab-org/cli", "forgejo/forgejo"];
for (def i in 0..3) {
    def r as codehost.Release init codehost.latestRelease($forges[$i], $repos[$i]);
    io.printf("%s %s: %s\n", $forges[$i].backend, $repos[$i], $r.tag);
}

connect(backend, host, token) takes the backend by name, so it can come from a configuration file, and a token ("" for anonymous access). For a CA certificate, timeouts, retries or plain http, build the client with the backend deck (github.client(...) and its with* options) and wrap it with fromGithub, fromGitlab or fromForgejo.

Errors are one CodehostError (kind "codehost", with the HTTP status and the backend); "limit", "timeout", "closed", "cancelled" and "net" (a network failure, net.NetError) pass through.

Requirements

Jennifer 0.27.0 or newer, with the net capability (it talks HTTPS to the forges); not usable on jennifer-tiny. Depends on @deckyard/github (>=0.3.0), @deckyard/gitlab (>=0.4.0) and @deckyard/forgejo (>=0.4.0); run tools/vendor-deps.sh once before the gate.

Development

tools/check-all.sh                   # the full gate, as CI runs it
jennifer test src/codehost_test.j      # the test overlay
tools/check-docs.sh                  # docs against the code
tools/pack.sh dist                   # build the release archive

Trademarks

GitHub™ is a trademark of GitHub, Inc. GitLab™ is a trademark of GitLab Inc. Codeberg™ is a trademark of Codeberg e.V. Other product and company names, such as Forgejo™ and Gitea™, may be trademarks of their respective owners. They are used only to identify the products this deck works with. This deck is an independent project, not affiliated with, sponsored or endorsed by GitHub, Inc., GitLab Inc., Codeberg e.V., the Forgejo project or CommitGo, Inc.

Licence

LGPL-3.0-only, see LICENSE. Copyright (C) 2026 mplx <[email protected]>.

tools/check-headers.sh checks every source file's SPDX header against deck.toml.