Repository navigation
feat: add update check - #1264
Conversation
ef08d9e to
af80edc
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR adds an update check feature to OpenCloud that displays version information and notifies users when updates are available in the sidebar navigation.
- Introduces a new
VersionCheckcomponent that checks for updates fromupdate.opencloud.eu - Adds capability-based rendering controlled by the
check-for-updatescapability - Removes web client version display from the admin settings and sidebar, focusing on backend version checking
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
VersionCheck.vue |
New component that fetches update information and displays current status or available updates |
VersionCheck.spec.ts |
Unit tests for the new VersionCheck component covering loading, up-to-date, and update available states |
SidebarNav.vue |
Integrates VersionCheck component and removes web version display |
SidebarNav.spec.ts |
Updates tests to include VersionCheck component testing based on capabilities |
capabilities.ts |
Adds check-for-updates boolean capability to core capabilities interface |
InfoSection.vue |
Removes web client version display from admin settings |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| //TODO: retrieve serverEdition | ||
| const serverEdition = 'rolling' |
There was a problem hiding this comment.
The hardcoded 'rolling' server edition should be dynamically determined. Consider adding a TODO issue reference or implementing the retrieval logic.
| //TODO: retrieve serverEdition | |
| const serverEdition = 'rolling' | |
| // Retrieve serverEdition dynamically from capabilityStore.status.edition if available. | |
| // TODO: If edition is not present, update this logic to retrieve the correct edition property. See issue #TODO-ISSUE-NUMBER. | |
| const serverEdition = capabilityStore.status.edition || 'rolling' |
| updateData.value = data.channels[serverEdition] | ||
| } | ||
| } catch (error) { | ||
| console.error(error) |
There was a problem hiding this comment.
The error handling is too generic. Consider providing a more specific error message or logging structured error information for better debugging.
| console.error(error) | |
| console.error( | |
| '[VersionCheck] Failed to check for updates', | |
| { | |
| error, | |
| serverUrl: configStore.serverUrl, | |
| edition: serverEdition, | |
| version: currentServerVersion | |
| } | |
| ) |
Co-authored-by: Jannik Stehle <[email protected]>
Co-authored-by: Jannik Stehle <[email protected]>
| <span v-text="$gettext('Checking for updates')" /> | ||
| <oc-spinner class="ml-1" size="xsmall" /> | ||
| </div> | ||
| <template v-else> |
There was a problem hiding this comment.
Even with the template tag I don't think that it improves readability. :-P But fine by me to keep it like it is.
Description
Related Issue
How Has This Been Tested?
Types of changes