fan out the meta pin by a recorded pin, not by the move
This commit is contained in:
parent
81fd4466a5
commit
2b9927fda2
1 changed files with 489 additions and 75 deletions
|
|
@ -205,9 +205,12 @@ pub(crate) enum Updated {
|
|||
#[derive(Debug, PartialEq, Eq)]
|
||||
pub(crate) struct Report {
|
||||
pub(crate) updated: Updated,
|
||||
/// The commit moved the hyperhive pin from one rev to another, which is
|
||||
/// what the placed agents are rebuilt for. The first commit moves nothing:
|
||||
/// no agent was ever told to build from this repo.
|
||||
/// The hyperhive rev `internal/meta` pins once the update has run.
|
||||
pub(crate) pin: String,
|
||||
/// The commit moved the hyperhive pin from one rev to another. The first
|
||||
/// commit moves nothing. The placed agents are rebuilt for the pin
|
||||
/// `meta_fanout` has not recorded; this decides only while that record
|
||||
/// cannot be read.
|
||||
pub(crate) hyperhive_moved: bool,
|
||||
}
|
||||
|
||||
|
|
@ -258,6 +261,7 @@ pub(crate) async fn update(
|
|||
if flake_file.is_some_and(|f| f.bytes == flake.as_bytes()) && sha_of("flake.lock").is_some() {
|
||||
return Ok(Report {
|
||||
updated: Updated::Unchanged,
|
||||
pin: pin.rev,
|
||||
hyperhive_moved: false,
|
||||
});
|
||||
}
|
||||
|
|
@ -289,6 +293,7 @@ pub(crate) async fn update(
|
|||
.await?;
|
||||
Ok(Report {
|
||||
updated: Updated::Committed,
|
||||
pin: pin.rev,
|
||||
hyperhive_moved: pin.moved,
|
||||
})
|
||||
}
|
||||
|
|
@ -713,6 +718,7 @@ mod tests {
|
|||
got,
|
||||
Report {
|
||||
updated: Updated::Committed,
|
||||
pin: rev('1'),
|
||||
hyperhive_moved: false
|
||||
}
|
||||
);
|
||||
|
|
@ -757,6 +763,7 @@ mod tests {
|
|||
let locker = FakeLocker::locked();
|
||||
let got = run(&forge, &locker, &settings()).await;
|
||||
assert_eq!(got.updated, Updated::Unchanged);
|
||||
assert_eq!(got.pin, rev('1'));
|
||||
assert!(!got.hyperhive_moved);
|
||||
assert!(locker.sent.lock().unwrap().is_empty());
|
||||
assert!(forge.commits.lock().unwrap().is_empty());
|
||||
|
|
@ -865,6 +872,7 @@ mod tests {
|
|||
got,
|
||||
Report {
|
||||
updated: Updated::Committed,
|
||||
pin: rev('3'),
|
||||
hyperhive_moved: true
|
||||
}
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in a new issue