From b115f946cda304e64c8a5e16cc085ef3152fd830 Mon Sep 17 00:00:00 2001 From: Bernhard Kirchen Date: Fri, 23 Aug 2024 16:24:01 +0200 Subject: [PATCH] Fix: update info: compare to respective branch official release builds are built from branch master, as the respective tags point to commits in branch master (only). to check whether or not a new version is available, we should check branch master for new commits. checking against HEAD does not work as expected, at least in the OpenDTU-OnBattery repo, since its default branch is "development", not "master". usually, there should be no commits on master in between releases, so we will now only show "update available" if a new release was made. this is not foolproof, but should work as long as we keep "master" clean. for builds from other branches, the comparison is perfomed against the respective branch. if a user installed a binary built by github actions based on a development branch, the user will see "update available" if new commits were added to the development branch since. for other branches, also pull request builds, the test for updates will fail as the branch name shown in the system info is not actually a branch name, e.g., "helgeerbe/OpenDTU-OnBattery/pr1183-202408212043". --- webapp/src/views/SystemInfoView.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/webapp/src/views/SystemInfoView.vue b/webapp/src/views/SystemInfoView.vue index 5b4e060c..5dd0ca1e 100644 --- a/webapp/src/views/SystemInfoView.vue +++ b/webapp/src/views/SystemInfoView.vue @@ -79,7 +79,8 @@ export default defineComponent({ const fetchUrl = 'https://api.github.com/repos/helgeerbe/OpenDTU-OnBattery/compare/' + this.systemDataList.git_hash + - '...HEAD'; + '...' + + this.systemDataList.git_branch; fetch(fetchUrl) .then((response) => {