Portability · 02 of 06 · The shape

Two contracts, many drivers

The forge and the registry are two independent choices, and today they are welded together: the image path is ghcr.io/<GitHub owner>/<app> and the pull credential is a GitHub token. Hangar owns the two contracts; each vendor is a driver behind one of them.

Two contracts, many drivers Three callers, Airframe compositions (repositories, seed files and webhooks), Glidepath tasks (pull requests, statuses and image pushes) and the Tower backend (pull requests, links, images and pruning), call Hangar contracts, never a vendor API. The SCM contract covers repositories, files, hooks, the merge gate, pull requests, statuses and tokens; the registry contract covers OCI push, pull, digest, referrers, list and delete. Each contract has a set of drivers. Forge drivers: GitHub, built today, then GitLab for gitlab.com and self-managed in phase 3, and Bitbucket Cloud and Bitbucket Data Center in phase 4. Registry drivers: GHCR, built today, then the GitLab Container Registry and Harbor, the neutral default, in phase 1, and ECR, ACR and Artifactory on demand. CONTRACT ONLYWHO CALLSHANGAR CONTRACTSAirframe compositionsrepos · seed files · hooksGlidepath tasksPRs · statuses · image pushTower backendPRs · links · images · pruneSCM contractrepos · files · hooks · merge gate · PRs · statuses · tokensRegistry contractOCI push · pull · digest · referrers · list · deleteFORGEForge driversGitHubbuilt today · driver 1GitLab · .com and self-managedphase 3Bitbucket Cloudphase 4Bitbucket Data Centerphase 4REGISTRYRegistry driversGHCRbuilt todayGitLab Container Registryphase 1Harborphase 1 · neutral defaultECR · ACR · Artifactoryby demandTwo choices, made separately. A Bitbucket shop still needs a registry.LEGENDCallerHangar-owned contractDriver setPlanned driver

SCM contract

  • Declarative: Repository, RepositoryFile, Webhook, MergeGate, as scm.hangar.io resources.
  • Imperative: pr open, find, comment, status, contents, compare, token.
  • One Go library behind the provider, the scm CLI and the broker.

Registry contract

Push, pull, digest and cosign already speak plain OCI. Only listing with dates and deleting are vendor APIs, so only those need drivers.

Capability, not the lowest common denominator

A driver declares what it can enforce, such as a required check from one named app. Tower shows the level each app actually has.

Hangar · Portability