Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0001-quality-evidence FR-050
Archiving the quality branch by a tag, with real git (commons 0001-quality-evidence FR-050): once the retention period the harness states has passed for its oldest evidence, archiveBranch makes a Git tag on the tip of the branch so that what the branch held then can always be found, and deletes nothing: there is no function here that removes a tag, a commit, a file or the branch, a tag that exists is never moved, and a branch that has no tip is not made.
The period and the day are arguments (pure/retention.ts judges them); the command reads the period from the harness's record (ifccm.declaration.ts) and the day from the clock. The tag is annotated, so Git's own signing of tags (tag.gpgSign) applies as the host configures it.
Source: commons/quality/src/host/archive.ts
3 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.
ArchiveErrortypeno test imports ittype ArchiveError =
| HostError
| { readonly kind: "no-branch" }
| { readonly kind: "bad-tag"; readonly reason: string }
| { readonly kind: "tag-exists"; readonly tag: string }
| { readonly kind: "retention"; readonly reason: string };
Why a branch was not archived.
formatArchiveErrorfunctionno test imports itfunction formatArchiveError(e: ArchiveError): string
Archivedtypeno test imports ittype Archived =
| { readonly kind: "tagged"; readonly tag: string; readonly tip: string; readonly judgement: RetentionJudgement }
/** The period has not passed, there is no evidence or the harness states no period: nothing was written. */
| { readonly kind: "not-archived"; readonly judgement: RetentionJudgement };
ArchiveOptionstypeno test imports ittype ArchiveOptions = {
readonly repo: string;
/** The name of the tag to make. */
readonly tag: string;
/** The retention period the harness states, in days. */
readonly retentionDays: number | undefined;
/** The day today. */
readonly today: string;
};
What archiveBranch is given.
function oldestEvidenceDay(repo: string): Promise<Result<string | undefined, HostError>>
The UTC day of the oldest evidence file of the branch, YYYY-MM-DD, or none where the branch holds none.
Imported by 3 tests of the run (3 passed, 0 failed): the library's results
function archiveBranch(options: ArchiveOptions): Promise<Result<Archived, ArchiveError>>
Archives the branch by a tag where the retention period of its oldest evidence has passed (FR-050). It refuses a name that is not a tag name and a tag that exists, and it only ever adds the one tag.
Imported by 3 tests of the run (3 passed, 0 failed): the library's results
function tagTarget(repo: string, tag: string): Promise<Result<string | undefined, HostError>>
The commit a tag points to (peeled), or none where the tag is not there: the proof that an archive tag names the tip it was made on.
Imported by 3 tests of the run (3 passed, 0 failed): the library's results