Skip to content

fix: add zip type to semver-based update checks#2444

Open
prestonbrown wants to merge 2 commits intomainsail-crew:developfrom
prestonbrown:fix/zip-type-update-button
Open

fix: add zip type to semver-based update checks#2444
prestonbrown wants to merge 2 commits intomainsail-crew:developfrom
prestonbrown:fix/zip-type-update-button

Conversation

@prestonbrown
Copy link
Copy Markdown

Summary

Moonraker's type: zip deployments use semver versioning (via release_info.json) just like web and python types. However, the Update Manager panel only checks semver for web and python types, causing zip type entries to fall through to the git_repo code path which checks commitsBehind -- always empty for zip deployments.

This results in zip-type applications perpetually showing UP-TO-DATE even when a newer version is available on GitHub, with the update button permanently disabled.

Root Cause

In Entry.vue, five computed properties gate on ['python', 'web'].includes(this.type) for semver-based update detection. The zip type is not included, so it falls through to commitsBehind.length === 0 which is always true for non-git deployments.

Fix

Add zip to all five type-check arrays in Entry.vue:

  • btnDisabled -- enables update button when semver detects newer version
  • btnIcon -- shows upload icon instead of checkmark
  • btnColor -- shows primary color instead of green
  • btnText -- shows Update instead of Up-to-date
  • Template version link -- makes version clickable to release page

Moonraker's type: zip deployments use semver versioning (via
release_info.json) just like web and python types. However, the
Update Manager panel only checked semver for web and python types,
causing zip type entries to fall through to the git_repo code path
which checks commitsBehind — always empty for zip deployments.

This resulted in zip-type applications perpetually showing UP-TO-DATE
even when a newer version was available on GitHub, with the update
button permanently disabled.

Add zip to all five type-check arrays in Entry.vue so that zip
deployments correctly use semver comparison for update detection.
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Feb 19, 2026

No actionable comments were generated in the recent review. 🎉


📝 Walkthrough

Walkthrough

Updated a single Vue component to introduce isSemverType() and treat zip the same as web/python for semver-related UI behavior, updating multiple getters and template paths accordingly.

Changes

Cohort / File(s) Summary
Semver Type Handling
src/components/panels/Machine/UpdatePanel/Entry.vue
Added public helper isSemverType() and replaced explicit ['python','web'] checks with isSemverType (now including zip) across getters (btnDisabled, btnIcon, btnColor, btnText) and release link path in the template.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I nibble code where types align,
zip joins web in semver line,
Getters tuned and templates sing,
A tiny hop, a useful thing,
Happy builds and carrot wine!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding zip type to semver-based update checks in the Entry.vue component.
Description check ✅ Passed The description is detailed and directly related to the changeset, explaining the problem, root cause, and the fix with specific details about affected properties.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


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.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/components/panels/Machine/UpdatePanel/Entry.vue (1)

274-274: Optional: extract the repeated semver-type guard into a computed property.

['python', 'web', 'zip'] is now spelled out four times in the script section. If a new semver-based type (e.g. pip) is added later, it's easy to update three of the four occurrences and silently miss one, causing a UI regression identical to the one this PR is fixing.

Extracting to a single computed getter eliminates that risk:

♻️ Proposed refactor — add `isSemverType` getter
+    get isSemverType() {
+        return ['python', 'web', 'zip'].includes(this.type)
+    }
+
     get btnDisabled() {
         if (['printing', 'paused'].includes(this.printer_state)) return true
         if (!this.isValid || this.isCorrupt || this.isDirty || this.commitsBehind.length) return false
 
-        if (['python', 'web', 'zip'].includes(this.type)) return !this.semverUpdatable
+        if (this.isSemverType) return !this.semverUpdatable
 
         return this.commitsBehind.length === 0
     }
 
     get btnIcon() {
         if (this.isDetached || !this.isValid || this.isCorrupt || this.isDirty) return mdiCloseCircle
 
-        if (['python', 'web', 'zip'].includes(this.type)) {
+        if (this.isSemverType) {
             if (this.semverUpdatable) return mdiProgressUpload
             else if (this.localVersion === null || this.remoteVersion === null) return mdiHelpCircleOutline
         }
         ...
     }
 
     get btnColor() {
         if (this.isCorrupt || this.isDetached || this.isDirty || !this.isValid) return 'orange'
 
-        if (['python', 'web', 'zip'].includes(this.type) && this.semverUpdatable) return 'primary'
+        if (this.isSemverType && this.semverUpdatable) return 'primary'
         ...
     }
 
     get btnText() {
         ...
-        if (['python', 'web', 'zip'].includes(this.type)) {
+        if (this.isSemverType) {
             if (this.semverUpdatable) return this.$t('Machine.UpdatePanel.Update')
             ...
         }
         ...
     }

The same guard can be applied in the template too:

-<template v-else-if="['web', 'zip'].includes(type) && semverUpdatable">
+<template v-else-if="isSemverType && type !== 'python' && semverUpdatable">

(Or keep the template inline — the template form is less critical since it's a single occurrence.)

Also applies to: 282-285, 295-295, 307-311

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/panels/Machine/UpdatePanel/Entry.vue` at line 274, The
repeated semver-type check (['python','web','zip']) is duplicated across the
Entry.vue script; add a computed getter named isSemverType that returns
['python','web','zip'].includes(this.type) and replace all inline checks
(currently used in the conditions around the semverUpdatable logic—e.g., the if
(['python','web','zip'].includes(this.type) ... usages) with this.isSemverType
so future types need updating in only one place; ensure the new getter is
exported in the component's computed block and update the template/other script
references to use isSemverType.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/components/panels/Machine/UpdatePanel/Entry.vue`:
- Line 274: The repeated semver-type check (['python','web','zip']) is
duplicated across the Entry.vue script; add a computed getter named isSemverType
that returns ['python','web','zip'].includes(this.type) and replace all inline
checks (currently used in the conditions around the semverUpdatable logic—e.g.,
the if (['python','web','zip'].includes(this.type) ... usages) with
this.isSemverType so future types need updating in only one place; ensure the
new getter is exported in the component's computed block and update the
template/other script references to use isSemverType.

prestonbrown added a commit to prestonbrown/helixscreen that referenced this pull request Feb 19, 2026
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