Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
forge
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
certo
forge
Commits
fb443cbd
Commit
fb443cbd
authored
Aug 23, 2026
by
Vladimir Bashkirtsev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated forge to 2.13.21
parent
366c7969
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
143 additions
and
17 deletions
+143
-17
Makefile
Makefile
+5
-5
forge-1.10.0-no_update.patch
forge-1.10.0-no_update.patch
+0
-12
forge-1.10.0.tar.gz
forge-1.10.0.tar.gz
+0
-0
forge-2.13.21.tar.gz
forge-2.13.21.tar.gz
+0
-0
forgecode-2.13.21-no_update.patch
forgecode-2.13.21-no_update.patch
+138
-0
No files found.
Makefile
View file @
fb443cbd
...
...
@@ -5,11 +5,11 @@ forge:
mkdir
-p
/root/.cargo
mount
--bind
.cargo /root/.cargo
tar
xf
forge-
1.10.0
.tar.gz
patch
-Np1
-d
forge-
1.10.0
<
forge-1.10.0
-no_update.patch
cd forge-
1.10.0 && PATH=/build/usr/bin
:
$$PATH APP_VERSION=1.10.0
cargo build --release
cd
forge-
1.10.0
&&
install
-Dm755
target/release/forge /usr/bin/forge
rm
-rf
forge-
1.10.0
tar
xf
forge-
2.13.21
.tar.gz
patch
-Np1
-d
forge-
2.13.21
<
forge-2.13.21
-no_update.patch
cd forge-
2.13.21 && PATH=/build/usr/bin
:
$$PATH APP_VERSION=2.13.21
cargo build --release
cd
forge-
2.13.21
&&
install
-Dm755
target/release/forge /usr/bin/forge
rm
-rf
forge-
2.13.21
umount
/root/.cargo
rm
-rf
/root/.cargo
...
...
forge-1.10.0-no_update.patch
deleted
100644 → 0
View file @
366c7969
diff -uNr forge-1.10.0/crates/forge_main/src/update.rs forge-1.10.0-no_update/crates/forge_main/src/update.rs
--- forge-1.10.0/crates/forge_main/src/update.rs 2025-12-08 22:12:09.000000000 +1030
+++ forge-1.10.0-no_update/crates/forge_main/src/update.rs 2025-12-10 11:19:20.411241167 +1030
@@ -65,6 +65,8 @@
let frequency = update.frequency.unwrap_or_default();
let auto_update = update.auto_update.unwrap_or_default();
+ return;
+
// Check if version is development version, in which case we skip the update
// check
if VERSION.contains("dev") || VERSION == "0.1.0" {
forge-1.10.0.tar.gz
deleted
100644 → 0
View file @
366c7969
File deleted
forge-2.13.21.tar.gz
0 → 100644
View file @
fb443cbd
File added
forgecode-2.13.21-no_update.patch
0 → 100644
View file @
fb443cbd
diff -uNr forgecode-2.13.21/crates/forge_main/src/update.rs forgecode-2.13.21-no_update/crates/forge_main/src/update.rs
--- forgecode-2.13.21/crates/forge_main/src/update.rs 2026-08-01 00:39:10.000000000 +0930
+++ forgecode-2.13.21-no_update/crates/forge_main/src/update.rs 2026-08-23 19:49:01.607754742 +0930
@@ -80,6 +80,8 @@
let auto_update = update.auto_update.unwrap_or_default();
+ return;
+
// Check if version is development version, in which case we skip the update
// check
if VERSION.contains("dev") || VERSION == "0.1.0" {
diff -uNr forgecode-2.13.21/crates/forge_main/src/update.rs.orig forgecode-2.13.21-no_update/crates/forge_main/src/update.rs.orig
--- forgecode-2.13.21/crates/forge_main/src/update.rs.orig 1970-01-01 09:30:00.000000000 +0930
+++ forgecode-2.13.21-no_update/crates/forge_main/src/update.rs.orig 2026-08-01 00:39:10.000000000 +0930
@@ -0,0 +1,122 @@
+use std::sync::Arc;
+
+use colored::Colorize;
+use forge_api::API;
+use forge_config::{Update, UpdateFrequency};
+use forge_select::ForgeWidget;
+use forge_tracker::VERSION;
+use update_informer::{Check, Version, registry};
+
+/// Runs the official installation script to update Forge, failing silently.
+/// When `auto_update` is true, exits immediately after a successful update
+/// without prompting the user.
+async fn execute_update_command(api: Arc<impl API>, auto_update: bool) {
+ // Spawn a new task that won't block the main application
+ let output = api
+ .execute_shell_command_raw("curl -fsSL https://forgecode.dev/cli | sh")
+ .await;
+
+ match output {
+ Err(err) => {
+ // Send an event to the tracker on failure
+ // We don't need to handle this result since we're failing silently
+ let _ = send_update_failure_event(&format!("Auto update failed {err}")).await;
+ }
+ Ok(output) => {
+ if output.success() {
+ let should_exit = if auto_update {
+ true
+ } else {
+ let answer = forge_select::ForgeWidget::confirm(
+ "You need to close forge to complete update. Do you want to close it now?",
+ )
+ .with_default(true)
+ .prompt();
+ answer.unwrap_or_default().unwrap_or_default()
+ };
+ if should_exit {
+ std::process::exit(0);
+ }
+ } else {
+ let exit_output = match output.code() {
+ Some(code) => format!("Process exited with code: {code}"),
+ None => "Process exited without code".to_string(),
+ };
+ let _ =
+ send_update_failure_event(&format!("Auto update failed, {exit_output}",)).await;
+ }
+ }
+ }
+}
+
+async fn confirm_update(version: Version) -> bool {
+ let answer = ForgeWidget::confirm(format!(
+ "Confirm upgrade from {} -> {} (latest)?",
+ VERSION.to_string().bold().white(),
+ version.to_string().bold().white()
+ ))
+ .with_default(true)
+ .prompt();
+
+ match answer {
+ Ok(Some(result)) => result,
+ Ok(None) => false, // User canceled
+ Err(_) => false, // Error occurred
+ }
+}
+
+fn should_check_for_updates(frequency: &UpdateFrequency) -> bool {
+ !matches!(frequency, UpdateFrequency::Never)
+}
+
+/// Checks if there is an update available
+pub async fn on_update(api: Arc<impl API>, update: Option<&Update>) {
+ let update = update.cloned().unwrap_or_default();
+ let frequency = update.frequency.unwrap_or_default();
+
+ if !should_check_for_updates(&frequency) {
+ return;
+ }
+
+ let auto_update = update.auto_update.unwrap_or_default();
+
+ // Check if version is development version, in which case we skip the update
+ // check
+ if VERSION.contains("dev") || VERSION == "0.1.0" {
+ // Skip update for development version 0.1.0
+ return;
+ }
+
+ let informer = update_informer::new(registry::GitHub, "tailcallhq/forgecode", VERSION)
+ .interval(frequency.into());
+
+ if let Some(version) = informer.check_version().ok().flatten()
+ && (auto_update || confirm_update(version).await)
+ {
+ execute_update_command(api, auto_update).await;
+ }
+}
+
+/// Sends an event to the tracker when an update fails
+async fn send_update_failure_event(error_msg: &str) -> anyhow::Result<()> {
+ tracing::error!(error = error_msg, "Update failed");
+ // Always return Ok since we want to fail silently
+ Ok(())
+}
+
+#[cfg(test)]
+mod tests {
+ use pretty_assertions::assert_eq;
+
+ use super::*;
+
+ #[test]
+ fn test_should_skip_update_check_when_frequency_is_never() {
+ let fixture = UpdateFrequency::Never;
+
+ let actual = should_check_for_updates(&fixture);
+
+ let expected = false;
+ assert_eq!(actual, expected);
+ }
+}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment