Skip to content

feat(tauri): add server JAR self-update and improve CI workflows#147

Merged
lcomplete merged 2 commits into
mainfrom
dev
Apr 26, 2026
Merged

feat(tauri): add server JAR self-update and improve CI workflows#147
lcomplete merged 2 commits into
mainfrom
dev

Conversation

@lcomplete
Copy link
Copy Markdown
Owner

Summary

  • Add check_server_update and install_server_update Tauri commands that fetch the latest huntly-server.jar from GitHub releases and atomically install it into the app data directory, with backup/rollback on failure
  • Add server_auto_update setting and SettingsTab UI for manual/automatic server JAR updates with version display and status alerts
  • Fix Tauri updater endpoint URL to use the tauri/-namespaced release tag
  • Refactor Tauri build workflow: upgrade all actions to v4, switch Windows build target to x86_64-pc-windows-msvc, use ./mvnw, add embedded JRE build step, add dynamic updater pubkey config
  • Add new tauri-release.yml workflow for publishing Tauri releases
  • Fix extension-build workflow yarn cache path (app/clientapp/extension)
  • Add manual chunk splitting for MUI/React vendors in extension wxt.config.ts
  • Mark shortcut prompts with includeCurrentPageContext: true and disable when page is not ready; add corresponding WelcomePane tests

Test plan

  • Build Tauri app locally with yarn tauri dev and verify settings tab shows server JAR update section
  • Test "Check JAR" button triggers GitHub API call and shows update availability
  • Test "Download & Install" button downloads and installs the JAR, then restarts the server
  • Verify server_auto_update toggle triggers update check on enable
  • Run extension tests: cd app/extension && yarn test
  • Run Tauri frontend build: cd app/tauri && yarn build
  • Verify extension-build.yml workflow uses correct yarn cache path

🤖 Generated with Claude Code

lcomplete and others added 2 commits April 26, 2026 17:25
- Add check_server_update and install_server_update Tauri commands that
  fetch the latest huntly-server.jar from GitHub releases and install it
  into the app data directory; expose server_auto_update setting
- Add SettingsTab UI for manual and automatic server JAR updates with
  version display and status alerts
- Fix updater endpoint URL to use tauri-namespaced release tag
- Refactor Tauri build workflow: upgrade all actions to v4, switch Windows
  target to x86_64, use mvnw, add embedded JRE build, dynamic updater config
- Add tauri-release.yml workflow for publishing Tauri releases
- Fix extension-build workflow yarn cache path to app/extension/yarn.lock
- Add manual chunk splitting for MUI/React vendors in extension wxt.config
- Mark shortcut prompts with includeCurrentPageContext and disable when
  page is not ready; add corresponding WelcomePane tests

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented Apr 26, 2026

🤖 Augment PR Summary

Summary: This PR adds a self-update mechanism for the bundled Huntly server JAR in the Tauri desktop app and improves release/build automation.

Changes:

  • Added Tauri commands check_server_update and install_server_update to discover and atomically install the latest huntly-server.jar from GitHub releases (with backup/rollback).
  • Introduced a new server_auto_update setting and wired it into the desktop UI, including status/alerts and manual “Check JAR” / “Download & Install” actions.
  • Updated server runtime discovery so the app prefers a writable app-data JAR (when present) and falls back to the bundled resource JAR.
  • Enabled updater permissions in Tauri capabilities and fixed the updater endpoint URL to the tauri/-namespaced “latest” manifest.
  • Refactored CI workflows: action upgrades to v4, Windows target change to x86_64-pc-windows-msvc, Maven wrapper usage, and an embedded-JRE build step.
  • Added a dedicated tauri-release.yml workflow to publish desktop bundles and generate/upload latest.json updater manifests.
  • Extension improvements: fixed yarn cache path, added manual chunk splitting for MUI/React vendors, and ensured shortcut prompts include current page context (with new tests).

Technical Notes: Server JAR updates use the GitHub Releases API and validate the downloaded JAR’s embedded version metadata before swapping the file in the app data directory.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 3 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

ServerInfo {
jar_version,
java_version,
jar_path: jar_path_buf.as_ref().map(canonicalize),
Copy link
Copy Markdown

@augmentcode augmentcode Bot Apr 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

collect_server_info maps paths through canonicalize(), which does into_string().unwrap() and can panic for non-Unicode filesystem paths (possible on Windows), and the server JAR path can now come from app_data_dir. A panic here would crash get_server_info/UI rather than returning a recoverable error.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

std::fs::remove_file(&backup_path).map_err(|e| e.to_string())?;
}
if dest_path.exists() {
std::fs::rename(&dest_path, &backup_path).map_err(|e| e.to_string())?;
Copy link
Copy Markdown

@augmentcode augmentcode Bot Apr 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In install_server_update, if rename(dest_path, backup_path) fails (e.g. the JAR is still locked), the function returns immediately and leaves the freshly-downloaded temp_path on disk. That can leave large stray files behind across repeated failures.

Severity: low

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

fn is_server_jar_asset(asset_name: &str, version: &str) -> bool {
asset_name == SERVER_JAR_FILE_NAME
|| asset_name == format!("huntly-server-{}.jar", version)
|| (asset_name.starts_with("huntly-server-") && asset_name.ends_with(".jar"))
Copy link
Copy Markdown

@augmentcode augmentcode Bot Apr 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is_server_jar_asset currently matches any huntly-server-*.jar, which can unintentionally select *-sources.jar/*-javadoc.jar if those are ever attached to a release. That would make the updater download a non-runnable JAR.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

@lcomplete lcomplete merged commit 2313daf into main Apr 26, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant