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

Use Github's tagged versions to detect if new version is available #5

Closed
e2jk opened this issue Jul 27, 2014 · 9 comments · Fixed by #31
Closed

Use Github's tagged versions to detect if new version is available #5

e2jk opened this issue Jul 27, 2014 · 9 comments · Fixed by #31
Assignees
Labels
bug it's broken!

Comments

@e2jk
Copy link

e2jk commented Jul 27, 2014

Up until v0.0.42beta, the function checkUpdate got it's latest version from @sebsauvage's website:
http://sebsauvage.net/files/shaarli_version.txt

Now that tagged versions will be available in GitHub (after #3 is merged and v0.0.42beta is released), the availability of a new version should be checked from https://github.com/shaarli/Shaarli/releases directly, which avoids having to update the version number on Seb's website (which has to be a manual action by himself)

That Github page will list all available versions, so we need to detect the most recent (à la Debian watch files, if I may say so ;) ).

The updated function should be future-proof, in case the versioning scheme changes from "0.0.Xbeta" to something a bit more conventional (see #4)

@e2jk e2jk added the bug label Jul 27, 2014
@Marsup
Copy link

Marsup commented Jul 28, 2014

It would be better done through https://api.github.com/repos/shaarli/Shaarli/tags.
Beware you need to set a User-Agent for that query.

I recently did it on another project (not php) with a semver module, works very well. It seems https://github.com/vierbergenlars/php-semver is a php port from the module I used, you just have to iterate on the list to eliminate names that are not .valid() and sort with rcompare, then compare the 1st one with what you have.

@nodiscc
Copy link
Member

nodiscc commented Jul 28, 2014

Or we could use the tags atoms feed to check for new versions: https://github.com/shaarli/Shaarli/tags.atom.

Or - maybe even better because is not github-specific and totally future proof - check against shaarli_version in https://raw.githubusercontent.com/shaarli/Shaarli/master/index.php. (much more portable, but this would mean always keeping the master branch in a working, releasable state).

@Sbgodin
Copy link

Sbgodin commented Jul 28, 2014

I also vote for master to be the stable branch. We might use a dev branch, which would contain a usable software on the developpeur point of view. If a function in development make the code unstable, then it'll be on a feature branch until the merge to dev.

@Sbgodin
Copy link

Sbgodin commented Jul 28, 2014

About the update check, imho it should follow such guidelines:

  • The user is fully aware of it existence.
  • The user must enable it himself
  • The user must be aware of the privacy concern (privacy vs. function)

The good thing would be to register to the update message service with a dedicated software. Erm... Do we have a something that tracks the updates on the code and something to stay in touch with such news? I heard about RSS ;-)

@nodiscc
Copy link
Member

nodiscc commented Jul 28, 2014

The user must enable it himself

Totally agree. Maybe a checkbox at setup and in the configure dialog:

  • Automatically check for updates. This will periodically check the author's code repository for new versions. Your current version is $shaarli_version. You can also stay informed of latest updates by subscribing to the releases feed

@Sbgodin
Copy link

Sbgodin commented Jul 28, 2014

👍

@nodiscc
Copy link
Member

nodiscc commented Aug 3, 2014

Having a better release policy would help with these issues:

@nodiscc
Copy link
Member

nodiscc commented Oct 23, 2014

