Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
0f4dd63
feat(updater): support custom GitHub release sources
WilliamWang1721 Sep 25, 2026
5b3b8fe
fix(updater): invalidate stale checks when the source changes
WilliamWang1721 Sep 25, 2026
dce8742
Merge branch 'main' into feat/custom-update-source-minimal
WilliamWang1721 Sep 26, 2026
ff9f793
fix(ci): satisfy updater formatting and architecture checks
WilliamWang1721 Sep 26, 2026
a57f49f
Merge upstream main into feat/custom-update-source-minimal
WilliamWang1721 Sep 26, 2026
82c735d
Merge upstream main into feat/custom-update-source-minimal
WilliamWang1721 Sep 26, 2026
5d0a9d0
Merge upstream main into feat/custom-update-source-minimal
WilliamWang1721 Sep 26, 2026
a2e45a7
Merge upstream main into feat/custom-update-source-minimal
WilliamWang1721 Sep 27, 2026
b966eae
Merge branch 'main' into feat/custom-update-source-minimal
WilliamWang1721 Sep 27, 2026
4632f1f
Merge branch 'main' into feat/custom-update-source-minimal
WilliamWang1721 Sep 27, 2026
00c206e
Merge upstream main into feat/custom-update-source-minimal
WilliamWang1721 Sep 27, 2026
f7a5d88
Merge upstream main
WilliamWang1721 Sep 28, 2026
4f4caf8
Merge upstream main into feat/custom-update-source-minimal
WilliamWang1721 Sep 28, 2026
b15c57b
Merge upstream main into feat/custom-update-source-minimal
WilliamWang1721 Sep 28, 2026
6b3e45c
Merge upstream main into feat/custom-update-source-minimal
WilliamWang1721 Sep 28, 2026
9826c3f
fix(updater): invalidate stale source checks
WilliamWang1721 Sep 28, 2026
9a415b8
style(updater): format update event
WilliamWang1721 Sep 28, 2026
eb61f69
fix(i18n): localize release source validation
WilliamWang1721 Sep 28, 2026
f56114d
style(updater): format source error mapping
WilliamWang1721 Sep 28, 2026
4bb0810
fix(updater): resolve source validation language
WilliamWang1721 Sep 28, 2026
9d0988f
Merge remote-tracking branch 'origin/main' into feat/custom-update-so…
WilliamWang1721 Sep 28, 2026
7c1ec8d
fix(i18n): localize update source mismatch
WilliamWang1721 Sep 28, 2026
4e47c5c
Merge remote-tracking branch 'origin/main' into feat/custom-update-so…
WilliamWang1721 Sep 28, 2026
15d9197
Merge current main and preserve managed update distribution behavior
WilliamWang1721 Sep 30, 2026
dbfcce9
test(updater): exercise source input, save validation and persisted r…
WilliamWang1721 Sep 30, 2026
611e13e
Merge latest upstream main for strict PR validation
WilliamWang1721 Sep 30, 2026
c6ab9d2
Merge latest upstream main while preserving reviewed feature fixes
WilliamWang1721 Sep 30, 2026
45e8ce4
Merge current upstream mobile changes without expanding feature scope
WilliamWang1721 Sep 30, 2026
edb1880
Merge upstream 2.1.0 and theme improvements while retaining verified …
WilliamWang1721 Sep 30, 2026
c2a3ba3
Merge upstream main into feat/custom-update-source-minimal
WilliamWang1721 Oct 1, 2026
f27044c
Merge current upstream main, preserving reviewed desktop feature beha…
WilliamWang1721 Oct 1, 2026
2b7d5aa
Merge upstream main into feat/custom-update-source-minimal
WilliamWang1721 Oct 1, 2026
7baae46
Merge upstream main into feat/custom-update-source-minimal
WilliamWang1721 Oct 1, 2026
3b54dbc
Merge upstream main into PR #294
WilliamWang1721 Oct 1, 2026
c62a111
Merge upstream main into PR #294
WilliamWang1721 Oct 1, 2026
08bbe9a
Merge upstream main into PR #294
WilliamWang1721 Oct 3, 2026
6b3952d
Merge upstream main into PR #294
WilliamWang1721 Oct 3, 2026
bfbc203
Merge upstream main into feat/custom-update-source-minimal
WilliamWang1721 Oct 4, 2026
5a757fc
Merge upstream main into feat/custom-update-source-minimal
WilliamWang1721 Oct 4, 2026
5bc090d
Merge main into feat/custom-update-source-minimal
WilliamWang1721 Oct 6, 2026
bf3b458
Merge main into feat/custom-update-source-minimal
claude Oct 9, 2026
0115f71
Merge main into feat/custom-update-source-minimal
WilliamWang1721 Oct 11, 2026
598f174
Merge main into feat/custom-update-source-minimal
WilliamWang1721 Oct 11, 2026
8398152
Merge main into feat/custom-update-source-minimal
WilliamWang1721 Oct 13, 2026
50c5e4c
Merge main into feat/custom-update-source-minimal
WilliamWang1721 Oct 13, 2026
c938333
Merge main into feat/custom-update-source-minimal
WilliamWang1721 Oct 14, 2026
9495ede
Merge main into feat/custom-update-source-minimal
WilliamWang1721 Oct 14, 2026
53b63fc
Merge main into feat/custom-update-source-minimal
WilliamWang1721 Oct 14, 2026
3fedc5d
Merge main into feat/custom-update-source-minimal
WilliamWang1721 Oct 15, 2026
874c8ab
Merge main into feat/custom-update-source-minimal
WilliamWang1721 Oct 15, 2026
cbb4e5b
Merge main into feat/custom-update-source-minimal
WilliamWang1721 Oct 16, 2026
3d31be5
Merge main into feat/custom-update-source-minimal
WilliamWang1721 Oct 17, 2026
8fecf57
Merge main into feat/custom-update-source-minimal
WilliamWang1721 Oct 19, 2026
4684890
Merge main into feat/custom-update-source-minimal
WilliamWang1721 Oct 21, 2026
0fcacec
Merge main into feat/custom-update-source-minimal
WilliamWang1721 Oct 21, 2026
eba8088
Merge main into feat/custom-update-source-minimal
WilliamWang1721 Oct 22, 2026
78473c7
Merge main into feat/custom-update-source-minimal
WilliamWang1721 Oct 23, 2026
e5fbb71
Merge main into feat/custom-update-source-minimal
WilliamWang1721 Oct 23, 2026
6b3fe65
Merge main into feat/custom-update-source-minimal
WilliamWang1721 Oct 23, 2026
acfcf25
Merge main into feat/custom-update-source-minimal
WilliamWang1721 Oct 24, 2026
76fbf8b
Merge main into feat/custom-update-source-minimal
WilliamWang1721 Oct 24, 2026
7b87458
Merge main into feat/custom-update-source-minimal
WilliamWang1721 Oct 25, 2026
aa1464e
Merge main into feat/custom-update-source-minimal
WilliamWang1721 Oct 26, 2026
4b967b2
Merge main into feat/custom-update-source-minimal
WilliamWang1721 Oct 26, 2026
b4ef6b5
Merge main into feat/custom-update-source-minimal
WilliamWang1721 Oct 27, 2026
266989c
Merge main into feat/custom-update-source-minimal
WilliamWang1721 Oct 28, 2026
902481f
Merge main into feat/custom-update-source-minimal
WilliamWang1721 Oct 28, 2026
7d43878
Merge main into feat/custom-update-source-minimal
WilliamWang1721 Oct 30, 2026
87a5337
Merge main into feat/custom-update-source-minimal
WilliamWang1721 Oct 31, 2026
f1d16cd
Merge main into feat/custom-update-source-minimal
WilliamWang1721 Nov 1, 2026
71bf437
Merge main into feat/custom-update-source-minimal
WilliamWang1721 Nov 2, 2026
09793aa
Merge main into feat/custom-update-source-minimal
WilliamWang1721 Nov 3, 2026
7b2b12c
Merge main into feat/custom-update-source-minimal
WilliamWang1721 Nov 4, 2026
6b76e3b
Merge main into feat/custom-update-source-minimal
WilliamWang1721 Nov 4, 2026
f597c6d
Merge main into feat/custom-update-source-minimal
WilliamWang1721 Nov 4, 2026
9e66546
Merge main into feat/custom-update-source-minimal
WilliamWang1721 Nov 17, 2026
4589758
Merge main into feat/custom-update-source-minimal
WilliamWang1721 Nov 17, 2026
bfb0458
Merge main into feat/custom-update-source-minimal
WilliamWang1721 Nov 19, 2026
f4bc16f
Merge main into feat/custom-update-source-minimal
WilliamWang1721 Nov 19, 2026
3a70432
Merge main into feat/custom-update-source-minimal
WilliamWang1721 Nov 20, 2026
6a9c76f
Merge main into feat/custom-update-source-minimal
WilliamWang1721 Nov 20, 2026
eb18366
Merge main into feat/custom-update-source-minimal
WilliamWang1721 Nov 21, 2026
1896be8
Merge main into feat/custom-update-source-minimal
WilliamWang1721 Nov 21, 2026
532b7de
Merge main into feat/custom-update-source-minimal
WilliamWang1721 Nov 21, 2026
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Configurable GitHub Release update source

## Status

Accepted for this PR.

## Context

Pebrel currently checks the official GitHub Releases feed only. Fork builds and preview releases need one optional source override without duplicating the updater pipeline.

## Evidence

The existing updater already owns asset selection, size limits, SHA-256 verification, streamed downloads, and platform install handoff. Only release discovery and trusted repository validation need to vary.

## Decision

Persist one optional `update_release_url`. Empty keeps `Kuddev/pebrel`. A custom value must be an HTTPS GitHub Releases URL. `releases` or `releases/latest` selects the repository's latest release; `releases/tag/<tag>` pins an exact release.

The official source keeps its existing 403/429 public-page fallback. Custom sources use the GitHub API directly and do not add another fallback protocol.

## Rejected alternatives

A second updater implementation per source was rejected because it would duplicate asset selection, verification, and install logic. Arbitrary download URLs were rejected because they would weaken repository and asset validation.

## Consequences

Existing settings remain unchanged when the field is absent or empty. Changing the source invalidates assets from another repository during download validation. Custom sources must keep Pebrel's existing native package naming and SHA-256 metadata contract.

## Validation

CI covers the architecture note contract, Rust formatting, native tests, and updater tests. The parser also tests latest-release normalization, explicit prerelease tags, and rejection of non-GitHub release URLs.

