Jump to content

Changelog support in ProcessWireUpgrade module


szabesz
 Share

Recommended Posts

  • 10 months later...

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
Link to comment
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
Link to comment
Share on other sites

  • 4 weeks later...

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 2
Link to comment
Share on other sites

  • 3 months later...
  • 2 weeks later...
  • 4 weeks later...
  • 1 month 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

×
×
  • Create New...