MMOframework
Pourquoi l'IA Playground Bibliothèques Développeurs Agence
FR EN
Créer un projet en direct
Index

ReleaseGate

MMO\admin\helpers · 1 symbole · générée le 30 Nov 2026

class

ReleaseGate

ReleaseGate.php:29

What a release to a protected target must show before it goes (ISO 27001 A.8.32, A.5.3, A.8.19): the commit it is built from carries a tag, the release checklist is checked in full, and one of the people who checked it is not one of the authors of what it ships -- the change approved by someone else than who made it.

class MMO\admin\helpers\ReleaseGate
Espace de noms
MMO\admin\helpers
Off unless the project's `releasePolicy` says `"enabled": true` ([`ProductionController`](https://mmoframework.fr/documentation/mmo.admin/php/controllers/ProductionController.md#productioncontroller)): a project that does not ask releases as before. Refused, a release only goes with `--override="<reason>"`, and the reason goes into the journal of every target it reached, beside who approved what ([`approval`](https://mmoframework.fr/documentation/mmo.admin/php/helpers/ReleaseGate.md#releasegate-approval)). The policy: `enabled`; `tag` (true: the commit is tagged); `checklist` (the checklist's name, `checklists/{name}.json` of the project; `--checklist=` names another for one release; null: none required); `approval` (true: a checker is not an author); `approvers` (the logins whose tick approves; null: anyone's); `identities` (login => the e-mail addresses and names of their commits, `{"mmouret": ["marc@hydra-agency.com"]}`; a login also matches an author of that name, or of that e-mail's local part); `since` (where the changes start: the tag before the commit's, by default).
$gate = new ReleaseGate($git, ['enabled' => true, 'checklist' => 'acme-2.0'], '/srv/acme/checklists'); $verdict = $gate->check($target); $verdict['problems']; // ['[acme] master (1a2b3c4) carries no tag', ...] $verdict['approval']; // ['tag' => null, 'commit' => '1a2b3c4...', 'checklist' => 'acme-2.0', 'approvedBy' => null, ...]

Propriétés3

checklists

protected string $checklists
Type
string

git

protected MMO\git\helpers\Repository $git
Type
Repository

policy

readonly
readonly array $policy
Type
array

Méthodes7

approval($tag, $commit, $checklist, $approvedBy, $checkedBy, $authors)

ReleaseGate.php:123
protected function approval( ?string $tag, ?string $commit, ?string $checklist, ?string $approvedBy, array $checkedBy, array $authors ): array
$tagnull | string
$commitnull | string
$checklistnull | string
$approvedBynull | string
$checkedByarray
$authorsarray
retournearraywhat the journal keeps of the approval of a release

authors($commit, $tag)

ReleaseGate.php:98
function authors(string $commit, ?string $tag): array
$commitstring
$tagnull | string
retournearraythe authors (Name <e-mail>) of the commits from the tag before $commit's (or $policy's since) to it

check($target, $checklist)

ReleaseGate.php:47
function check(MMO\admin\entities\Target $target, ?string $checklist = null): array
$targetTargeta target about to receive its ref's commit
$checklist = nullnull | stringthe checklist of this release (null: the policy's)
retournearraylist<string>, approval: array<string, mixed>} the problems, and what the journal keeps: tag, commit, checklist, approvedBy, checkedBy, authors

isAuthor($login, $authors)

ReleaseGate.php:111
function isAuthor(string $login, array $authors): bool
$loginstring
$authorsarray
retourneboolwhether $login is one of $authors: an identity of the policy, the author's name, or its e-mail's local part