Skip to content

Commit 9e6f97d

Browse files
committed
Revert "add debug logs in migrate flow"
This reverts commit 7c57e67.
1 parent 9b9c90c commit 9e6f97d

File tree

2 files changed

+19
-20
lines changed

2 files changed

+19
-20
lines changed

crates/chat-cli/src/cli/migrate.rs

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ use serde_json::{
1818
Value,
1919
};
2020
use tokio::fs;
21-
use tracing::debug;
2221

2322
use crate::os::Os;
2423
use crate::util::paths::GlobalPaths;
@@ -40,10 +39,19 @@ pub struct MigrateArgs {
4039

4140
impl MigrateArgs {
4241
pub async fn execute(self, os: &mut Os) -> Result<ExitCode> {
42+
// Try to acquire migration lock
43+
let _lock = match acquire_migration_lock()? {
44+
Some(lock) => lock,
45+
None => {
46+
println!("Migration already in progress by another process");
47+
return Ok(ExitCode::SUCCESS);
48+
},
49+
};
50+
4351
let status = detect_migration(os).await?;
4452

4553
if !self.force && matches!(status, MigrationStatus::Completed) {
46-
debug!("✓ Migration already completed");
54+
println!("✓ Migration already completed");
4755
return Ok(ExitCode::SUCCESS);
4856
}
4957

@@ -54,7 +62,7 @@ impl MigrateArgs {
5462
new_settings,
5563
} = status
5664
else {
57-
debug!("✓ No migration needed (fresh install)");
65+
println!("✓ No migration needed (fresh install)");
5866
return Ok(ExitCode::SUCCESS);
5967
};
6068

@@ -73,36 +81,27 @@ impl MigrateArgs {
7381
}
7482
}
7583

76-
// Try to acquire migration lock
77-
let _lock = match acquire_migration_lock()? {
78-
Some(lock) => lock,
79-
None => {
80-
debug!("Migration already in progress by another process");
81-
return Ok(ExitCode::SUCCESS);
82-
},
83-
};
84-
8584
// Migrate database
8685
let db_result = migrate_database(&old_db, &new_db, self.dry_run).await?;
87-
debug!("✓ Database: {}", db_result.message);
86+
println!("✓ Database: {}", db_result.message);
8887

8988
// Migrate settings
9089
let settings_result = migrate_settings(&old_settings, &new_settings, self.dry_run).await?;
91-
debug!("✓ Settings: {}", settings_result.message);
90+
println!("✓ Settings: {}", settings_result.message);
9291
if !settings_result.transformations.is_empty() {
93-
debug!(" Transformations applied:");
92+
println!(" Transformations applied:");
9493
for t in &settings_result.transformations {
95-
debug!(" - {t}");
94+
println!(" - {t}");
9695
}
9796
}
9897

9998
if !self.dry_run {
10099
os.database = crate::database::Database::new().await?;
101100
os.database.set_kiro_migration_completed()?;
102101

103-
debug!("\n✓ Migration completed successfully!");
102+
println!("\n✓ Migration completed successfully!");
104103
} else {
105-
debug!("\n(Dry run - no changes made)");
104+
println!("\n(Dry run - no changes made)");
106105
}
107106

108107
Ok(ExitCode::SUCCESS)

crates/chat-cli/src/database/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,13 +359,13 @@ impl Database {
359359
/// Check if kiro migration has been completed
360360
pub fn is_kiro_migration_completed(&self) -> Result<bool, DatabaseError> {
361361
Ok(self
362-
.get_json_entry::<bool>(Table::State, KIRO_MIGRATION_KEY)?
362+
.get_entry::<bool>(Table::State, KIRO_MIGRATION_KEY)?
363363
.unwrap_or(false))
364364
}
365365

366366
/// Mark kiro migration as completed
367367
pub fn set_kiro_migration_completed(&self) -> Result<(), DatabaseError> {
368-
self.set_json_entry(Table::State, KIRO_MIGRATION_KEY, true)?;
368+
self.set_entry(Table::State, KIRO_MIGRATION_KEY, true)?;
369369
Ok(())
370370
}
371371

0 commit comments

Comments
 (0)