From b74359e97643be0f43034c3aeab533a2389a939f Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 30 Nov 2026 18:21:16 +0000 Subject: enstate: submissions waiting for the next switch --migrate first takes the submissions in STATE/incoming, in the order of their names: planned against the schema, stored if accepted (their views follow with the rest), removed, and moved to STATE/refused if refused, which refuses the migration. A dry run (the check before a switch) does so on a copy of the snapshots, changing nothing. --stage leaves a marker, STATE/migrate-due, for the next switch to migrate even if the schema doesn't change; --migrate removes it. Scratch directories are cleaned up without following the symbolic links in them. --- src/main.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index df8b5c0..4c1e24b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -281,6 +281,7 @@ fn run() -> Result { "migrate" => { let migration = enstate::migrate::migrate( &schema, + &schema_bytes, &store, matches.get_flag("dry-run"), &systemctl, @@ -564,6 +565,17 @@ fn print_migration(migration: &enstate::migrate::Migration) -> Result<()> { for reason in &migration.refused { writeln!(out, " {} {reason}", style.paint("31", "refused:"))?; } + for incoming in &migration.incoming { + let what = match (&incoming.plan, migration.dry_run) { + (Some(plan), true) if plan.accepted => "would go in".to_owned(), + (Some(plan), false) if plan.accepted => match &plan.snapshot { + Some(id) => format!("went in: snapshot {id}"), + None => "went in, changing nothing".to_owned(), + }, + _ => style.paint("31", "refused"), + }; + writeln!(out, "incoming {}: {what}", incoming.name)?; + } for (channel, channel_migration) in &migration.channels { writeln!( out, -- cgit v1.3.1