Jump to content

"Release aware" ProcessWireUpgrade Module


netcarver
 Share

Recommended Posts

If anyone's interested, I've forked Ryan's ProcessWireUpgrade module and added the ability for it to detect if github has a tagged release for the latest version of each listed module (except for the PW core repos which will require special handling). If a tagged release entry is found, it then adds an extra link to the table.

This is strictly an alpha "proof-of-concept" experiment, but if you are interested my fork of the repo is here - just replace the current version of the module code with my fork and you should be OK.

tmp001.thumb.png.cef8d40d4dd6b55228d7731d03db9282.png

Providing module authors start tagging their releases on github, it will allow you to navigate to the release notes for review before you hit the upgrade link.

As you can see, Mike Rockett has already started tagging his releases - and hence his module gets the extra "Release Notes" link.

Worthwhile idea?

  • Like 13
  • Thanks 1
Link to comment
Share on other sites

I messed around with the Modules Manager recently and found that this module does not fetch a complete module list from http://modules.processwire.com/export-json/, only the first 400 entries are retrieved but there are +- 497 modules in the database. The script you are using is currently set to get maximal 100 modules. You can safely increase the limit value from 100 to 400. Any value set greater then 400 will default back to 10.

In this case it is less likely a problem because someone has to have more then 100 modules installed, but you never know.

$url = 	$this->config->moduleServiceURL . 
			"?apikey=" . $this->config->moduleServiceKey . 
			"&limit=100" . 
			"&field=module_version,version,requires_versions,project_url" .
			"&class_name=";

Documentation: http://modules.processwire.com/export-json/ (limit = 1 - 400)

Hope this helps, I reported the problem to Ryan.

[edit]

After going over it again I found out that my previous conclusions are wrong, lol... you can actually read the complete module list in steps using pagination, something that is actually mentioned in the instructions but I didn't see (need more sleep/coffee).  

2nd page: http://modules.processwire.com/export-json/page2/?apikey=<key>&limit=250&debug=1

This however is not done by this script or by Modules Manager and should be fixed to make them more reliable.

I edited the top part of this post to reflect my new findings and to prevent confusion. 

  • Like 3
Link to comment
Share on other sites

Thanks Steve. Certainly a great idea and worth discussing.

Having had a look, I'd suggest that the Github API be used instead. This way, the release notes link can use a modal window to display the changelog. In my case, the body tag from the JSON response could be inserted. Not sure if the APIs for Bitbucket and Gitlab are easily accessible like Github's, but it's worth a shot.

  • Like 2
Link to comment
Share on other sites

  • 3 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...