Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running latest version notifies of new release #1966

Closed
ArthurHoaro opened this issue Mar 25, 2023 · 3 comments · Fixed by #1971
Closed

Running latest version notifies of new release #1966

ArthurHoaro opened this issue Mar 25, 2023 · 3 comments · Fixed by #1971
Labels
Milestone

Comments

@ArthurHoaro
Copy link
Member

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.

@nodiscc
Copy link
Member

nodiscc commented Mar 26, 2023

I believe it's because before we were ignoring that check if the current version was dev

Yes this is it:

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...).

@nodiscc nodiscc added this to the 0.13.0 milestone Mar 26, 2023
@nodiscc
Copy link
Member

nodiscc commented Mar 28, 2023

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?

@ArthurHoaro
Copy link
Member Author

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 the release 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.

ArthurHoaro added a commit to ArthurHoaro/Shaarli that referenced this issue Apr 8, 2023
Always use 'release' branch instead. Also treat commit hash as dev version

Fixes shaarli#1966
ArthurHoaro added a commit to ArthurHoaro/Shaarli that referenced this issue Apr 8, 2023
Always use 'release' branch instead. Also treat commit hash as dev version

Fixes shaarli#1966
ArthurHoaro added a commit to ArthurHoaro/Shaarli that referenced this issue Apr 8, 2023
Always use 'release' branch instead. Also treat commit hash as dev version

Fixes shaarli#1966
@nodiscc nodiscc modified the milestones: 0.13.0, 0.14.0 Nov 22, 2023
ArthurHoaro added a commit that referenced this issue Nov 22, 2023
* Remove 'updates.check_updates_branch' setting

Always use 'release' branch instead. Also treat commit hash as dev version

Fixes #1966

* Revert auto formatting

* linter

* Updater: remove updates.check_updates_branch setting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants