Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
707 changes: 340 additions & 367 deletions Cargo.lock

Large diffs are not rendered by default.

100 changes: 65 additions & 35 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,48 +18,52 @@ targets = ["x86_64-unknown-linux-gnu", "wasm32-unknown-unknown"]


[dependencies]
eframe = { version = "0.32.3", features = ["glow", "default", "persistence", "ron"] }
egui_extras = { version = "0.32.3", features = ["image", "file", "http"] }
ehttp = { version = "0.5", features = ["native-async"] }
dify = "0.7"
serde = "1"
serde_json = "1.0"
image = "0.25.8"
tempfile = { version = "3.0" }
zip = { version = "5", default-features = false, features = ["deflate"] }
anyhow = "1.0.100"
bytes = "1.10.1"
chrono = { version = "0.4.42", features = ["serde"] }
dify = "0.7.4"
eframe = { version = "0.33.0", features = ["glow", "default", "persistence", "ron"] }
egui_extras = { version = "0.33.0", features = ["image", "file", "http"] }
egui_inbox = { version = "0.10.0", features = ["async", "tokio"] }
ehttp = { version = "0.5.0", features = ["native-async"] }
env_logger = { version = "0.11.8", default-features=false, features = ["auto-color", "humantime"] }
flate2 = { version = "1.1" }
tar = { version = "0.4" }
chrono = { version = "0.4", features = ["serde"] }
octocrab = { version = "0.45.0", default-features = false, features = ["stream"] }
octocrab-wasm = { path = "crates/octocrab-wasm" }
egui_inbox = { version = "0.9.0", features = ["async", "tokio"] }
futures = "0.3"
re_ui = "0.26.0-alpha.1+dev"
futures = "0.3.31"
getrandom = { version = "0.3", features = ["wasm_js"] }
anyhow = "1.0.99"
graphql_client = "0.14.0"
thiserror = "1.0.69"
bytes = "1.10.1"
reqwest = "0.12.23"
hello_egui_utils = "0.9.0"
serde_urlencoded = "0.7"
web-time = "1"
hello_egui_utils = "0.10.0"
image = "0.25.8"
log = "0.4.28"
octocrab = { version = "0.47.0", default-features = false, features = ["stream"] }
octocrab-wasm = { path = "crates/octocrab-wasm" }
re_ui = { git = "https://github.com/rerun-io/rerun", branch = "main" }
reqwest = { version = "0.12.23", default-features = false, features = [
"rustls-tls",
] }
serde = "1.0"
serde_json = "1.0"
serde_urlencoded = "0.7.1"
tar = { version = "0.4.44" }
tempfile = { version = "3.23" }
thiserror = "2.0.17"
web-time = "1.1"
zip = { version = "6.0.0", default-features = false, features = ["deflate"] }

# native:
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
axum = "0.8.6"
clap = { version = "4.5", features = ["derive"] }
env_logger = "0.11.8"
git2 = { version = "0.20.2" }
ignore = { version = "0.4" }
clap = { version = "4.0", features = ["derive"] }
git2 = { version = "0.18" }
tokio = { version = "1.0", features = ["full"] }
tokio = { version = "1.47", features = ["full"] }

# web:
[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bindgen-futures = { version = "0.4" }
wasm-bindgen = { version = "0.2" }
js-sys = { version = "0.3" }
web-sys = { version = "0.3", features = ["Window", "Location", "History", "Navigator", "Clipboard", "Performance"] }
js-sys = { version = "0.3.81" }
wasm-bindgen = { version = "0.2.104" }
wasm-bindgen-futures = { version = "0.4.54" }
web-sys = { version = "0.3.81", features = ["Window", "Location", "History", "Navigator", "Clipboard", "Performance"] }

[profile.release]
opt-level = 2 # fast and small wasm
Expand All @@ -72,12 +76,12 @@ opt-level = 2
[patch.crates-io]

# If you want to use the bleeding edge version of egui and eframe:
egui = { git = "https://github.com/emilk/egui", branch = "main" }
eframe = { git = "https://github.com/emilk/egui", branch = "main" }
egui_extras = { git = "https://github.com/emilk/egui", branch = "main" }
# egui = { git = "https://github.com/emilk/egui", branch = "main" }
# eframe = { git = "https://github.com/emilk/egui", branch = "main" }
# egui_extras = { git = "https://github.com/emilk/egui", branch = "main" }

re_ui = { git = "https://github.com/rerun-io/rerun", branch = "main" }
egui_commonmark = { git = "https://github.com/rerun-io/egui_commonmark.git", branch = "lucas/update-egui-main" }
# re_ui = { git = "https://github.com/rerun-io/rerun", branch = "main" }
# egui_commonmark = { git = "https://github.com/rerun-io/egui_commonmark.git", branch = "lucas/update-egui-main" }

# If you fork https://github.com/emilk/egui you can test with:
# egui = { path = "../egui/crates/egui" }
Expand Down Expand Up @@ -123,23 +127,28 @@ allow_attributes = "warn"
as_ptr_cast_mut = "warn"
await_holding_lock = "warn"
bool_to_int_with_if = "warn"
branches_sharing_code = "warn"
char_lit_as_u8 = "warn"
checked_conversions = "warn"
clear_with_drain = "warn"
cloned_instead_of_copied = "warn"
dbg_macro = "warn"
debug_assert_with_mut_call = "warn"
default_union_representation = "warn"
derive_partial_eq_without_eq = "warn"
disallowed_macros = "warn" # See clippy.toml
disallowed_methods = "warn" # See clippy.toml
disallowed_names = "warn" # See clippy.toml
disallowed_script_idents = "warn" # See clippy.toml
disallowed_types = "warn" # See clippy.toml
doc_comment_double_space_linebreaks = "warn"
doc_include_without_cfg = "warn"
doc_link_with_quotes = "warn"
doc_markdown = "warn"
elidable_lifetime_names = "warn"
empty_enum = "warn"
empty_enum_variants_with_brackets = "warn"
empty_line_after_outer_attr = "warn"
enum_glob_use = "warn"
equatable_if_let = "warn"
exit = "warn"
Expand All @@ -155,8 +164,12 @@ fn_params_excessive_bools = "warn"
fn_to_numeric_cast_any = "warn"
from_iter_instead_of_collect = "warn"
get_unwrap = "warn"
if_let_mutex = "warn"
ignore_without_reason = "warn"
implicit_clone = "warn"
implied_bounds_in_impls = "warn"
imprecise_flops = "warn"
inconsistent_struct_constructor = "warn"
index_refutable_slice = "warn"
inefficient_to_string = "warn"
infinite_loop = "warn"
Expand Down Expand Up @@ -187,6 +200,7 @@ manual_instant_elapsed = "warn"
manual_is_power_of_two = "warn"
manual_is_variant_and = "warn"
manual_let_else = "warn"
manual_midpoint = "warn" # NOTE `midpoint` is often a lot slower for floats, so we have our own `emath::fast_midpoint` function.
manual_ok_or = "warn"
manual_string_new = "warn"
map_err_ignore = "warn"
Expand All @@ -209,12 +223,16 @@ needless_for_each = "warn"
needless_pass_by_ref_mut = "warn"
needless_pass_by_value = "warn"
negative_feature_names = "warn"
non_std_lazy_statics = "warn"
non_zero_suggestions = "warn"
nonstandard_macro_braces = "warn"
option_as_ref_cloned = "warn"
option_option = "warn"
path_buf_push_overwrite = "warn"
pathbuf_init_then_push = "warn"
precedence_bits = "warn"
print_stderr = "warn"
print_stdout = "warn"
ptr_as_ptr = "warn"
ptr_cast_constness = "warn"
pub_underscore_fields = "warn"
Expand All @@ -224,13 +242,16 @@ readonly_write_lock = "warn"
redundant_type_annotations = "warn"
ref_as_ptr = "warn"
ref_option_ref = "warn"
ref_patterns = "warn"
rest_pat_in_fully_bound_structs = "warn"
return_and_then = "warn"
same_functions_in_if_condition = "warn"
semicolon_if_nothing_returned = "warn"
set_contains_or_insert = "warn"
should_panic_without_expect = "warn"
single_char_pattern = "warn"
single_match_else = "warn"
single_option_map = "warn"
str_split_at_newline = "warn"
str_to_string = "warn"
string_add = "warn"
Expand All @@ -245,15 +266,20 @@ too_long_first_doc_paragraph = "warn"
too_many_lines = "warn"
trailing_empty_array = "warn"
trait_duplication_in_bounds = "warn"
transmute_ptr_to_ptr = "warn"
tuple_array_conversions = "warn"
unchecked_duration_subtraction = "warn"
undocumented_unsafe_blocks = "warn"
unimplemented = "warn"
uninhabited_references = "warn"
uninlined_format_args = "warn"
unnecessary_box_returns = "warn"
unnecessary_debug_formatting = "warn"
unnecessary_literal_bound = "warn"
unnecessary_safety_comment = "warn"
unnecessary_safety_doc = "warn"
unnecessary_self_imports = "warn"
unnecessary_semicolon = "warn"
unnecessary_struct_initialization = "warn"
unnecessary_wraps = "warn"
unnested_or_patterns = "warn"
Expand All @@ -263,11 +289,15 @@ unused_self = "warn"
unused_trait_names = "warn"
unwrap_used = "warn"
use_self = "warn"
useless_let_if_seq = "warn"
useless_transmute = "warn"
verbose_file_reads = "warn"
wildcard_dependencies = "warn"
wildcard_imports = "warn"
zero_sized_map_values = "warn"

# TODO: enable?
missing_errors_doc = "allow"

manual_range_contains = "allow" # this is better on 'allow'
map_unwrap_or = "allow" # this is better on 'allow'
16 changes: 9 additions & 7 deletions crates/octocrab-wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,20 @@ version = "0.1.0"
edition = "2024"

[dependencies]
octocrab = { version = "0.45.0", default-features = false }
octocrab = { version = "0.47.0", default-features = false }

[target.'cfg(target_arch = "wasm32")'.dependencies]
http-body = "1.0.1"
tower = "0.5.2"
http = "1.3.1"
http-body-util = "0.1.3"
bytes = "1"
wasm-bindgen-futures = "0.4"
futures = "0.3"
reqwest = "0.12"
thiserror = "2"
bytes = "1.10"
wasm-bindgen-futures = "0.4.54"
futures = "0.3.31"
reqwest = { version = "0.12.23", default-features = false, features = [
"rustls-tls",
] }
thiserror = "2.0"

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
octocrab = { version = "0.45.0", features = ["default-client"] }
octocrab = { version = "0.47.0", features = ["default-client"] }
2 changes: 1 addition & 1 deletion src/github/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ impl GitHubAuth {
self.sender.send(SystemCommand::Refresh).ok();
}
AuthEvent::Error(error) => {
eprintln!("Auth error: {error}");
log::error!("Auth error: {error}");
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/github/auth/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub fn login_github(ctx: &Context, tx: AuthSender) {
let ctx = ctx.clone();
spawn(async move {
if let Err(err) = login(ctx, tx).await {
eprintln!("Error during GitHub login: {err:?}");
log::error!("Error during GitHub login: {err:?}");
}
});
}
Expand Down
20 changes: 10 additions & 10 deletions src/github/pr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,12 +233,12 @@ async fn get_pr_commits(repo: &RepoClient, pr: PrNumber) -> Result<PrWithCommits
// to query all check suites and group them by workflow.
let mut last_suite_per_workflow = HashMap::new();

if let Some(suites) = commit.check_suites {
if let Some(nodes) = suites.nodes {
for node in nodes.into_iter().flatten() {
if let Some(workflow_run) = node.workflow_run.clone() {
last_suite_per_workflow.insert(workflow_run.workflow.id, node);
}
if let Some(suites) = commit.check_suites
&& let Some(nodes) = suites.nodes
{
for node in nodes.into_iter().flatten() {
if let Some(workflow_run) = node.workflow_run.clone() {
last_suite_per_workflow.insert(workflow_run.workflow.id, node);
}
}
}
Expand Down Expand Up @@ -276,10 +276,10 @@ async fn get_pr_commits(repo: &RepoClient, pr: PrNumber) -> Result<PrWithCommits
status = CommitState::Pending;
}

if let Some(run) = &suite.workflow_run {
if let Some(db_id) = run.database_id {
workflow_run_ids.insert(db_id as u64);
}
if let Some(run) = &suite.workflow_run
&& let Some(db_id) = run.database_id
{
workflow_run_ids.insert(db_id as u64);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ impl DiffSource {
if let Ok(link) = url.parse() {
Self::Pr(link)
} else if let Some(link) = parse_github_artifact_url(url) {
return Self::GHArtifact(link);
Self::GHArtifact(link)
} else {
// Try to load it as direct zip/tar.gz URL
Self::Archive(DataReference::Url(url.to_owned()))
Expand Down
6 changes: 4 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ use kitdiff::config::Config;

#[cfg(not(target_arch = "wasm32"))]
fn main() -> eframe::Result<()> {
env_logger::init();

let rt = tokio::runtime::Builder::new_multi_thread()
.enable_all()
.build()
Expand All @@ -32,7 +34,7 @@ fn main() -> eframe::Result<()> {
}

#[cfg(target_arch = "wasm32")]
fn parse_url_query_params() -> Option<DiffSource> {
fn parse_url_query_params() -> Option<kitdiff::DiffSource> {
if let Some(window) = web_sys::window() {
if let Ok(search) = window.location().search() {
let search = search.strip_prefix('?').unwrap_or(&search);
Expand All @@ -43,7 +45,7 @@ fn parse_url_query_params() -> Option<DiffSource> {
if key == "url" {
// URL decode the value
let decoded_url = js_sys::decode_uri_component(value).ok()?.as_string()?;
return Some(DiffSource::from_url(&decoded_url));
return Some(kitdiff::DiffSource::from_url(&decoded_url));
}
}
}
Expand Down
11 changes: 5 additions & 6 deletions src/native_loaders/file_loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,11 @@ impl FileLoader {
let types = types_builder.build().expect("Failed to build types");

for entry in WalkBuilder::new(&base_path).types(types).build().flatten() {
if entry.file_type().is_some_and(|ft| ft.is_file()) {
if let Some(snapshot) = try_create_snapshot(entry.path(), &base_path) {
if sender.send(Some(snapshot)).is_err() {
break;
};
}
if entry.file_type().is_some_and(|ft| ft.is_file())
&& let Some(snapshot) = try_create_snapshot(entry.path(), &base_path)
&& sender.send(Some(snapshot)).is_err()
{
break;
}
}

Expand Down
Loading
Loading