Use effective artifact tag in update checks
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / publish-gitea-release (push) Blocked by required conditions
ci / remote-bench (push) Waiting to run
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / publish-gitea-release (push) Blocked by required conditions
ci / remote-bench (push) Waiting to run
This commit is contained in:
+41
-25
@@ -4134,6 +4134,11 @@ fn update_binary_version_for_installer(local: &str, latest_tag: Option<&str>) ->
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn effective_update_artifact_tag(local: &str, latest_tag: Option<&str>) -> Option<String> {
|
||||||
|
update_binary_version_for_installer(local, latest_tag)
|
||||||
|
.or_else(|| latest_tag.map(ToOwned::to_owned))
|
||||||
|
}
|
||||||
|
|
||||||
fn compare_dotted_versions(left: &str, right: &str) -> std::cmp::Ordering {
|
fn compare_dotted_versions(left: &str, right: &str) -> std::cmp::Ordering {
|
||||||
let left = parse_comparable_version(left);
|
let left = parse_comparable_version(left);
|
||||||
let right = parse_comparable_version(right);
|
let right = parse_comparable_version(right);
|
||||||
@@ -4299,13 +4304,15 @@ fn run_update(config: &dosh::config::ClientConfig, options: UpdateOptions) -> Re
|
|||||||
if let Some(latest_url) = latest_release_download_url(&repo, artifact) {
|
if let Some(latest_url) = latest_release_download_url(&repo, artifact) {
|
||||||
let mut status = "missing";
|
let mut status = "missing";
|
||||||
let mut display_url = latest_url.clone();
|
let mut display_url = latest_url.clone();
|
||||||
if let Some(tag_url) = latest_tag
|
if let Some(tag_url) =
|
||||||
|
effective_update_artifact_tag(local_version, latest_tag.as_deref())
|
||||||
.as_deref()
|
.as_deref()
|
||||||
.and_then(|tag| release_tag_download_url(&repo, tag, artifact))
|
.and_then(|tag| release_tag_download_url(&repo, tag, artifact))
|
||||||
&& url_reachable(&tag_url)?
|
|
||||||
{
|
{
|
||||||
status = "available";
|
|
||||||
display_url = tag_url;
|
display_url = tag_url;
|
||||||
|
if url_reachable(&display_url)? {
|
||||||
|
status = "available";
|
||||||
|
}
|
||||||
} else if url_reachable(&latest_url)? {
|
} else if url_reachable(&latest_url)? {
|
||||||
status = "available";
|
status = "available";
|
||||||
}
|
}
|
||||||
@@ -9556,28 +9563,28 @@ mod tests {
|
|||||||
PendingStreamOpen, PredictMode, Predictor, RESTART_STATUS_SCRIPT, RemoteForward,
|
PendingStreamOpen, PredictMode, Predictor, RESTART_STATUS_SCRIPT, RemoteForward,
|
||||||
STARTUP_INPUT_HOLD, SshConfig, SshPathTokenContext, StartupGateMode, StatusAction,
|
STARTUP_INPUT_HOLD, SshConfig, SshPathTokenContext, StartupGateMode, StatusAction,
|
||||||
UpdateOptions, UpdateRole, auth_allows, cache_key, cache_server_prefix,
|
UpdateOptions, UpdateRole, auth_allows, cache_key, cache_server_prefix,
|
||||||
cleanup_stream_state, clear_cached_credentials, ensure_tui_safe_status_overlay,
|
cleanup_stream_state, clear_cached_credentials, effective_update_artifact_tag,
|
||||||
expand_ssh_path_tokens, input_contains_focus_in, input_matches_escape,
|
ensure_tui_safe_status_overlay, expand_ssh_path_tokens, input_contains_focus_in,
|
||||||
is_local_status_target, is_resume_response_for_client, latest_release_download_url,
|
input_matches_escape, is_local_status_target, is_resume_response_for_client,
|
||||||
load_first_native_identity_with_prompt, native_proxy_udp_warning,
|
latest_release_download_url, load_first_native_identity_with_prompt,
|
||||||
newest_client_trace_path_from, parse_dynamic_forward, parse_escape_key,
|
native_proxy_udp_warning, newest_client_trace_path_from, parse_dynamic_forward,
|
||||||
parse_local_forward, parse_remote_forward, parse_ssh_config, parse_trace_line,
|
parse_escape_key, parse_local_forward, parse_remote_forward, parse_ssh_config,
|
||||||
parse_trace_options, parse_trace_report_options, parse_trace_summary, parse_update_options,
|
parse_trace_line, parse_trace_options, parse_trace_report_options, parse_trace_summary,
|
||||||
post_submit_hold_duration, queue_pending_user_input, queue_stale_pending_user_input,
|
parse_update_options, post_submit_hold_duration, queue_pending_user_input,
|
||||||
raw_contains_host_table, recv_response_until, refresh_live_addr, release_tag_download_url,
|
queue_stale_pending_user_input, raw_contains_host_table, recv_response_until,
|
||||||
release_tag_from_effective_url, release_version_from_tag, render_status_clear,
|
refresh_live_addr, release_tag_download_url, release_tag_from_effective_url,
|
||||||
render_status_overlay, requested_env, resolved_startup_command, retire_stream_state,
|
release_version_from_tag, render_status_clear, render_status_overlay, requested_env,
|
||||||
retransmit_stream_opens, rewrite_forward_command, sanitize_trace_name,
|
resolved_startup_command, retire_stream_state, retransmit_stream_opens,
|
||||||
selected_predict_mode, selected_udp_host, server_version_mismatch,
|
rewrite_forward_command, sanitize_trace_name, selected_predict_mode, selected_udp_host,
|
||||||
should_flush_terminal_input_after_contact, should_health_log_client_start,
|
server_version_mismatch, should_flush_terminal_input_after_contact,
|
||||||
should_hold_during_startup_gate, should_hold_post_submit_input,
|
should_health_log_client_start, should_hold_during_startup_gate,
|
||||||
should_reconnect_before_input_for_local_sleep, should_repaint_idle_terminal,
|
should_hold_post_submit_input, should_reconnect_before_input_for_local_sleep,
|
||||||
should_strip_unowned_terminal_reports, split_after_command_submit, split_trace_tokens,
|
should_repaint_idle_terminal, should_strip_unowned_terminal_reports,
|
||||||
ssh_command_target, ssh_config_uses_proxy, ssh_destination_host, ssh_username,
|
split_after_command_submit, split_trace_tokens, ssh_command_target, ssh_config_uses_proxy,
|
||||||
ssh_with_user, startup_command, status_ssh_target, strip_stale_mouse_reports,
|
ssh_destination_host, ssh_username, ssh_with_user, startup_command, status_ssh_target,
|
||||||
strip_terminal_focus_reports, strip_unowned_terminal_reports, summarize_trace_file,
|
strip_stale_mouse_reports, strip_terminal_focus_reports, strip_unowned_terminal_reports,
|
||||||
summarize_trace_file_with_mode, terminal_private_mode_transition, toml_bare_key_or_quoted,
|
summarize_trace_file, summarize_trace_file_with_mode, terminal_private_mode_transition,
|
||||||
top_trace_events, trace_report_warnings, unix_update_script,
|
toml_bare_key_or_quoted, top_trace_events, trace_report_warnings, unix_update_script,
|
||||||
update_binary_version_for_installer, update_installer_url, update_version_status,
|
update_binary_version_for_installer, update_installer_url, update_version_status,
|
||||||
upsert_managed_block, valid_forward_host, vscode_safe_alias, wake_repaint_retry_deadline,
|
upsert_managed_block, valid_forward_host, vscode_safe_alias, wake_repaint_retry_deadline,
|
||||||
windows_update_script,
|
windows_update_script,
|
||||||
@@ -11296,6 +11303,15 @@ mod tests {
|
|||||||
update_binary_version_for_installer("1.0.0-rc42", Some("v1.0.0")),
|
update_binary_version_for_installer("1.0.0-rc42", Some("v1.0.0")),
|
||||||
None
|
None
|
||||||
);
|
);
|
||||||
|
assert_eq!(
|
||||||
|
effective_update_artifact_tag("1.0.0-rc41", Some("v1.0.0-rc37")).as_deref(),
|
||||||
|
Some("v1.0.0-rc41")
|
||||||
|
);
|
||||||
|
assert_eq!(
|
||||||
|
effective_update_artifact_tag("1.0.0-rc41", Some("v1.0.0-rc42")).as_deref(),
|
||||||
|
Some("v1.0.0-rc42")
|
||||||
|
);
|
||||||
|
assert_eq!(effective_update_artifact_tag("1.0.0-rc41", None), None);
|
||||||
let config = ClientConfig::default();
|
let config = ClientConfig::default();
|
||||||
let unix = unix_update_script(
|
let unix = unix_update_script(
|
||||||
&config,
|
&config,
|
||||||
|
|||||||
Reference in New Issue
Block a user