Skip to content

Add update notification and fix Windows build#97

Merged
AlanRockefeller merged 3 commits into
mainfrom
test
Jun 16, 2026
Merged

Add update notification and fix Windows build#97
AlanRockefeller merged 3 commits into
mainfrom
test

Conversation

@AlanRockefeller

@AlanRockefeller AlanRockefeller commented Jun 16, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

Release Notes

  • New Features

    • Added GitHub Releases–based update checking with a dedicated in-app Update dialog.
    • Added Settings toggles for “Check for Updates” and an “Install Updates Automatically” option (shown as unavailable).
    • Added a “Check for Updates” Help menu action and a “Check Now” button.
    • Help/about dialogs now display the current FastStack version.
  • Documentation

    • Updated README with “Updating” instructions and clarified manual vs automatic update/install behavior for source/virtualenv setups.

@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9e114ce5-52aa-4562-a89c-d0f0ffe66be8

📥 Commits

Reviewing files that changed from the base of the PR and between 64fdcd8 and 134c5fa.

📒 Files selected for processing (4)
  • README.md
  • faststack/app.py
  • faststack/qml/SettingsDialog.qml
  • faststack/updater.py
✅ Files skipped from review due to trivial changes (1)
  • README.md
🚧 Files skipped from review as they are similar to previous changes (3)
  • faststack/qml/SettingsDialog.qml
  • faststack/updater.py
  • faststack/app.py

Walkthrough

Introduces a GitHub Releases–based update-check system. A new faststack/updater.py module fetches and compares release versions. AppController gains async background execution, QML-exposed slots, and startup/shutdown wiring. UIState delegates the new slots to QML. SettingsDialog and Main.qml add update preference controls and an update dialog. DEFAULT_CONFIG persists update state, packaging is added as a dependency, and README documents manual upgrade steps.

Changes

GitHub Releases Update-Check Feature

Layer / File(s) Summary
Updater module: data types, version logic, and GitHub fetch
faststack/updater.py, pyproject.toml, requirements.txt
New module defines UpdateCheckError, UpdateInfo dataclass with to_qml_dict(), version detection with fallback chain, normalize_version(), is_newer_version() (using packaging or regex fallback), summarize_release_body(), fetch_latest_release(), and check_for_update(). Adds packaging>=24,<26 dependency.
Config defaults for update state persistence
faststack/config.py
Adds updates section to DEFAULT_CONFIG with check_for_updates, auto_update, last_check_at, and last_ignored_version fields.
AppController: async execution, slots, startup, and shutdown
faststack/app.py, faststack/__main__.py
Imports updater helpers and QDesktopServices; adds _updateCheckFinished signal; creates _update_executor threadpool with token-based staleness guard; implements all QML update slots including cooldown-gated maybe_check_for_updates, async check_for_updates, _on_update_check_finished, skip_update_version, open_update_release; schedules startup check; shuts down executor on exit. Fixes __main__.py to use absolute import.
UIState QML delegation slots
faststack/ui/provider.py
Adds get_current_version, get/set for update_check_enabled and auto_update_enabled, and check_for_updates slots that delegate to AppController.
SettingsDialog: update preferences UI and persistence
faststack/qml/SettingsDialog.qml
Adds updateCheckEnabled and autoUpdateEnabled properties; loads/saves them via uiStateRef; adds Updates section in General tab with checkboxes and a Check Now button.
Main.qml: update dialog, Help menu, and About version
faststack/qml/Main.qml
Adds openUpdateDialog(info) helper, Check for Updates Help menu entry, current version display in About dialog, and a full updateDialog component with release summary, Skip, Open Release, and Close buttons.
README: Updating section
README.md
Documents GitHub Releases update checks, manual upgrade commands for source/virtualenv installs on Windows and Linux/macOS, and the note that automatic installation is disabled for these install types.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant SettingsDialog as SettingsDialog.qml
  participant HelpMenu as Help Menu / Main.qml
  participant UIState as UIState (provider.py)
  participant AppController as AppController (app.py)
  participant Executor as _update_executor
  participant GitHub as GitHub Releases API

  User->>SettingsDialog: Enable "Check for Updates"
  SettingsDialog->>UIState: set_update_check_enabled(true)
  UIState->>AppController: set_update_check_enabled(true)

  User->>HelpMenu: Click "Check for Updates"
  HelpMenu->>AppController: check_for_updates(manual=true)
  AppController->>Executor: submit check_for_update()
  Executor->>GitHub: HTTPS GET /releases/latest
  GitHub-->>Executor: release JSON
  Executor->>AppController: _updateCheckFinished.emit(UpdateInfo)
  AppController->>HelpMenu: openUpdateDialog(info)
  HelpMenu->>User: Show update dialog (Skip / Open Release)
  User->>AppController: open_update_release(url)
  AppController->>GitHub: QDesktopServices.openUrl(releaseUrl)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • AlanRockefeller/faststack#41: Modifies faststack/app.py shutdown logic including background executor teardown, directly related to this PR's addition of _update_executor shutdown in the same path.
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title mentions 'fix Windows build' but the changeset focuses primarily on adding update notification functionality across multiple files; Windows build fixes are not evident in the provided changes. Update the title to accurately reflect the main change: 'Add update notification feature' or similar, and clarify what Windows build issue was fixed in the PR description.
Docstring Coverage ⚠️ Warning Docstring coverage is 52.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 64fdcd896a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

flat: true
onClicked: {
if (settingsDialog.controllerRef) {
settingsDialog.controllerRef.check_for_updates(true)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Close settings before showing update results

When a newer release is found from the Settings dialog's "Check Now" button, this call leaves SettingsDialog open with modality: Qt.ApplicationModal while _on_update_check_finished opens the update Dialog on the main ApplicationWindow. In that path the update dialog is attached to a window that remains blocked/covered by the application-modal settings window, so users may see no actionable result until they dismiss Settings; close or hide Settings before starting/showing the update result, or show the result in the settings window itself.

Useful? React with 👍 / 👎.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@faststack/app.py`:
- Around line 6267-6314: In the check_for_updates() method, add an early guard
check for _shutting_down (similar to existing pattern in codebase) to return
before setting _update_check_inflight to True. Wrap the
_update_executor.submit() call in a try-except block to catch RuntimeError,
reset _update_check_inflight to False on failure, log a warning, and return
early. Additionally, guard the signal emission (_updateCheckFinished.emit)
inside the _done callback function with a _shutting_down check to prevent
emitting signals after shutdown has begun.

In `@faststack/qml/SettingsDialog.qml`:
- Around line 803-808: The autoUpdateBox CheckBox component has a hard-coded
checked property set to false on line 807, which causes the dialog to display an
incorrect state when loaded, mismatching the persisted autoUpdateEnabled value
that gets saved. Replace the hard-coded checked: false binding with a dynamic
binding to the actual persisted autoUpdateEnabled property value, so the
checkbox reflects the correct saved state when the SettingsDialog loads.

In `@faststack/updater.py`:
- Around line 169-185: The code assumes payload returned from
fetch_latest_release is a dict and calls .get() on it without validation, but if
fetch_latest_release returns valid JSON with a non-dict top-level type, it will
raise AttributeError instead of UpdateCheckError. Add an explicit type check
immediately after calling fetch_latest_release to verify that payload is a dict,
and if not, raise UpdateCheckError with a message indicating the unexpected
payload shape. This ensures all error conditions raise UpdateCheckError as per
the module's contract rather than allowing AttributeError to propagate.

In `@README.md`:
- Around line 92-95: The update command in lines 92-95 references the virtualenv
directory as `.venv/Scripts/python.exe`, but the installation instructions at
line 73 create the virtualenv as `venv` (without the dot prefix). Change `.venv`
to `venv` in the pip install command to match the directory name created during
installation, ensuring users following the instructions exactly will not
encounter path errors when running the update command.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 374da756-025e-441f-afd7-f840c66b2a82

📥 Commits

Reviewing files that changed from the base of the PR and between c1549b1 and 64fdcd8.

📒 Files selected for processing (10)
  • README.md
  • faststack/__main__.py
  • faststack/app.py
  • faststack/config.py
  • faststack/qml/Main.qml
  • faststack/qml/SettingsDialog.qml
  • faststack/ui/provider.py
  • faststack/updater.py
  • pyproject.toml
  • requirements.txt

Comment thread faststack/app.py
Comment thread faststack/qml/SettingsDialog.qml
Comment thread faststack/updater.py
Comment thread README.md
@AlanRockefeller AlanRockefeller merged commit 70e110b into main Jun 16, 2026
5 checks 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