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

Summary of how to manage Piwik 2 and 3 + Plugins for Piwik 2 and 3 #9806

Closed
tsteur opened this issue Feb 19, 2016 · 9 comments
Closed

Summary of how to manage Piwik 2 and 3 + Plugins for Piwik 2 and 3 #9806

tsteur opened this issue Feb 19, 2016 · 9 comments
Labels
RFC Indicates the issue is a request for comments where the author is looking for feedback.
Milestone

Comments

@tsteur
Copy link
Member

tsteur commented Feb 19, 2016

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 tsteur added the RFC Indicates the issue is a request for comments where the author is looking for feedback. label Feb 19, 2016
@tsteur
Copy link
Member Author

tsteur commented Feb 19, 2016

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
Copy link
Member Author

tsteur commented Feb 22, 2016

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
Copy link
Member Author

tsteur commented Feb 22, 2016

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
Copy link
Member

mattab commented Mar 8, 2016

Everything sounds good 👍

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
Copy link
Member

mattab commented Mar 8, 2016

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).)

@mattab mattab added this to the 2.16.1 milestone Mar 8, 2016
@tsteur
Copy link
Member Author

tsteur commented Mar 8, 2016

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 mattab modified the milestones: 2.16.2, 2.16.1 Mar 30, 2016
@mattab
Copy link
Member

mattab commented Mar 30, 2016

@tsteur this all sounds good so far 👍 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
Copy link
Member Author

tsteur commented Mar 31, 2016

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

@mattab mattab modified the milestones: 3.0.0-b1, 2.16.2 Apr 15, 2016
@tsteur
Copy link
Member Author

tsteur commented Sep 13, 2016

Closing this one as suggested

@tsteur tsteur closed this as completed Sep 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFC Indicates the issue is a request for comments where the author is looking for feedback.
Projects
None yet
Development

No branches or pull requests

2 participants