@tsteur opened this Issue on February 19th 2016 Owner

We had a meeting and discussed how we could handle Piwik 2 and 3 in the future. This is a summary of the discussions so far.

Piwik core:

We will have the following branches (names to be defined):

  • 2_X
  • 3_X
  • master

master will point to 2_X until we have made good progress for 3.0. Say approx 2 months before the first RC we will switch master to 3_X. Every day or so we will merge 2_X into master (if build is green), but this is part of lifecycle project. The 2_X/3_X branches will be basically our develop branches. Pull requests will need to be made against 2_X or 3_X probably. To explain this we could use new Pull request template feature.

Plugins

Our plugins will have the same branches (names to be defined):

  • 2_X
  • 3_X
  • master

master points basically to 2_X as well. As soon as we merge core 3_X into core master, and the plugin was made compatible with core 3_X, we will merge the plugin 3_X into plugin master.

We always create the branches for the different versions all the time as tests won't be able to support 2.X and 3.X (different system and UI tests etc) and we actually want to have LTS for plugins too. Also this way we make sure to keep master always green. In plugins 3_X branch we need to require piwik: >=3.0.0, in 2_X branch we need to require piwik: <3.0.0. We need to have an automated test for this to make sure our plugins have this specified.

Tests:

As our plugins will either support Piwik 2 or 3, not much will change:

  • If plugin supports piwik:>=2.0|<=3.5 we run tests against minimum (2.0.0), latest stable (3.5) and maximum version (3.5)
  • If plugin supports piwik:>=2.0 we run tests against minimum (2.0.0), latest stable (eg 3.7) and maximum version (latest 3.X beta or master)
  • If plugin supports piwik:<3.0.0 we run tests on minimum (2.0.0), latest stable (eg 2.16.1), and maximum version (latest 2.16.X beta or master)
  • If plugin supports piwik:>=3.0.0 we run tests on minimum (3.0.0), latest stable (eg 3.7) and the maximum version (latest 3.X beta or master)
  • UI tests always run against maximum supported Piwik version. To be defined is which PHP version we will use.

Possibly we run UI tests against PHP 5.5 and PHP 5.6 to make sure it works on both PHP versions. Maybe PHP 5.5 and PHP 7.0. Ideally we run (UI) tests against all major supported PHP versions

Marketplace:

  • PiwikVersion and PHPVersion will be needed in order to detect supported plugin versions --> we need to send current installed versions with all API requests to the Marketplace. If in the Marketplace API there is no version defined, we just assume Piwik latest 2.16.X with PHP 5.3.3 (minimum supported version). This is the case for API version 1 pre Piwik 2.16.1.
  • We iterate over all versions and pick the most recent released version that matches the require specified in plugin.json (later composer.json)
  • The Marketplace can handle many release channels, we check if there is the same require statement already present if so check that version increases. Otherwise we only check version number has not been used before
  • We show a version selector on the Marketplace letting user select 2.X and 3.X, also on the plugin detail page we show a Piwik version selector
  • We might make it possible to download different versions of the plugin in changelog and we might show which versions they support

This will be our process so far, if you have any feedback let us know.

@tsteur commented on February 19th 2016 Owner

After the release of Piwik 2.16.1 we will fully focus on Piwik 3 and fix bugs etc in 3_X and if needed cherry-pick them into 2_X

@tsteur commented on February 22nd 2016 Owner

FYI: We will also require any plugin developer to specify a supported Piwik version. We may need to adjust our example plugins that are used for generating a plugin / theme.

Eg one has to specify require: {"piwik": ">=2.0.0"}. If it's not there, we will assume for existing plugins that require: {"piwik": ">=2.0.0,<3.0.0"} is specified

@tsteur commented on February 22nd 2016 Owner

done... should we also force defining which PHP version is supported? I presume we cannot expect that developers test it eg on PHP 5.3 (or later PHP 5.5 with Piwik 3) when they develop on eg PHP 7

@mattab commented on March 8th 2016 Owner

Everything sounds good :+1:

PiwikVersion and PHPVersion will be needed in order to detect supported plugin versions --> we need to send current installed versions with all API requests to the Marketplace

Is this already implemented or does it need to be done? (maybe you could implement this in 2.16.1?)

@mattab commented on March 8th 2016 Owner

should we also force defining which PHP version is supported? I presume we cannot expect that developers test it eg on PHP 5.3 (or later PHP 5.5 with Piwik 3) when they develop on eg PHP 7

if our tests run on older PHP 5.X and we assume that tests cover the plugin's functionality, maybe we could pre-set the required PHP version to 5.X ? (to decide on 5.X we should pick the maximum version used for running tests (ie. if we run unit/integration/system tests on 5.3 but UI tests on 5.5 then 5.5 should be minimum required PHP version).)

@tsteur commented on March 8th 2016 Owner

PiwikVersion and PHPVersion will be needed in order to detect supported plugin versions --> we need to send current installed versions with all API requests to the Marketplace
Is this already implemented or does it need to be done? (maybe you could implement this in 2.16.1?)

This is implemented in https://github.com/piwik/piwik/pull/9797 we also send release channel and whether someone prefers a stable version or is keen on betas.

if our tests run on older PHP 5.X and we assume that tests cover the plugin's functionality, maybe we could pre-set the required PHP version to 5.X ? (to decide on 5.X we should pick the maximum version used for running tests

It's really tricky here. I first added it in core and Marktplace (even require it's set) but then changed mind again and rather removed it as it may be hard to maintain and developers might forget to maintain the PHP version anyway. So I won't require it's set in the Marketplace. By default for now plugins are supposed to support same minimum PHP version as the lowest Piwik version they support. Eg when a plugin supports Piwik 2.X they should support PHP 5.3.3, for Piwik 3.X they should possibly support PHP 5.5.X.

I reckon this is not the reality though so we should maybe set it in the plugin generator, or when generating a component. Whenever generating any component, such as an API or a Controller for a plugin, I did update the plugin.json and set the minimum PHP version. However, this doesn't really work whenever multiple developers work on one plugin over time (eg case for Piwik PRO). It would always randomly change the PHP version depending on which developer is generating a component for the plugin. So the next thought was to set the required PHP version in plugin.json only when it is not there yet. However, in this case it will be likely forgotten to be changed when the plugin developer increases PHP version (which is likely to happen over time) and for Piwik PRO developers we probably always want to support the same minimum PHP version as Piwik so this behaviour is not wanted there.

In the end I decided to simply leave it as it is. Maybe we could show a warning or question whenever generating a component for a plugin and there is no PHP version set, to ask the plugin developer to verify whether the min PHP version of Piwik is actually supported. We could also have different behaviour for Piwik PRO and community developers and eg not set a PHP version for Piwik PRO devs by default.

@mattab commented on March 30th 2016 Owner

@tsteur this all sounds good so far :+1: I've moved this issue to 2.16.2 where we will merge the Marketplace feature. Maybe this RFC could be closed (and ideally this knowledge, copied into Marketplace readme, or a relevant developer doc on developer.piwik.org ?)

@tsteur commented on March 31st 2016 Owner

It should be maybe put on developer.piwik.org as Marketplace is private. We have a "core" section on developer.piwik.org and could put it there somewhere

@tsteur commented on September 13th 2016 Owner

Closing this one as suggested

This Issue was closed on September 13th 2016
Powered by GitHub Issue Mirror