Skip to content

Commit

Permalink
Fix: update info: compare to respective branch
Browse files Browse the repository at this point in the history
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".
  • Loading branch information
schlimmchen committed Aug 23, 2024
1 parent 65407db commit b115f94
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion webapp/src/views/SystemInfoView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit b115f94

Please sign in to comment.