Add bt datasets snapshots for dataset version control#176
Conversation
bt datasets snapshots for better dataset version controlbt datasets snapshots for dataset version control
|
Latest downloadable build artifacts for this PR commit
Available artifact names
|
There was a problem hiding this comment.
cargo clippy tells me to cargo clippy --fix --bin "bt" -p bt --, which gives a small formatting diff, nothing blocking but nice to format.
diff --git a/src/functions/pull.rs b/src/functions/pull.rs
index 8f2e6de..0b51ef2 100644
--- a/src/functions/pull.rs
+++ b/src/functions/pull.rs
@@ -1410,7 +1410,7 @@ fn format_py_value_inner(value: &Value, depth: usize) -> String {
let closing_indent = " ".repeat(depth);
let mut out = String::from("{\n");
let mut entries = object.iter().collect::<Vec<_>>();
- entries.sort_by(|(left, _), (right, _)| left.cmp(right));
+ entries.sort_by_key(|(left, _)| *left);
for (index, (key, val)) in entries.into_iter().enumerate() {
out.push_str(&indent);
out.push_str(&serde_json::to_string(key).unwrap_or_else(|_| "\"\"".to_string()));
diff --git a/src/sql.rs b/src/sql.rs
index 4e4b4ac..f6619e4 100644
--- a/src/sql.rs
+++ b/src/sql.rs
@@ -258,11 +258,10 @@ fn handle_key_event(
KeyCode::End => app.move_end(),
KeyCode::Up => app.history_prev(),
KeyCode::Down => app.history_next(),
- KeyCode::Char(ch) if !key.modifiers.contains(KeyModifiers::CONTROL) => {
- if !key.modifiers.contains(KeyModifiers::ALT) {
+ KeyCode::Char(ch) if !key.modifiers.contains(KeyModifiers::CONTROL)
+ && !key.modifiers.contains(KeyModifiers::ALT) => {
app.insert_char(ch);
}
- }
_ => {}
}
diff --git a/src/traces.rs b/src/traces.rs
index 94e0b3d..c136548 100644
--- a/src/traces.rs
+++ b/src/traces.rs
@@ -2084,8 +2084,8 @@ fn handle_span_detail_key(
}
}
}
- KeyCode::Char('d') if key.modifiers.contains(KeyModifiers::CONTROL) => {
- if app.detail_pane_focus == DetailPaneFocus::Detail {
+ KeyCode::Char('d') if key.modifiers.contains(KeyModifiers::CONTROL)
+ && app.detail_pane_focus == DetailPaneFocus::Detail => {
if detail_message_list_mode {
if app.detail_view == DetailView::Thread {
for _ in 0..10 {
@@ -2100,7 +2100,6 @@ fn handle_span_detail_key(
scroll_detail_down_bounded(app, 10)
}
}
- }
_ => {}
}
Ok(())
@@ -5229,11 +5228,10 @@ fn parse_trace_url(input: &str) -> Result<ParsedTraceUrl> {
parsed.span_id = Some(value.to_string());
}
}
- "tvt" => {
- if !value.is_empty() {
+ "tvt"
+ if !value.is_empty() => {
parsed.trace_view_type = Some(value.to_string());
}
- }
_ => {}
}
}
|
I have never used |
Maybe make an empty list instead? |
|
Why is there a |
|
Maybe a |
Is it normal that I get |
When in non interactive mode, the |
We were not parsing the no-op case correctly - if nothing gets written (ie you run restore on case where there is no diff) then no xact id is returned. Fixed this, it should display an appropriate message now. |
I think the |
oh sorry misread, I added it to |
|
I got confused yesterday (was a bit ill....) I was thinking of snapshot delete that's on me 😅 (though I also think requiring the |
|
Anyway lgtm |
TL;DR
Follow up to: #104
Adds
bt datasets snapshotsfor managing saved dataset snapshots from the CLI: list, create, and restore dataset states from saved snapshots.What changed?
Added dataset snapshot management functionality:
bt datasets snapshotscommand with subcommands:list,create,deleteandrestore--xact-idis omitted--snapshot--forceis passedfound_existingfor create responsesAdded test coverage:
x-bt-found-existing, and snapshot listingHow to test?