Skip to main content

Module landing

Module landing 

Source
Expand description

The version a landing allocates (ADR 0134): what the integration executor raises the trunk’s version to when it lands a pull request, decided from three things and nothing else — the version the trunk declares, how far the pull request moves the public contract (ADR 0051’s measurement), and the repository’s typed release: policy.

trunk version ─┐
observed impact ─ compat::Policy::required_of ─ required ─┐
policy floor ── (an exemption lowers only this) ── floor ─┴─ max ─ selected ─ next

The decision is a pure function, so the executor, majordomus release next, the Cockpit and a test all reach the same answer from the same inputs. Nothing here reads a branch’s own version: the number is always the trunk’s raised, which is what makes a retried or repeated landing allocate once and two pull requests unable to hold the same number.

use majordomus_cli::release::compat::Impact;
use majordomus_cli::release::landing::{decide, Allocation, ReleasePolicy};
use majordomus_cli::release::version::Version;

let policy = ReleasePolicy { allocation: Allocation::Landing, floor: Impact::Minor, exempt: vec![] };
// a fix behind the boundary still advances a minor under a minor floor
let d = decide(Version::parse("0.20.0").unwrap(), Impact::Patch, &policy, &["src/a.rs".into()]);
assert_eq!(d.next_version, "0.21.0");
assert_eq!(d.selected, Impact::Minor);

Structs§

AppliedExemption
The exemption a decision applied, by class.
LandingDecision
What a landing allocates, and why, step by step.
ReleaseExemption
One exemption class of release.exempt: a pull request whose every changed path one class covers is not held to the floor. The compatibility requirement still applies.
ReleasePolicy
The release: block of .ai/repo/policy.yaml (ADR 0134).
Unreadable
Why a landing decision could not be made: an input that could not be read. Never a decision of its own — an unreadable trunk or surface is refused, not guessed.

Enums§

Allocation
Whether the integration executor allocates the version when it lands a pull request.

Constants§

DECISION_SCHEMA
The schema a LandingDecision carries, so a reader knows which rules reached it.

Functions§

decide
Decide what a landing allocates (ADR 0134 §2-4).
decide_adding
decide for a change that also says which of its changed paths it added: the record of the trunk’s release lands at that release’s number only when the change adds it. decide knows of no added path, so it never grants that.
next_for
What a landing of head onto base allocates in the repository at root: the trunk’s version is the manifest at base; the movement is the committed registry where head forked from base against head’s, and the changed paths are git’s over the same span. Measuring from the fork point is what makes the movement the pull request’s own: a head that is behind base lacks what base added since, and read against base itself that absence would count as a removal it never made. Everything is read from git, so the answer is the same in any checkout and does not depend on which executable runs.