@tsteur opened this Issue on October 28th 2014 Owner

See #6533

I think we should enable development mode in Git repository by default and disable it when building latest.zip. This improves the usability for developers. They currently have to check out Piwik from Git and always have to enable development mode afterwards, every developer, always. If a developer does not read carefully that he has to enable development mode it can even lead to errors and to an unhappy / frustrated developer who might not want to develop plugins for Piwik.

It was mentioned that some people use Piwik from Git in production which I think is a bad idea. Not only because it is unstable but because it may contain files that are not supposed to be in production etc. This can be a security issue. If someone wants to do this it might be better to have a separate repository containing only the files that are supposed to be in production or alternatively to make the build script work for such users to bring the original repository in the same state as the latest.zip. If someone misuses it for production it would be only a bit slower for him as caching is not enabled etc. We could mention this in FAQ or guide or whatever.

As we consider us as a platform the advantage for developers overweigh the disadvantage for users who use Piwik from Git in production.

@mattab commented on October 28th 2014 Owner

Great idea :+1:

@tsteur commented on October 28th 2014 Owner

I am wondering what the best way is to implement it. Disabling development mode and merged assets in build.sh via bash sounds a bit fragile.

Could we maybe use the common.config.ini.php to overwrite default values for development (meaning this would be in the GIT repository) and in build.sh simply remove this file which would be less fragile and better documented (meaning difference between GIT and latest.zip)? Any other ideas?

Content of file common.config.ini.php would be

[Development]
enabled = 1
disable_merged_assets = 1

I don't know if creating this file would cause any possible side effects.

@mattab commented on October 28th 2014 Owner

I don't know if creating this file would cause any possible side effects.

When Piwik is used as composer dependency then Piwik would have development mode enabled. I think using Piwik as composer dependency is legitimate use case so maybe it is risky to change this behavior. Unfortunately I can't think of ideal solution yet.

@mnapoli commented on October 28th 2014 Member

Out of curiosity do people use Piwik as a dependency and then use it like a real application? I mean I get why you would install it with Composer to reuse some classes, but running the whole application like this doesn't make sense to me, why allow that?

@mattab commented on October 28th 2014 Owner

@mnapoli it was real users who asked us for this. When it wasn't working they sent pull requests to make PIwik work when included as composer dependency. I don't know for sure how or why they do this, but for sure it's useful to them. Actually we even use this ourselves at Piwik PRO (see WIP misc-EnterpriseComposerFiles).

@tsteur commented on October 28th 2014 Owner

We should really have a separate repository for this containing only the files of latest.zip or use split build.sh script in two parts to make it possible to bring the repository in the same state as latest.zip. Everything else would be kinda careless / can lead to an error

@mattab commented on October 28th 2014 Owner

@tsteur This is important topic, we need to get it right! Maybe we can discuss and take decisions in the next sprint? (I'm referring to how misc-EnterpriseComposerFiles should work and whether we should load piwik as composer dependency and how we can test the 'composed' releases etc.)

See also: #6757

@mattab commented on April 7th 2015 Owner

This was done months ago

@mattab commented on April 7th 2015 Owner

actually it was not done, now that I read again the issue description, but I dont think we should care much about this. feel free to reopen

@tsteur commented on April 7th 2015 Owner

It means a lot to me. It removes one complicated step in all manuals etc. Considered we are a platform and we want to focus on this it is a must. Reopen :)

@mattab commented on April 7th 2015 Owner

Makes sense.

We should do this also:

@mnapoli commented on April 7th 2015 Member

@mattab we could also stop supporting deploying in production with git? I know some will do it anyway but we could not document it anymore, etc. what do you think? Is there a big value to offer support for git?

@tsteur commented on April 7th 2015 Owner

:+1: I had this discussion already with @mattab a while ago. Not sure whether on Github or here. We should be stop supporting / recommending it and the FAQ should recommend not to do this and that users will do it on their own risk.

If we or users still wanna do this, then they (or we) can create another repo or branch or whatever that contains only the released files for each version. It is a security risk to use Piwik from Git on production as for example many files that are supposed to be removed are not etc.

@tsteur commented on April 7th 2015 Owner

When working on this we could do the same for https://github.com/piwik/piwik/issues/7640 and enable logging of SQL statements by default but disable it in latest.zip

Powered by GitHub Issue Mirror