IF Commons GitHub

manifest

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

The workspace's manifest, the source state (commons 0003-host FR-001, 0002-workspace-model FR-006, FR-011, FR-019, FR-020): the repositories it names, the self-managed GitLab hosts, the policy and the identity, decoded once at the boundary by the kernel's decoder and then checked as a whole, so that every field that is wrong is reported with its place and none is guessed.

Two stages. The shape is the kernel decoder's: the first field that is not what is expected stops that stage, named by its path. The meaning is this module's and reports all it finds: a remote that is not a remote of a host, a path that is not portable or is named like a folder of the workspace, a path deeper than the host's manager offers, two repositories or worktrees whose paths are one after Unicode normalization and case folding (both are named, on every file system), a branch that is not a branch name, and a repository on a host the policy does not allow. An issue is a finding of severity Error (issueFinding); a manifest with one is not used.

Source: commons/ergonex/src/manifest.ts

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

decodeManifestfunction
function decodeManifest(input: unknown, options?: { readonly loopbackHttp?: boolean | undefined; }): Result<Manifest, readonly ManifestIssue[]>

The manifest from a value of unknown shape, or every issue found in it. Pure: nothing is read, and nothing in the value is kept that is not decoded.

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

hostKindInfunctionno test imports it
function hostKindIn(manifest: Manifest, host: string): "Git" | "Github" | "Gitlab"

The kind of host of a name under a manifest: GitHub for github.com, GitLab for gitlab.com and the hosts it names, plain Git for the rest (0002-workspace-model FR-019).

issueFindingfunction
function issueFinding(issue: ManifestIssue, today: string): Finding

An issue as a finding of the severity Error, first seen today.

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

Manifesttype
type Manifest = { readonly repositories: readonly ManifestRepo[]; /** The hosts that are not plain Git, by name: the… (888 characters)
type Manifest = {
  readonly repositories: readonly ManifestRepo[];
  /** The hosts that are not plain Git, by name: the self-managed GitLab hosts the manifest names (and never one guessed from a URL). */
  readonly hostKinds: HostKinds;
  readonly policy: Policy;
  readonly identity?: { readonly name: string; readonly email: string } | undefined;
  /** The signing the policy requires, where the manifest names a format. */
  readonly signing?: ManifestSigning | undefined;
  /** Whether `direnv` is wanted (0003-host FR-023): `.envrc.auto` is generated only where it is wanted and a probe finds it. */
  readonly direnv: boolean;
  /** The modules the workspace registers, written to `modules.auto.json`. */
  readonly modules: readonly ManifestModule[];
  /** The tool catalog (0002-workspace-model FR-037): empty where the manifest names none. */
  readonly catalog: ToolCatalog;
};

The decoded manifest.

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

ManifestIssuetype
type ManifestIssue = { /** The rule that found it: `ergonex/manifest-shape`, `ergonex/manifest-remote`, `ergonex/manif… (475 characters)
type ManifestIssue = {
  /** The rule that found it: `ergonex/manifest-shape`, `ergonex/manifest-remote`, `ergonex/manifest-path`, `ergonex/manifest-branch`, `ergonex/manifest-host`, `ergonex/manifest-signing`, `ergonex/manifest-module`, `ergonex/catalog-shape`, `ergonex/catalog-tool`, `ergonex/path-collision`, `ergonex/host-not-allowed`. */
  readonly rule: string;
  /** The field, as `$.repositories[2].remote`. */
  readonly path: string;
  readonly message: string;
};

One thing wrong in the manifest, with where.

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

ManifestRepotypeno test imports it
type ManifestRepo = { /** The remote as the manifest wrote it, normalized to the HTTPS URL it is cloned from. */ rea… (428 characters)
type ManifestRepo = {
  /** The remote as the manifest wrote it, normalized to the HTTPS URL it is cloned from. */
  readonly cloneUrl: string;
  readonly ref: RepoRef;
  readonly path: RepoPath;
  readonly branch?: BranchName | undefined;
  /** The group of repositories it belongs to (one `<group>.auto.code-workspace` file each). */
  readonly group?: string | undefined;
  readonly worktrees: readonly ManifestWorktree[];
};

A repository the manifest names, with where it goes.

ManifestWorktreetypeno test imports it
type ManifestWorktree = {
  readonly branch: BranchName;
  readonly path: RepoPath;
};

A worktree the manifest asks for.

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