Show build revision and automate Warp sync workflow
This commit is contained in:
@@ -219,6 +219,8 @@ fn app_context() -> Value {
|
||||
json!({
|
||||
"version": env!("CARGO_PKG_VERSION"),
|
||||
"channel": ChannelState::channel().to_string(),
|
||||
"source_commit": crate::build_info::SOURCE_COMMIT,
|
||||
"source_modified": crate::build_info::source_is_dirty(),
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
pub(crate) const SOURCE_COMMIT: &str = env!("GALAXY_BUILD_GIT_COMMIT");
|
||||
|
||||
pub(crate) fn source_is_dirty() -> bool {
|
||||
env!("GALAXY_BUILD_GIT_DIRTY") == "true"
|
||||
}
|
||||
|
||||
pub(crate) fn source_revision_label() -> String {
|
||||
if source_is_dirty() {
|
||||
format!("{SOURCE_COMMIT} (modified)")
|
||||
} else {
|
||||
SOURCE_COMMIT.to_owned()
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) const fn profile() -> &'static str {
|
||||
if cfg!(debug_assertions) {
|
||||
"debug"
|
||||
} else {
|
||||
"release"
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,11 @@ use galaxyui::windowing;
|
||||
|
||||
pub(crate) fn run() -> anyhow::Result<()> {
|
||||
println!("Galaxy version: {:?}", ChannelState::app_version());
|
||||
println!("Build profile: {}", crate::build_info::profile());
|
||||
println!(
|
||||
"Source commit: {}",
|
||||
crate::build_info::source_revision_label()
|
||||
);
|
||||
|
||||
#[cfg(not(windows))]
|
||||
{
|
||||
|
||||
+10
-2
@@ -36,6 +36,7 @@ mod banner;
|
||||
#[cfg(feature = "bedrock_smoke_test")]
|
||||
mod bedrock_smoke_test;
|
||||
mod billing;
|
||||
mod build_info;
|
||||
mod changelog_model;
|
||||
mod chip_configurator;
|
||||
mod cloud_object;
|
||||
@@ -1585,9 +1586,16 @@ pub(crate) fn initialize_app(
|
||||
remote_server::wire_auth_token_rotation(ctx);
|
||||
|
||||
log::info!(
|
||||
"Starting Galaxy with channel state {} and version {:?}",
|
||||
"Starting Galaxy with channel state {}, version {:?}, profile {}, source commit {}{}",
|
||||
ChannelState::debug_str(),
|
||||
ChannelState::app_version()
|
||||
ChannelState::app_version(),
|
||||
build_info::profile(),
|
||||
build_info::SOURCE_COMMIT,
|
||||
if build_info::source_is_dirty() {
|
||||
" (modified)"
|
||||
} else {
|
||||
""
|
||||
}
|
||||
);
|
||||
|
||||
// Teach our app that sometimes option means meta.
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
use galaxy_core::channel::ChannelState;
|
||||
use galaxyui::elements::{
|
||||
Align, CacheOption, ConstrainedBox, Container, CrossAxisAlignment, Element, Flex,
|
||||
FormattedTextElement, Image, Padding, ParentElement, Text,
|
||||
@@ -89,6 +90,31 @@ impl SettingsWidget for AboutPageWidget {
|
||||
)
|
||||
.with_color(appearance.theme().nonactive_ui_text_color().into())
|
||||
.finish();
|
||||
let build = Text::new(
|
||||
format!(
|
||||
"Build {} · {}",
|
||||
ChannelState::channel().local_control_channel_name(),
|
||||
crate::build_info::profile()
|
||||
),
|
||||
appearance.ui_font_family(),
|
||||
12.,
|
||||
)
|
||||
.with_color(appearance.theme().nonactive_ui_text_color().into())
|
||||
.finish();
|
||||
let commit = Text::new(
|
||||
format!("Commit {}", crate::build_info::source_revision_label()),
|
||||
appearance.ui_font_family(),
|
||||
12.,
|
||||
)
|
||||
.with_color(appearance.theme().nonactive_ui_text_color().into())
|
||||
.finish();
|
||||
let build_details = Flex::column()
|
||||
.with_cross_axis_alignment(CrossAxisAlignment::Center)
|
||||
.with_spacing(4.)
|
||||
.with_child(version)
|
||||
.with_child(build)
|
||||
.with_child(commit)
|
||||
.finish();
|
||||
let description = FormattedTextElement::from_str(
|
||||
"Galaxy is a local-first terminal and AI workspace built for developers. Your settings, terminal data, conversations, and Galaxy Drive content stay on this machine in your Galaxy directory. Galaxy sends request data only to the AI providers you configure.",
|
||||
appearance.ui_font_family(),
|
||||
@@ -107,7 +133,7 @@ impl SettingsWidget for AboutPageWidget {
|
||||
.with_spacing(12.)
|
||||
.with_child(icon)
|
||||
.with_child(title)
|
||||
.with_child(version)
|
||||
.with_child(build_details)
|
||||
.with_child(description)
|
||||
.finish(),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user