Skip to content

Commit

Permalink
Fix the app_url for notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
jleibs committed Apr 9, 2024
1 parent 2e58034 commit 318996d
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions rerun_py/src/python_bridge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1096,7 +1096,7 @@ fn version() -> String {

/// Get a url to an instance of the web-viewer
///
/// This may point to rerun.io/viewer or localhost depending on
/// This may point to app.rerun.io or localhost depending on
/// whether [`start_web_viewer_server()`] was called.
#[pyfunction]
fn get_app_url() -> String {
Expand All @@ -1106,13 +1106,16 @@ fn get_app_url() -> String {
}

let build_info = re_build_info::build_info!();
if let Some(short_git_hash) = build_info.git_hash.get(..7) {
format!("https://rerun.io/viewer/commit/{short_git_hash}")

if build_info.is_final() {
format!("https://app.rerun.io/version/{}", build_info.version)
} else if let Some(short_git_hash) = build_info.git_hash.get(..7) {
format!("https://app.rerun.io/commit/{short_git_hash}")
} else {
re_log::warn_once!(
"No valid git hash found in build info. Defaulting to rerun.io/viewer for app url."
"No valid git hash found in build info. Defaulting to app.rerun.io for app url."
);
"https://rerun.io/viewer".to_owned()
"https://app.rerun.io".to_owned()
}
}

Expand Down

0 comments on commit 318996d

Please sign in to comment.