IF Commons GitHub

changes/strict

The strict mode of the changes check (commons 0020-ifccm FR-009, FR-028, FR-030): ask a Git host, through the one interface of @intellectual-frontiers/githost, for each change request the commits name, and say what the host answered so that rules.ts can judge it. Nothing in this file names a host's API, URL or word.

The client is an argument and is never made here: the command is given one by whoever wires the adapters. Where there is no client, or the host is plain Git (it has no tracker), or the host cannot be asked (unreachable, unauthorized, rate limited), the strict cases are not_run with the reason, never passed (FR-030). A reference to another repository (owner/repo#N) is asked of the same host, in that repository.

import { askHost } from "./strict.ts";
// const outcome = await askHost(client, { kind: "Github", host: "github.com", path: ["owner", "repo"] }, commits);

Source: commons/mizan/src/changes/strict.ts

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

changes.askHostfunctionno test imports it
function askHost(client: GitHostClient | undefined, home: RepoRef, commits: readonly CommitFacts[]): Promise<StrictOutcome>

Ask the host for each change request the commits name (0020-ifccm FR-009), each once.

changes.NO_CLIENTconstno test imports it
const NO_CLIENT: "no Git host client was given to the check, so the host was not asked"

The reason where no client was given.

changes.NO_HOST_APIconstno test imports it
const NO_HOST_API: "there is no host API: the repository is on plain Git, which has no tracker to ask"

The reason a strict run does not happen where the host is plain Git (0020-ifccm FR-030).

changes.StrictOutcometypeno test imports it
type StrictOutcome = {
  /** Each named change request (`owner/repo#N` or `#N`) and the answer. */
  readonly answers: ReadonlyMap<string, IssueAnswer>;
  /** Set where the strict rules were not run, or not run for every reference: why. */
  readonly notRun: string | undefined;
};

What the host said of every change request the commits name, and why some could not be asked.

askHostfunction
function askHost(client: GitHostClient | undefined, home: RepoRef, commits: readonly CommitFacts[]): Promise<StrictOutcome>

Ask the host for each change request the commits name (0020-ifccm FR-009), each once.

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

NO_CLIENTconstno test imports it
const NO_CLIENT: "no Git host client was given to the check, so the host was not asked"

The reason where no client was given.

NO_HOST_APIconst
const NO_HOST_API: "there is no host API: the repository is on plain Git, which has no tracker to ask"

The reason a strict run does not happen where the host is plain Git (0020-ifccm FR-030).

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

StrictOutcometypeno test imports it
type StrictOutcome = {
  /** Each named change request (`owner/repo#N` or `#N`) and the answer. */
  readonly answers: ReadonlyMap<string, IssueAnswer>;
  /** Set where the strict rules were not run, or not run for every reference: why. */
  readonly notRun: string | undefined;
};

What the host said of every change request the commits name, and why some could not be asked.

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