szabesz

Changelog support in ProcessWireUpgrade module

Recommended Posts

As fas as I know, currently there is no way for a module developer to include a changelog in a way that enables us to check out the changes in the admin before upgrading.

  • Like 12

Share this post


Link to post
Share on other sites

I would also love to see this - I think it would be great if we could define it in a Github repo changelog.md file and have the automatically imported into the text in the modules directory, and perhaps even displayed in the module info within a PW install. Perhaps it would even be nice to have a way to add a flag about breaking changes that would show up in the ProcessWire Upgrades module so you are warned before upgrading.

@ryan - any thoughts on this? I'd be happy to work on it - obviously I could do the PW side of it from the repo, but would need access to the php files for the modules directory to make that side of things work.

  • Like 12

Share this post


Link to post
Share on other sites

is there any progress on having Changelogs for an update, so we can know if some updates are worth updating to. 

  • Like 1

Share this post


Link to post
Share on other sites
On 3/1/2017 at 11:52 PM, adrian said:

I would also love to see this - I think it would be great if we could define it in a Github repo changelog.md file and have the automatically imported into the text in the modules directory, and perhaps even displayed in the module info within a PW install. Perhaps it would even be nice to have a way to add a flag about breaking changes that would show up in the ProcessWire Upgrades module so you are warned before upgrading.

@ryan - any thoughts on this? I'd be happy to work on it - obviously I could do the PW side of it from the repo, but would need access to the php files for the modules directory to make that side of things work.

I thought of a concept and it doesn't have to be as complex infact here's my proposition

There should be a changelog.md and also another changelog.json which contains each version and the text serving as the changes, however this might hard to implement as it means enforcing everyone to do this, another better alternative could be a changelog.md with a specific format to follow, so that a Parser can be read to extract the needed information, it is vital a changelog is seen before uploading to inform user about what has changed and what to expect. 

  • Like 3

Share this post


Link to post
Share on other sites

Jump jumping in to support this idea. I can't like it twice ^_^

  • Like 2

Share this post


Link to post
Share on other sites

Can't we use upgrade() function inside modules to achieve this? It's not as eloquent as having the changelog available before downloading new version, but developers can use it to display certain info, and request confirmation during/abort if possible. Something like this:

<?php namespace ProcessWire;

class MyModule extends Module
{
  	// ...
  	// (module implementation)
  	// ...
    public function upgrade($from, $to) {
        // TODO: remove after v2.0
        // upgrading to v2.0, show warning about breaking changes
        if(strpos($from, '1.') === 0 && strpos($to, '2.') === 0) {
            $this->warning("New version includes <strong>breaking</strong> changes. See module info page for details.", Notice::allowMarkup);
            // create some info page, display compiled output of README.md
            // not sure how to display info on Process pages
          
            if (!$accepted) {
                throw new WireException('Cannot install without confirmation');
            }
        }
        return $to;
    }
}

 

  • Like 1

Share this post


Link to post
Share on other sites

+1

Displaying a changelog before upgrading a module or even the core is badly needed. Also the changelog should be visible everytime on a module detail page.

  • Like 2

Share this post


Link to post
Share on other sites

Thanks to a pointer from Adrian, I just found this thread. Want to cross-reference this post here. There are a few possible ways of handling this and I'd like to work on the issue after I finish my current client work.

  • Like 1

Share this post


Link to post
Share on other sites
2 hours ago, netcarver said:

There are a few possible ways of handling this and I'd like to work on the issue after I finish my current client work.

Thanks in advance!

Share this post


Link to post
Share on other sites

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


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By mike62
      I am new to ProcessWire; I'm a WordPress developer coming into an existing PW site. I noticed that the site I'm working on is version 2.3 and wanted to upgrade it to the latest version so that I could be sure that the documentation was relevant to me.
      I downloaded v2.8.62 Legacy today and followed the upgrade steps. The backend works fine, but the frontend gives me this error message:
      Error: Exception: Method ProcessWire::getArray does not exist or is not callable in this context (in /home/delucaswpg/webapps/delucas_dev/wire/core/Wire.php line 519) #0 /home/delucaswpg/webapps/delucas_dev/wire/core/Wire.php(386): Wire->___callUnknown('getArray', Array) #1 /home/delucaswpg/webapps/delucas_dev/wire/core/WireHooks.php(698): Wire->_callMethod('___callUnknown', Array) #2 /home/delucaswpg/webapps/delucas_dev/wire/core/Wire.php(442): WireHooks->runHooks(Object(ProcessWire), 'callUnknown', Array) #3 /home/delucaswpg/webapps/delucas_dev/wire/core/ProcessWire.php(587): Wire->__call('callUnknown', Array) #4 /home/delucaswpg/webapps/delucas_dev/wire/core/Wire.php(445): ProcessWire->__call('callUnknown', Array) #5 /home/delucaswpg/webapps/delucas_dev/wire/core/Wire.php(445): ProcessWire->callUnknown('getArray', Array) #6 /home/delucaswpg/webapps/delucas_dev/wire/core/ProcessWire.php(590): Wire->__call('getArray', Array) #7 /home/delucaswpg/webapps/delucas_dev/site/modules/Spex/Spex.module(163): ProcessWire->_ This error message was shown because: you are logged in as a Superuser. Error has been logged. The site is hosted on WebFaction and can be found here: http://dev.delucaswpg.webfactional.com. Any help would be greatly appreciated.
      -Mike
    • By holmescreek
      Question 1
      I recently installed PW 3.0.62 for a new site and also have sites running older version of PW 3.x.
      Can I export the database on an older version of PW 3.x and import it to PW 3.0.62 without any issues?
       
      Question 2
      (This is kind of alternative to the above for long term use - and maybe a better solution...)
      On  the sites I've previously built I have templates (home, basic-page, contact) and fields that I commonly use, such as business_name, phone_1.  The last site I built is running PW 3.0.42.  I was considering cloning this into a local site and running the upgrade module to bring it up to PW 3.0.62. From there on out when I start I new project I could just run the PW upgrade module, copy the folder to the location for the new project and duplicate the database using the new projects name.

      So basically, I'll always keep a "blank slate" site that I can just run the PW upgrade on, then duplicate into a new project. This would cut down on the work and time spent having to re-create these common fields, that I use. From there, I would just add fields, templates, etc, specific for the new website project.

      Is this a sound approach to speed up development?

       
    • By FvG
      Hi there!
       
      I haven't used PHP and Processwire for almost four years now, but now I need a good CMS again ;-) I just found an old PW installation (2.3.0), which I would like to update to the current version. What's the best way to do this? It looks like starting from 2.5.0 there is a module which does updates automatically, so would it make sense to update to 2.5.0 and then let PW do it? 
       
      Thanks for your suggestions!
       
    • By CarloC
      Hi everyone,
      I've upgraded one of my pw 2.7 websites to the 2.8 legacy version and I'm encountering some problems.
      As you can see in the image I don't see uploaded images thumbnails anymore, and the repeater fields previously added are no more usable.

      Why I'm having this strange behaviour simply after an upgrade from processwire 2.7 to 2.8?
      Hope you can help me, I'd like to use the 2.8 version features like the front-end inline editing, but it seems like I'll be locked in the 2.7 version forever
      Thank you!
       
    • By holmescreek
      I just posted a question about moving PW from a resting domain to a production domain, after consideration I figure I would create a new post for a second question I have.
      I noticed the coming feature of client size image resizing. This will be really helpful, as I have some clients on a Satellite connection. I'm telling you, them trying to upload 15MB images, or them getting them straight on batch resizers (or Photoshop) to resize before upload is a real chore. Needless to say, Ryan has been doing an excellent job addressing this.
      My question, is that I have several clients on PW 2.x thru 3.x. Is there a really good guide on steps that I need to take to update the core to take advantage of the features of new releases? Are their perils to look out for?
      Yeah, after developing several sites, I feel a bit silly about asking this one, but, the docs doesn't seem to be clear in a "general" sense of upgrading the core across all versions.
      Thanks everyone for your time and assistance.