Sorry this is not closed (it closed because of #31 message, wich is wrong)

@nodiscc
Copy link
Member

nodiscc commented Dec 2, 2014

I will now close this, please read #4 (comment) for an explanation. Using shaarli_version.txt for update checks is fine. We will still tags future versions.

@nodiscc nodiscc closed this as completed Dec 2, 2014
ajabep added a commit to ajabep/Shaarli that referenced this issue Apr 2, 2021
When we try to access the atom feed and have no bookmarks, it raised the following exception :

```
Call to a member function reorder() on array /webroot/application/bookmark/BookmarkFileService.php:143
#0 /webroot/application/feed/FeedBuilder.php(106): Shaarli\Bookmark\BookmarkFileService->search(Array, 'public', false, false, true)
shaarli#1 /webroot/application/front/controller/visitor/FeedController.php(47): Shaarli\Feed\FeedBuilder->buildData('atom', Array)
shaarli#2 /webroot/application/front/controller/visitor/FeedController.php(20): Shaarli\Front\Controller\Visitor\FeedController->processRequest('atom', Object(Slim\Http\Request), Object(Slim\Http\Response))
shaarli#3 [internal function]: Shaarli\Front\Controller\Visitor\FeedController->atom(Object(Slim\Http\Request), Object(Slim\Http\Response), Array)
shaarli#4 /webroot/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponse.php(40): call_user_func(Array, Object(Slim\Http\Request), Object(Slim\Http\Response), Array)
shaarli#5 /webroot/vendor/slim/slim/Slim/Route.php(281): Slim\Handlers\Strategies\RequestResponse->__invoke(Array, Object(Slim\Http\Request), Object(Slim\Http\Response), Array)
shaarli#6 /webroot/application/front/ShaarliMiddleware.php(55): Slim\Route->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response))
shaarli#7 [internal function]: Shaarli\Front\ShaarliMiddleware->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Slim\Route))
shaarli#8 /webroot/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Array, Array)
shaarli#9 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Slim\Route))
shaarli#10 /webroot/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Slim\Route))
shaarli#11 /webroot/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\Route->Slim\{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response))
shaarli#12 /webroot/vendor/slim/slim/Slim/Route.php(268): Slim\Route->callMiddlewareStack(Object(Slim\Http\Request), Object(Slim\Http\Response))
shaarli#13 /webroot/vendor/slim/slim/Slim/App.php(503): Slim\Route->run(Object(Slim\Http\Request), Object(Slim\Http\Response))
shaarli#14 /webroot/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\App->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response))
shaarli#15 /webroot/vendor/slim/slim/Slim/App.php(392): Slim\App->callMiddlewareStack(Object(Slim\Http\Request), Object(Slim\Http\Response))
shaarli#16 /webroot/vendor/slim/slim/Slim/App.php(297): Slim\App->process(Object(Slim\Http\Request), Object(Slim\Http\Response))
shaarli#17 /webroot/index.php(177): Slim\App->run(true)
shaarli#18 {main}
```
ArthurHoaro referenced this issue in ArthurHoaro/Shaarli May 8, 2021
When we try to access the atom feed and have no bookmarks, it raised the following exception :

```
Call to a member function reorder() on array /webroot/application/bookmark/BookmarkFileService.php:143
#0 /webroot/application/feed/FeedBuilder.php(106): Shaarli\Bookmark\BookmarkFileService->search(Array, 'public', false, false, true)
#1 /webroot/application/front/controller/visitor/FeedController.php(47): Shaarli\Feed\FeedBuilder->buildData('atom', Array)
#2 /webroot/application/front/controller/visitor/FeedController.php(20): Shaarli\Front\Controller\Visitor\FeedController->processRequest('atom', Object(Slim\Http\Request), Object(Slim\Http\Response))
#3 [internal function]: Shaarli\Front\Controller\Visitor\FeedController->atom(Object(Slim\Http\Request), Object(Slim\Http\Response), Array)
#4 /webroot/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponse.php(40): call_user_func(Array, Object(Slim\Http\Request), Object(Slim\Http\Response), Array)
#5 /webroot/vendor/slim/slim/Slim/Route.php(281): Slim\Handlers\Strategies\RequestResponse->__invoke(Array, Object(Slim\Http\Request), Object(Slim\Http\Response), Array)
shaarli#6 /webroot/application/front/ShaarliMiddleware.php(55): Slim\Route->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response))
shaarli#7 [internal function]: Shaarli\Front\ShaarliMiddleware->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Slim\Route))
shaarli#8 /webroot/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Array, Array)
shaarli#9 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Slim\Route))
shaarli#10 /webroot/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Slim\Route))
shaarli#11 /webroot/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\Route->Slim\{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response))
shaarli#12 /webroot/vendor/slim/slim/Slim/Route.php(268): Slim\Route->callMiddlewareStack(Object(Slim\Http\Request), Object(Slim\Http\Response))
shaarli#13 /webroot/vendor/slim/slim/Slim/App.php(503): Slim\Route->run(Object(Slim\Http\Request), Object(Slim\Http\Response))
shaarli#14 /webroot/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\App->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response))
shaarli#15 /webroot/vendor/slim/slim/Slim/App.php(392): Slim\App->callMiddlewareStack(Object(Slim\Http\Request), Object(Slim\Http\Response))
shaarli#16 /webroot/vendor/slim/slim/Slim/App.php(297): Slim\App->process(Object(Slim\Http\Request), Object(Slim\Http\Response))
shaarli#17 /webroot/index.php(177): Slim\App->run(true)
shaarli#18 {main}
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug it's broken!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants