Skip to content

Commit fddefd9

Browse files
committed
docs(report): describe the stack-diff surface
PackageChange is what a reviewer reads to decide whether a solve is acceptable, so each field says when it is absent and the kind says what the comparison found. VersionBumped does not imply a direction; the two version fields carry it.
1 parent 302698c commit fddefd9

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

‎src/lib.rs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ pub mod package_solve;
3737
pub mod package_sources;
3838
#[allow(missing_docs, reason = "70 items still undocumented")]
3939
pub mod package_workflow;
40-
#[allow(missing_docs, reason = "11 items still undocumented")]
4140
pub mod report;
4241
#[allow(missing_docs, reason = "7 items still undocumented")]
4342
pub mod resolvo_provider;

‎src/report.rs‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,19 @@ pub fn ordered_packages<'a>(
109109
/// Classification of one logical package between baseline and solved locks.
110110
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
111111
pub enum PackageChangeKind {
112+
/// Present in both locks at the same version.
112113
Unchanged,
114+
/// In the solved lock only: the solve pulled it in.
113115
Added,
116+
/// In the baseline only: nothing in the solved stack needs it.
114117
Removed,
118+
/// In both, at different versions. The direction is not implied; read
119+
/// `baseline_version` against `solved_version` to see which way it moved.
115120
VersionBumped,
116121
}
117122

118123
impl PackageChangeKind {
124+
/// The stable kebab-case name used in reports and machine-read output.
119125
pub fn as_str(self) -> &'static str {
120126
match self {
121127
Self::Unchanged => "unchanged",
@@ -129,11 +135,18 @@ impl PackageChangeKind {
129135
/// One logical package's baseline-vs-solved change for human review.
130136
#[derive(Debug, Clone, PartialEq, Eq)]
131137
pub struct PackageChange {
138+
/// Logical package name, the key the two locks are matched on.
132139
pub name: String,
140+
/// Which side of the comparison this package fell on.
133141
pub kind: PackageChangeKind,
142+
/// Version in the baseline lock. `None` when the package is `Added`.
134143
pub baseline_version: Option<String>,
144+
/// Version in the solved lock. `None` when the package is `Removed`.
135145
pub solved_version: Option<String>,
146+
/// Easyconfig backing the baseline version, when that lock recorded one.
147+
/// Absent for an `Added` package and for a lock written without paths.
136148
pub baseline_easyconfig_path: Option<String>,
149+
/// Easyconfig backing the solved version, on the same terms.
137150
pub solved_easyconfig_path: Option<String>,
138151
}
139152

0 commit comments

Comments
 (0)