## Supersedes

None.

## Revisit when

Revisit if Pebrel supports a non-GitHub release backend or if package identity and verification rules become source-specific.
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Update source result lifetime

## Status

Proposed with PR #294; maintainer review pending.

## Context

The configurable release source is read by manual checks, delayed startup checks,
and cached download hydration. A request can finish after the source changes or
Reset All restores the official source. Per-settings-pane sequencing protects
only one manual check and cannot invalidate startup work or results already queued
for another window.

## Evidence

- update_check::spawn_once and update_check::spawn_gpui_once publish background results.
- SettingsPane::check_for_updates can open its prompt after its state update.
- update_download::cancel invalidates the existing download generation, and
cached assets are validated against the configured source before reuse.
- The focused updater tests run through the repository's GitHub Actions workflows.

## Decision

Increment one process-local generation when the release source changes or all
settings reset. Each manual or startup check captures its generation and drops a
result when it is no longer current. GPUI update events carry the generation until
the main event dispatcher applies them. The About page also keeps its existing
per-pane sequence for repeated checks. Source invalidation clears the pane's
displayed check result and cancels the current download session.

## Rejected alternatives

Comparing source URLs alone would accept an old result if the setting changed
away and back while that request was running. Per-pane sequencing alone leaves
startup checks and another window's event queue unprotected. Cancelling every
network request would require new ownership across the synchronous release
fetcher; ignoring stale results uses the existing generation-based pattern.

## Consequences

Changing or resetting the source invalidates old results across all windows.
A check for the current generation remains usable. A stale cached asset does not
become installable because the existing asset validation still checks its source.

## Validation

The regression is
update_check::tests::invalidating_the_release_source_rejects_an_in_flight_result.
The PR description records GitHub Actions status for the final head; this note
does not claim UI end-to-end validation.

## Supersedes

None. This records result lifetime for
[the configurable release source](2026-09-25-custom-release-source.md).

## Revisit when

Revisit if release checks become cancellable and are actually cancelled on source
change, or if the updater moves source-generation ownership to another module.
4 changes: 4 additions & 0 deletions pebrel_app/i18n/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -1507,6 +1507,10 @@
"network": "Could not download the update. Check your network and proxy settings, or use the Releases page."
},
"auto_download": "Download updates in the background",
"source_label": "Custom release source",
"source_invalid": "Enter an HTTPS GitHub Releases URL; add /tag/<tag> to select a specific release.",
"source_asset_mismatch": "The update package does not match the selected release source. Check for updates again.",
"source_placeholder": "Blank = official · https://github.com/owner/repo/releases",
"stop_download": "Stop download",
"skip_version": "Skip version",
"restart_install": "Restart and install",
Expand Down
4 changes: 4 additions & 0 deletions pebrel_app/i18n/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -1507,6 +1507,10 @@
"network": "无法下载更新。请检查网络和代理设置,或从发布页手动下载。"
},
"auto_download": "在后台预下载更新",
"source_label": "自定义更新地址",
"source_invalid": "请输入 HTTPS GitHub Releases 地址;在末尾添加 /tag/<tag> 可选择指定版本。",
"source_asset_mismatch": "更新安装包与所选更新源不匹配,请重新检查更新。",
"source_placeholder": "留空 = 官方源 · https://github.com/owner/repo/releases",
"stop_download": "停止下载",
"skip_version": "跳过此版本",
"restart_install": "重启并安装",
Expand Down
2 changes: 1 addition & 1 deletion pebrel_app/src/gpui_shell/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ pub(crate) enum GpuiShellEvent {
TrayQuit,
MuxAttach,
RuntimeControl(std::sync::Arc<crate::runtime_api::RuntimeDispatch>),
UpdateAvailable(crate::update_check::UpdateCheckResult),
UpdateAvailable { result: crate::update_check::UpdateCheckResult, source_generation: u64 },
SshPrompt(std::sync::Arc<crate::ssh_prompt::Prompt>),
OpenDirectories(Vec<String>),
ElevatedLaunch(std::sync::Arc<crate::platform::elevation::handover::Dispatch>),
Expand Down
27 changes: 25 additions & 2 deletions pebrel_app/src/gpui_shell/settings_pane.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ pub struct SettingsPane {
about_update: AboutUpdateState,
about_update_seq: u64,
about_last_checked: Option<String>,
update_release_input: Entity<InputState>,
/// 首页「项目与支持」→ 赞助商:独立页面,不是外链行。切换分区时清掉。
about_sponsor_open: bool,
settings_search_input: Entity<InputState>,
Expand Down Expand Up @@ -366,6 +367,13 @@ impl SettingsPane {
let placeholder = localized_input_placeholder(key, language);
input.update(cx, |state, cx| state.set_placeholder(placeholder, window, cx));
}
self.update_release_input.update(cx, |state, cx| {
state.set_placeholder(
language.text(crate::i18n::Message::UpdateSourcePlaceholder),
window,
cx,
)
});
self.settings_search_input.update(cx, |state, cx| {
state.set_placeholder(
language.text(crate::i18n::Message::CommonSearchSettings),
Expand Down Expand Up @@ -1310,15 +1318,23 @@ impl SettingsPane {
}
self.about_update_seq = self.about_update_seq.wrapping_add(1);
let sequence = self.about_update_seq;
let source_generation = crate::update_check::release_source_generation();
self.about_update = AboutUpdateState::Checking;
let window_handle = window.window_handle();
let task = cx.background_executor().spawn(async { crate::update_check::check_now() });
cx.spawn(async move |this, cx| {
let result = task.await;
let prompt = result.as_ref().ok().filter(|result| result.update_available).cloned();
let _ = this.update(cx, |pane, cx| {
let current = this.update(cx, |pane, cx| {
if pane.about_update_seq != sequence {
return;
return false;
}
if !crate::update_check::release_source_is_current(source_generation) {
pane.about_update_seq = pane.about_update_seq.wrapping_add(1);
pane.about_update = AboutUpdateState::Idle;
pane.about_last_checked = None;
cx.notify();
return false;
}
pane.about_last_checked =
Some(chrono::Local::now().format("%Y-%m-%d %H:%M").to_string());
Expand All @@ -1330,9 +1346,16 @@ impl SettingsPane {
Err(error) => AboutUpdateState::Failed(error),
};
cx.notify();
true
});
if !current.unwrap_or(false) {
return;
}
if let Some(result) = prompt {
let _ = window_handle.update(cx, move |_, window, cx| {
if !crate::update_check::release_source_is_current(source_generation) {
return;
}
crate::gpui_shell::workspace::open_update_dialog(result, window, cx);
});
}
Expand Down
70 changes: 64 additions & 6 deletions pebrel_app/src/gpui_shell/settings_pane/about.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,41 @@ impl SettingsPane {
.child(value)
}

pub(super) fn invalidate_update_source(&mut self) {
self.about_update_seq = self.about_update_seq.wrapping_add(1);
crate::update_check::invalidate_release_source();
self.about_update = AboutUpdateState::Idle;
self.about_last_checked = None;
if let Some(asset) = crate::update_download::cached_asset() {
crate::update_download::cancel(&asset);
}
}

fn save_update_release_source(&mut self, window: &mut Window, cx: &mut Context<Self>) {
let language = crate::gpui_shell::config::ui_language(cx);
let raw = self.update_release_input.read(cx).value();
match crate::update_check::normalize_setting(&raw) {
Some(value) => {
self.update_release_input
.update(cx, |input, cx| input.set_value(value.clone(), window, cx));
if value != self.runtime.update_release_url {
self.persist(&[("update_release_url", value)], cx);
Comment thread
WilliamWang1721 marked this conversation as resolved.
Resolved
self.invalidate_update_source();
} else {
self.about_update = AboutUpdateState::Idle;
self.about_last_checked = None;
}
},
None => crate::gpui_shell::toast::toast(
window,
cx,
crate::gpui_shell::toast::ToastKind::Warning,
language.text(crate::i18n::Message::UpdateSourceInvalid).to_owned(),
),
}
cx.notify();
}

pub(super) fn section_home(&mut self, window: &Window, cx: &mut Context<Self>) -> gpui::Div {
let language = crate::gpui_shell::config::ui_language(cx);
let distribution = crate::platform::distribution::current();
Expand Down Expand Up @@ -233,6 +268,22 @@ impl SettingsPane {
.on_click(cx.listener(|this, checked: &bool, _, cx| {
this.persist(&[("auto_download_updates", (*checked as u8).to_string())], cx);
}));
let update_source = h_flex()
.items_center()
.gap_2()
.child(
div()
.debug_selector(|| "update-release-source-input".to_owned())
.w(px(240.0))
.child(Input::new(&self.update_release_input).h(px(32.0))),
)
.child(
NebulaButton::new("save-update-release-source")
.label(language.text(crate::i18n::Message::CommonSave))
.on_click(cx.listener(|this, _, window, cx| {
this.save_update_release_source(window, cx);
})),
);
let last_checked: SharedString = self
.about_last_checked
.clone()
Expand Down Expand Up @@ -272,15 +323,22 @@ impl SettingsPane {
cx,
))
.when(!managed, |column| {
column.child(Self::about_value_row(
language.text(crate::i18n::Message::SettingsAboutLastChecked),
div().text_color(muted).child(last_checked),
cx,
))
column
.child(Self::about_value_row(
language.text(crate::i18n::Message::UpdateSourceLabel),
update_source,
cx,
))
.child(Self::about_value_row(
language.text(crate::i18n::Message::SettingsAboutLastChecked),
div().text_color(muted).child(last_checked),
cx,
))
})
.when_some(distribution.message(), |column, message| {
column.child(div().text_color(muted).child(language.text(message)))
});
let release_page = crate::update_check::release_page();
let actions = crate::gpui_shell::theme::settings_card(v_flex(), cx)
.flex_1()
.min_w(px(280.0))
Expand All @@ -305,7 +363,7 @@ impl SettingsPane {
"about-releases",
IconName::BookOpen,
language.text(crate::i18n::Message::SettingsAboutReleaseNotes),
crate::update_check::RELEASES_PAGE.to_owned(),
release_page,
cx,
))
.child(Self::about_page_row(
Expand Down
6 changes: 6 additions & 0 deletions pebrel_app/src/gpui_shell/settings_pane/initialization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,11 @@ impl SettingsPane {
let appearance_interceptor = cx.listener(Self::intercept_appearance_picker);
subscriptions.push(cx.intercept_keystrokes(appearance_interceptor));

let update_release_input = cx.new(|cx| {
InputState::new(window, cx)
.placeholder(language.text(crate::i18n::Message::UpdateSourcePlaceholder))
.default_value(runtime.update_release_url.clone())
});
let settings_search_input = cx.new(|cx| {
InputState::new(window, cx)
.placeholder(language.text(crate::i18n::Message::CommonSearchSettings))
Expand Down Expand Up @@ -703,6 +708,7 @@ impl SettingsPane {
about_update: AboutUpdateState::Idle,
about_update_seq: 0,
about_last_checked: None,
update_release_input,
about_sponsor_open: false,
settings_search_input,
settings_search_focus: search_header::SearchFocus::default(),
Expand Down
5 changes: 1 addition & 4 deletions pebrel_app/src/gpui_shell/settings_pane/reset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,8 @@ impl SettingsPane {
return;
},
};
self.invalidate_update_source();
let active_section = self.active_section;
let about_update = std::mem::replace(&mut self.about_update, AboutUpdateState::Idle);
let about_last_checked = self.about_last_checked.take();
let about_update_seq = self.about_update_seq;
let proxy_test_seq = self.proxy_test_seq.wrapping_add(1);
let provider_test_seq = self.provider_test_seq.wrapping_add(1);
Expand All @@ -62,8 +61,6 @@ impl SettingsPane {
cx.set_global(settings);
*self = Self::new(window, cx);
self.active_section = active_section;
self.about_update = about_update;
self.about_last_checked = about_last_checked;
self.about_update_seq = about_update_seq;
self.proxy_test_seq = proxy_test_seq;
self.provider_test_seq = provider_test_seq;
Expand Down
Loading
Loading