Running latest version notifies of new release
ArthurHoaro opened this issue · comments
With the recent changes in how we handle the latest
Docker build, when we run the latest image - i.e. master - we get a notification saying that a new release is available.
I believe it's because before we were ignoring that check if the current version was dev
, while now the current version is the commit hash.
Also, locally I got a message to update to 0.12.2, which is normal, but on my own instance I got a message to upgrade to 0.11.1. There is maybe another underlying issue in the code.
I believe it's because before we were ignoring that check if the current version was dev
Yes this is it:
- https://github.com/shaarli/Shaarli/blob/master/application/legacy/LegacyUpdater.php#L435
- https://github.com/shaarli/Shaarli/blob/master/init.php#L62
We could fix it by prefixing the hash (https://github.com/shaarli/Shaarli/blob/master/.github/workflows/docker-latest.yml#L30) with dev@
, and ignoring the check if SHAARLI_VERSION
begins with dev
but on my own instance I got a message to upgrade to 0.11.1
As I noted in #1964, some parts of the updater code still refer to the stable
branch which was not updated after the v0.12.2 release. I think either merging v0.12.2
or release
to stable
would fix it (or a similar solution such as using a tag, deleting/recreating the stable branch from release
and force-pushing...).
I checked the stable
branch which was broken anyway because of a previous incomplete merge:
~/GIT $ git clone -b stable https://github.com/shaarli/Shaarli/
~/GIT $ cd Shaarli
~/GIT/Shaarli (stable=)$ git grep HEAD
[...]
application/updater/Updater.php:<<<<<<< HEAD
[...]
index.php:<<<<<<< HEAD
So I decided to delete it, create a new stable
branch from the v0.12.2
tag and force-push it:
~/GIT/Shaarli (stable=)$ git checkout master
~/GIT/Shaarli (master=)$ git branch -D stable
~/GIT/Shaarli (master=)$ git checkout v0.12.2
~/Shaarli ((v0.12.2))$ git checkout -b stable
~/GIT/Shaarli (stable)$ make test # OK
~/GIT/Shaarli (stable)$ git push -uf origin stable
Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
To https://github.com/shaarli/Shaarli
+ 7a9cacc...c2127f1 stable -> stable (forced update)
Branch 'stable' set up to track remote branch 'stable' from 'origin'.
~/GIT/Shaarli (stable=)$
on my own instance I got a message to upgrade to 0.11.1
This should be fixed, can you check?
Thanks @nodiscc! Yes, I get notified to update to v0.12.2
now instead of v0.11.1
.
After digging a little more, there are multiple things in motion here:
- as we said, the Docker image version is no longer
dev
. We could prefix it with dev, or we could just check if the current version is commit hash format instead of a version, it doesn't really matter. - there is a Shaarli setting under
general.check_updates_branch
that is used to determine against which branch an instance should retrieve the latest version available. We should get rid of that entirely and always use therelease
branch. - so we have the latest version in the server configuration page retrieved from the
release
branch, but the "Shaarli 0.12.2 is available" banner uses the branch set up in the configuration.