Skip to content

Fix version detection in re_viewer/build.rs #3842

@jprochazk

Description

@jprochazk

Something caused the CI to build the examples_manifest.json pointing to app.rerun.io to the commit 00fa796 instead of the version tag 0.9.1. That logic lives in this function:

fn get_base_url() -> Result<String> {
let mut base_url = re_build_tools::get_and_track_env_var("EXAMPLES_MANIFEST_BASE_URL")
.unwrap_or_else(|_e| "https://demo.rerun.io/version/nightly".into());
if re_build_tools::is_on_ci() {
let sh = Shell::new()?;
let branch = git_branch_name(&sh)?;
// If we are on `main`, leave the base url at `version/nightly`
if branch != "main" {
if let Some(version) = parse_release_version(&branch) {
// In builds on `release-x.y.z` branches, use `version/{x.y.z}`.
base_url = format!("https://demo.rerun.io/version/{version}");
} else {
// On any other branch, use `commit/{short_sha}`.
let sha = git_short_hash(&sh)?;
base_url = format!("https://demo.rerun.io/commit/{sha}");
}
}
}
Ok(base_url)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    🕸️ webregarding running the viewer in a browser🧑‍💻 dev experiencedeveloper experience (excluding CI)🪳 bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions