Skip to content

fix: use commits behind for git repo updates - #2022

Merged
pedrolamas merged 2 commits into
fluidd-core:developfrom
pedrolamas:pedrolamas/fix-git-repo-update-check
Nov 9, 2026
Merged

pedrolamas merged 2 commits into
fluidd-core:developfrom
pedrolamas:pedrolamas/fix-git-repo-update-check

Conversation

@pedrolamas

@pedrolamas pedrolamas commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Moonraker's git_repo versions come from git describe (<tag>-<commit count>), which SemVer misorders for prerelease tags: 1.4.2-beta-4-53 sorts before 1.4.2-beta-4-6, so a repo behind its remote was shown as up-to-date.

hasUpdate now treats a git repo as outdated when current_hash !== remote_hash (Moonraker's own is_current() check) and commits_behind_count > 0. The count alone isn't enough: on stable/beta, Moonraker can reset remote_hash to current_hash while leaving the count set, making an update a no-op. Other updater types keep the SemVer comparison.

Fixes #2021

🤖 Generated with Claude Code

Moonraker's git_repo versions come from `git describe`, which SemVer
misorders for prerelease tags (`1.4.2-beta-4-53` < `1.4.2-beta-4-6`),
so repos behind their remote were shown as up-to-date.

Fixes fluidd-core#2021

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
@pedrolamas
pedrolamas requested a balanced review from Copilot November 9, 2026 17:40
@pedrolamas pedrolamas added the GH - Bug Something isn't working label Nov 9, 2026
@pedrolamas pedrolamas added this to the 1.37.8 milestone Nov 9, 2026
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown

Bundle size report (gzip)

Chunk Base Head Δ
sw.js 11.2 kB 11.2 kB -10 B
assets/index-*.js 171.9 kB 171.9 kB +5 B
assets/Configure-*.js 773 B 777 B +4 B
assets/Timelapse-*.js 1.9 kB 1.9 kB +4 B
assets/JobHistoryItemStatus-*.js 1.2 kB 1.3 kB +3 B
assets/Settings-*.js 23.7 kB 23.7 kB +3 B
assets/GcodePreview-*.js 368 B 370 B +2 B
assets/System-*.js 2.4 kB 2.4 kB +2 B
assets/Tune-*.js 3.5 kB 3.5 kB -2 B
assets/AfcPrintStartDialogTool-*.js 2.4 kB 2.4 kB +1 B
assets/AppBtnCollapseGroup-*.js 639 B 640 B +1 B
assets/AppColorPicker-*.js 13.0 kB 13.0 kB +1 B
assets/AppNamedSlider-*.js 1.8 kB 1.8 kB +1 B
assets/Console-*.js 369 B 368 B -1 B
assets/ConsoleCard-*.js 2.0 kB 2.0 kB +1 B
assets/DiskUsageCard-*.js 3.2 kB 3.2 kB +1 B
assets/FileSystem-*.js 32.9 kB 32.9 kB -1 B
assets/FullscreenCamera-*.js 427 B 428 B +1 B
assets/GcodePreviewCard-*.js 14.0 kB 14.0 kB -1 B
assets/History-*.js 4.5 kB 4.5 kB -1 B
assets/JobQueueCard-*.js 4.5 kB 4.5 kB +1 B
assets/MacroCategorySettings-*.js 2.0 kB 2.0 kB +1 B
assets/TimelapseRenderSettingsDialog-*.js 1.8 kB 1.8 kB +1 B
Total 2.9 MB 2.9 MB +17 B

120 chunks compared, 23 changed. Sizes are gzip, matching what nginx serves.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Note

Copilot was unable to complete this review at the selected tier due to model policy or plan restrictions.

🟢 Approval recommended

The change is narrowly scoped to git_repo update detection by switching to the backend-provided commits_behind_count while preserving existing behavior for other updater types, with only a moderate follow-up note about null-safe gating.

No open issues 🎉

What changed in this PR

This pull request fixes update detection for Moonraker git_repo updaters by using the backend-provided “commits behind” count instead of SemVer-comparing git describe-derived version strings, which can sort prerelease commit-count suffixes incorrectly and mask available updates.

Changes:

  • Update hasUpdate logic for git_repo entries to rely on commits_behind_count > 0.
  • Preserve existing update detection behavior for other updater types (package counts, SemVer comparison, and hash fallback).

Outstanding review note (moderate): The current check uses 'commits_behind_count' in versionInfo, which may short-circuit SemVer/hash checks even if the value is null/undefined or appears for a non-git_repo updater in the future; gate the logic explicitly on configured_type === 'git_repo' and treat the count as null-safe.

This pull request requires changes.

File Summary
src/​store/​version/​getters.ts Adjusts hasUpdate for Moonraker git_repo updaters to use commits_behind_count rather than SemVer comparisons of git describe version strings.

Review effort: Balanced

@pedrolamas pedrolamas left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

🤖 AI Code Review — 2 finding(s) across 1 file(s)

Switching git_repo off SemVer is the right fix for #2021. Only GitRepo carries commits_behind_count, so system packages, web/zip, and python updaters keep the existing comparison. The new predicate is wider than Moonraker's own "is current" check, and the getter has no regression test.

Comment thread src/store/version/getters.ts Resolved
On stable/beta channels Moonraker can leave commits_behind_count set
after resetting remote_hash to current_hash, in which case an update
is a no-op.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
@pedrolamas
pedrolamas merged commit 37885d0 into fluidd-core:develop Nov 9, 2026
@pedrolamas
pedrolamas deleted the pedrolamas/fix-git-repo-update-check branch November 9, 2026 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

GH - Bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Git repository updates incorrectly shown as up-to-date due to SemVer comparison

2 participants